Old 26th November 2009, 08:13   #1
mitesh.khatri
Junior Member
 
Join Date: Nov 2009
Location: INDIA
Posts: 6
How to get installation drive name

Hello,
I want to get the installation drive where i install the particular installer. actually i need to delete some folder on installation drive. so can any one suggest how i do this.???
Thanks
mitesh.khatri is offline   Reply With Quote
Old 26th November 2009, 09:31   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
What are you after? The hardware info for a drive (and its partition)? (I ask this because you can't just take the first 3 letters of a full path and expect to get the correct drive letter for a folder deep in a path, for example: "c:\foo\bar" bar might not actually be on c: if foo is a mount point for a different partition)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 26th November 2009, 09:32   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
If you want the location of the installer, look at:
http://nsis.sourceforge.net/Docs/Chapter4.html#4.2.3


Edit: Anders is of course right. StrCpy is not the best way to go.
MSG is offline   Reply With Quote
Old 26th November 2009, 10:25   #4
mitesh.khatri
Junior Member
 
Join Date: Nov 2009
Location: INDIA
Posts: 6
I want to get the drive name there i install the particular software. like i install the particular software at c:\Programe Files\ABC
but i want to get only drive name like "C:\" only not the full installation path. so there is any direct method to get the installation drive.
mitesh.khatri is offline   Reply With Quote
Old 26th November 2009, 10:35   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
I just told you, for a path like "c:\Programe Files\ABC", ABC might NOT be on c:\

If you want to do this correctly, call GetVolumePathName with the system plugin on 2000 and later, and on older systems, just use strcpy to copy the first 3 letters

If you don't care, just use strcpy on all systems

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump