You are here

Variables in source code(help please)

4 posts / 0 new
Last post
Nathan9222
Nathan9222's picture
Offline
Last seen: 1 year 4 months ago
Developer
Joined: 2007-12-06 22:35
Variables in source code(help please)

Im wondering when you are looking for the environment variable for a program, for when you use "System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("APPDATA", "$SETTINGSDIRECTORY").r0'" what exactly would you be looking for in the source of that program so you can replace "APPDATA" with what it uses to store its data in its location it defines. Is it just like variable or the name of the folder where the data is being stored?? Thanks in advance for any help Smile

digitxp
digitxp's picture
Offline
Last seen: 11 years 4 months ago
Joined: 2007-11-03 18:33
Simple

there are different NSIS constants/vars that are built in. Here's a good list:

  • $APPDATA for %APPDATA%
  • $PROFILE for %USERPROFILE%
  • $DESKTOP for C:\Documents and Settings\%USERNAME%\Desktop
  • and $TEMP for %TEMP%

For even more variables, you can use the ReadEnvStr Command.
%APPDATA% is C:\Documents and Settings\%USERNAME%\Application Data .
It's where programs store their data usually, if not the app dir, the current dir, the registry, my docs, or a specified dir.
Please, do not use that line of code, as it disturbs other programs' settings as well as the app's.
BTW, you might want to clarify what you wanted to know.;)

Insert original signature here with Greasemonkey Script.

rab040ma
Offline
Last seen: 6 months 1 week ago
Joined: 2007-08-27 13:35
Other programs?

Can you give an example of when using the System call changes an environment variable for a different program? I think it only changes the environment variable that is inherited.

MC

Nathan9222
Nathan9222's picture
Offline
Last seen: 1 year 4 months ago
Developer
Joined: 2007-12-06 22:35
thanks.....

Im going through the source of Ares Galaxy, because I have been trying to figure it out the environment variable it uses to store its data. Until recently have I been going through its source code looking for something that will tell me what environment variable it uses. I have been working on Ares since early December, and havent had any luck with gettings its data to get in the $SETTINGSDIRECTORY. hmmm since I have the registry good and everything I might just put out a test in the beta forums until I can get the environment variable.

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