Reputation: 732
I have built an installer using WiX which lets the user upgrade a current installation to the next version and change the location of the install folder. This works when using the .msi file, but when running this silently using msiexec, my setting of the INSTALLDIR
is overwritten later on in the installation process.
I have had a look at the logs and it is being written over with the current install directory. I have a property which searches the registry for the current install location and sets the INSTALLDIR
to that value.
I guess in the .msi UI value, things are running in the right order, but with the silent install, they're not.
MSI (s) (A0:90) [09:47:34:315]: PROPERTY CHANGE: Modifying INSTALLDIR property. Its current value is 'C:\SpecifiedInSilentInstall'. Its new value: 'C:\CurrentInstallDirectoryFromRegistry\'.
Is there a way of specifying the order in a CustomAction
or something?
Upvotes: 0
Views: 668
Reputation:
If you are using a custom action like this
<CustomAction Id="SetInstallDir" Property="INSTALLDIR" Value="[YourInstallDir]" />
you can time it in your <InstallExecuteSequence>
section like this
<Custom Action="SetInstallDir" Before="CostFinalize" />
Here you can time your events with Before
and After
. These events follow a specific order (taken from FIREGIANT)
- AppSearch
- LaunchConditions
- ValidateProductID
- CostInitialize
- FileCost
- CostFinalize
- InstallValidate
- InstallInitialize
- ProcessComponents
- UnpublishFeatures
- RemoveShortcuts
- RemoveFiles
- InstallFiles
- CreateShortcuts
- RegisterUser
- RegisterProduct
- PublishFeatures
- PublishProduct
- InstallFinalize
- RemoveExistingProducts
For the property INSTALLDIR
it is important to set it at the right event to take effect (whatever your needs are). For me Before=CostFinalize
changes the path to the one I want.
Upvotes: 0