Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   drive of windows installed (http://forums.winamp.com/showthread.php?t=306528)

ghkumarmvk 19th May 2009 07:02

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 11:44

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 19:11

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 04:17

code:
ReadEnvStr $0 SYSTEMDRIVE
messagebox mb_ok "$0"



All times are GMT. The time now is 17:27.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.