|
|
#1 |
|
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 |
|
|
|
|
|
#2 |
|
Moderator
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 |
|
|
|
|
|
#3 |
|
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. |
|
|
|
|
|
#4 |
|
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. |
|
|
|
|
|
#5 |
|
Moderator
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 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|