cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TimStVCS
Level 7

Drive portion of [INSTALLDIR]

I am writing a Basic MSI project and I want to be able to get just the drive letter and colon designation of the directory path selected in the Destination Directory dialog box. I know that this value is stored in the [INSTALLDIR] system variable, but could someone help me out with how I can parse out the selected drive letter from this variable?

Thanks.

Tim
Labels (1)
0 Kudos
(4) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

A custom action would be needed to parse the INSTALLDIR path. If an InstallScript custom action is used, the GetDisk function will return the drive from a path provided to it.
0 Kudos
TimStVCS
Level 7

Thanks Josh. One question though, how do I reference the system variable INSTALLDIR using this function? Can I simply use INSTALLDIR or do I need to enclose it in quotes, or in brackets, etc.?

Thanks!
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

For any immediate scheduled InstallScript custom actions, you can use the INSTALLDIR script variable to obtain the INSTALLDIR path. This can be passed as is to GetDisk (no quotes or brackets since it is a variable).
0 Kudos
TimStVCS
Level 7

Thanks Josh, that did the trick!

Tim
0 Kudos