You are here

Local Settings Environment Variable??

6 posts / 0 new
Last post
Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 5 months ago
Developer
Joined: 2007-12-06 22:35
Local Settings Environment Variable??

My question is this, i am making an app portable that leaves its appdata in the
C:\Documents and Settings\****\local settings\application data folder, now when i try to get this to save in my data folder it always puts it in the C:\ instead of where i want it to go. What would i change in this part of my script:

!if "${REDIRECTUSERPROFILE}" = "TRUE"
		IfFileExists "$DATADIR\UserProfile\*.*" +2
			CreateDirectory "$DATADIR\UserProfile" ; create directory for portable user profile
		System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("USERPROFILE", "$DATADIR\UserProfile").r0' ; set new user profile folder
		StrCmp "$0" "0" ProfileError
			Goto ProfileDone
		ProfileError:
			MessageBox MB_ICONEXCLAMATION|MB_OK "Can't set environment variable for new Userprofile!$\nLauncher will be terminated."
			Abort
		ProfileDone:
	!endif

Oh yeah the environment variable for local settings is this i think "%userprofile%\local settings\application data" is there another one? and how would i add this to my script to get it to save in my "data" folder?
[Fixed your post up - Ryan]

wraithdu
Offline
Last seen: 10 years 9 months ago
Developer
Joined: 2007-06-27 20:22
What's the full path of

What's the full path of where your files end up? In the root of C:\ or some subfolder?

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 5 months ago
Developer
Joined: 2007-12-06 22:35
It ends up in a folder...

it ends up in a folder in the C:\Ares, instead of it being put in my "data\ares" folder.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

wraithdu
Offline
Last seen: 10 years 9 months ago
Developer
Joined: 2007-06-27 20:22
Not sure. It sounds like

Not sure. It sounds like it's checking for the existence of %userprofile%\Application Data\ or %userprofile%\Local Settings\Application Data\, and if it doesn't exist it's defaulting to C:\Ares.

Try creating $DATADIR\UserProfile\Application Data\ or $DATADIR\UserProfile\Local Settings\Application Data\

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 5 months ago
Developer
Joined: 2007-12-06 22:35
Alright ill try those and tell u how it goes

ill try those in a bit and tell u if they work.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Nathan9222
Nathan9222's picture
Offline
Last seen: 2 years 5 months ago
Developer
Joined: 2007-12-06 22:35
Nope they didnt work

I dont know but everything i try doesnt work. Im gonna check my script and make sure i didnt make an error or something.

An eye for an eye makes the whole world blind.
Mahatma Gandhi,
Indian political and spiritual leader (1869 - 1948)

Log in or register to post comments