cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Randy40
Level 4

Passing installdir to external MSI install

Hello, in my InstallScript build code I call an external MSI file that in turn installs a 3rd party application. I somehow need to pass the install drive and path chosen by the user (stored in svDir variable) to the MSI install. Is there a way to do this? Any information would be greatly appreciated. Thank you.

Regards,

Randy
Labels (1)
0 Kudos
(4) Replies
RobertDickau
Flexera Alumni

If you're launching an MSI package by hand, you can pass the installation directory like this:

msiexec.exe /i pkg.msi INSTALLDIR="C:\some\custom\directory"

so perhaps assemble the INSTALLDIR="value" part in your code, and then pass that as an argument to LaunchAppAndWait?
0 Kudos
Randy40
Level 4

That worked perfectly Robert, thanks!!

If I may, one more question: We want to give our users the choice of which drive to install our software to, but we want control over the rest of the install path. In other words, we want to sort of "hard code" the rest of the path so they can only choose a different drive. Is there a way to do this? I noticed that when you click the Browse button on the Destination Location dialog box the field is open for the user to change the drive letter AND the rest of the path. Somehow, we would like to prevent them from doing that. Again, your assistance is greatly appreciated.

Regards,

Randy
0 Kudos
RobertDickau
Flexera Alumni

I'm not aware of a drive-selection dialog box; you might need to create a custom dialog box with a list-box or combo-box control, populating it with GetValidDrivesList, and then assembling the full path based on the user's selection.

For more information about the custom-dialog part, anyway, please see "Using InstallScript to Implement Custom Dialogs" and the end of "Using InstallScript to Process Dialog Controls".
0 Kudos
Randy40
Level 4

I will definitely check that out, thanks again for all your help Robert. Cheers.

Regards,

Randy
0 Kudos