Skip to content
⌘ NSIS Forum Archive

System directory efectingsection run

7 posts

Benoni#

System directory efectingsection run

If possible, what code should I use to make NSIS detect the Windows system directory, and if it is:

c:\windows\system\ Run one section
c:\winnt\system\ Run another section
Anything Else Quit

Thanks
Benoni
kichik#
Use $SYSDIR to get the system directory. For example:

MessageBox MB_OK "System directory is '$SYSDIR'"
# or
StrCmp $SYSDIR "C:\\WinNT\\System" NT NotNT
NotNT:
   # do not NT stuff
   Goto done
NT:
   # do NT stuff
done: 
If you do this comparsion to test if you are installing on Windows NT you better use GetWindowsVersion.
Benoni#
Thanks

Thanks for that. I knew about $SYSDIR but didn't know how to run a different section depending on what values it was. As well as the two I was going to use (c:\windows\system c:\winnt\system) I also think c:\winnt\system32 is common as well. Please correct me if I am wrong. If you know of any other common system directorys could you please post them here?
Thanks
Benoni
kichik#
$SYSDIR gives System32 on NT. Going by common is not such a good idea if you wish to install files into the system directory. What is it that you are trying to do? If you specify a bit more maybe I could help you accomplish your wish in a better method.
Benoni#
The install program is for just for friends and copies a couple of files into the system directory. The program also needs an encrypted .ini file to tell it where the program is installed. Therefore I can only make a couple of .ini files for the most common sysdirs and then copy the one for that system directory. That was why I wanted to know the most common system directories.
Benoni
Benoni#
This INI file is encrypted and needs to be edited using a special program which knows how it is encrypted