ghkumarmvk
19th May 2009 08:02 UTC
drive of windows installed
sir,
anybody have the code of getting the drive name (eg: C:\, D:\) where windows installed for a nsis file? . i created a setup program to install my program using nsis. now i coded C:\ or D:\ directly on the code, but i want the setup program to check whether the windows installed on C:\ or D:\ and that drive letter shown in setup program to install .
any help??
with regards
G.H.Kumar
Animaether
19th May 2009 12:44 UTC
you could just make use of e.g. $SYSDIR (the full path to the system32 folder, which I think you can't change from the windows installation drive's; unless you did some major hacking after install, I suppose), and then just grab the drive from that using string manipulation.
qwertymodo
21st May 2009 20:11 UTC
StrCpy $YourVar "$SYSDIR" 3
This will give you C:\
Change the number to change the number of characters (i.e. 1-C, 2-C:, 3-C:\, etc)
Red Wine
22nd May 2009 05:17 UTC
ReadEnvStr $0 SYSTEMDRIVE
messagebox mb_ok "$0"