Author Topic: Problem with codeblocks user settings path  (Read 7664 times)

jahurtado

  • Guest
Problem with codeblocks user settings path
« on: May 17, 2005, 05:30:12 pm »
When I run Codeblocks I receive this message:

'%USERPROFILE%/.Codeblocks' couldn't be created (error 3: ...)

I try to create this path manually but still the same message.
OS: Windows XP with SP2

I test codeblocks on another cumputer without SP2 and work fine.

Any suggestion?

Thanks.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Problem with codeblocks user settings path
« Reply #1 on: May 17, 2005, 05:57:36 pm »
Some Questions

- Do you log in with a limited account?
- Please open a DOS (command prompt) window and type "SET". Look for the 'USERPROFILE' environment variable. Is it set? (it SHOULD be!)
- Have you set any kind of SW restrictions, antivirus, etc that could make CB misbehave? Do you have the "data flag" set in your windows?

Anonymous

  • Guest
Problem with codeblocks user settings path
« Reply #2 on: May 17, 2005, 07:12:32 pm »
Quote from: rickg22
Some Questions

- Do you log in with a limited account?
- Please open a DOS (command prompt) window and type "SET". Look for the 'USERPROFILE' environment variable. Is it set? (it SHOULD be!)
- Have you set any kind of SW restrictions, antivirus, etc that could make CB misbehave? Do you have the "data flag" set in your windows?


1. It s not a limited account.
2. Yes, user profile has properly setted.

3. Data flag? ...

Well, this computer doesn't not have any restrictions (I use an Administrator account). Even I could create that directory with:

mkdir "%USERPROFILE%"\.CodeBlocks
(quotes are needed)

Other applications (such gimp) can create their user directories on %USERPROFILE% without problems (even beginning with a dot character).

Is posible that the problem be that %USERPROFILE% doesn't place between quotes?

Thanks

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Problem with codeblocks user settings path
« Reply #3 on: May 17, 2005, 08:29:05 pm »
Quote
Is posible that the problem be that %USERPROFILE% doesn't place between quotes?

Nope:
Quote
I test codeblocks on another cumputer without SP2 and work fine.

That's strange. You 're the first person to report something like it, and I use C::B daily (of course ;) ) in XP SP2 machines...

Yiannis.
Be patient!
This bug will be fixed soon...

jahurtado

  • Guest
Problem with codeblocks user settings path
« Reply #4 on: May 17, 2005, 10:21:27 pm »
Quote from: mandrav

That's strange. You 're the first person to report something like it, and I use C::B daily (of course ;) ) in XP SP2 machines...

Yiannis.


Ok, I soved it, Some environment vars (a variable %HOME% that I was setted) caused the problem.

It's seems that if a HOME environment var is defined, it's used instead of USERPROFILE.

Thanks

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Problem with codeblocks user settings path
« Reply #5 on: May 17, 2005, 10:48:28 pm »
Quote
It's seems that if a HOME environment var is defined, it's used instead of USERPROFILE.

Thanks for sharing this. It's tricky...

Yiannis.
Be patient!
This bug will be fixed soon...

cataddict

  • Guest
Re: Problem with codeblocks user settings path
« Reply #6 on: July 28, 2005, 02:06:21 am »
OK, I'll resurrect this thread as my first post. I also get the '%USERPROFILE%/.Codeblocks' couldn't be created (error 3: ...)" message when using CB RC-1 (and finalbeta). I'm using Win 2000 SP4 and it happens the same on both my machines. I saw reference to having %HOME% set could cause problems -> it is set to HOME=%userprofile% by default on both machines. I'm afraid to delete HOME since I don't know what if anything that would break.

Oddly, the version of CB that I compiled myself a week or so ago from the HEAD doesn't exihibit this problem. It creates the .CodeBlocks directory and workspace files fine.

Any new thoughts??

FYI - I love where this program is heading!

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Problem with codeblocks user settings path
« Reply #7 on: July 28, 2005, 03:03:13 am »
A possible fix would be to test if the USERPROFILE env variable is not set. If so, set it to mimic the HOME variable.

cataddict

  • Guest
Re: Problem with codeblocks user settings path
« Reply #8 on: July 28, 2005, 05:25:00 am »
USERPROFILE variable is set USERPROFILE=c:\Documents and Settings\Administrator

but I can change:
HOME=%USERPROFILE%
to
HOME=C:\Documents and Settings\Administrator

and RC1 seems to work with a hardcoded value for HOME

Offline kagerato

  • Multiple posting newcomer
  • *
  • Posts: 56
    • kagerato.net
Re: Problem with codeblocks user settings path
« Reply #9 on: July 28, 2005, 03:20:24 pm »
The environment variable (%HOME%, in this case) may have been an unexpandable REG_SZ value in the registry.  The only way to know whether that is/was the case or not is to check the appropriate key in the registry.  Global environment variables are defined at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment , and local environment variables are defined at HKEY_CURRENT_USER\Environment.  The name of the value will be the environment variable's designation (without the percent identifiers), and the value's data is what the environment variable will be replaced by (expanded to) when used in a valid context.

The registry is a rather esoteric system, though.  If the environment variable's value is of type REG_SZ (essentially, a basic string), then no expansion using other environment variables will occur.  This can cause problems because most parsers expect that an expanded environment variable will produce an absolute path to a valid location.  The potential conflict of interpretation can be avoided by defining environment variables using REG_EXPAND_SZ -- this type of value will undergo environment variable expansion before the literal string is returned to the accessing program.

That explanation is probably too long-winded for most; just ensure that any environment variables which utilize other environment variables in their data are of type REG_EXPAND_SZ.