Reputation: 11
Is it possible for me to use MsiExec and set the install directory with the ProductVersion property as part of the path?
msiexec /i C:\myapp.msi INSTALLDIR=C:\MyApp\[ProductVersion]
Upvotes: 0
Views: 1090
Reputation: 55571
You would need a script to query the MSI's Property table to obtain the ProductVersion and then use that to build your command line.
If this is your install and this is your desired behavior, then you'd be better off authoring a custom action to mutate the INSTALLDIR automatically. If this is not your install and this is just how you like to install the product then ServerFault is a better place to ask this.
Upvotes: 1
Reputation: 688
You can't use a property on the command line like that. If [ProductVersion] is used in the directory table or to build up INSTALLDIR as part of the MSI, that would work fine. However, MSI properties have no meaning to the command interpeter.
You can set properties on the commandline like
msiexec /i PROPERTY=VALUE A:\Example.msi
(from: http://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx)
Upvotes: 2