Reputation: 69
I have a visual studio setup project creating a setup.msi. I have some custom actions running during and after an installation.
When I execute the command msiexec.exe /a setup.msi /qn to upgrade an existing installation, the custom actions are not firing. It seems that the option /a (administrative execution) is bypassing the custom actions.
Any idea ?
Thank you in advance.
Upvotes: 1
Views: 921
Reputation: 42126
Administative installation runs in its own sequence inside the MSI. Hence you can actually insert custom actions there (though I would not recommend it), and they will run only during administrative installations.
You would need to insert these custom action in the normal installation sequence (as well) for them to ever run during normal installation (InstallExecuteSequence
and / or InstallUISequence
).
Normal Install:
InstallExecuteSequence
InstallUISequence
Administrative Install:
AdminExecuteSequence
AdminUISequence
Advertisement: There is also the advertisement sequence. This sequence uses the: AdvtUISequence
and AdvtExecuteSequence
tables. Advertisement is when you register the MSI package for installation later. Installation can be triggered by the user or via Add / Remove programs or via an application. Install-on-demand. Rarely used these days it seems (the main reason is probably the technical glitches and operational problems people face when trying to use it).
File Extraction: Administrative installation is essentially a glorified file extraction (equivalent to an unzip). It extracts all files, adjusts the media table to use external files and a few other things. It is basically intended to create an installation media to put on a networks share and also to allow the content of the MSI to be inspected. There is also the ability of MSI to "run feature from source" - which I have honestly never seen used successfully.
Note!: Though rather trivial, administrative installations are crucial for corporate packaging and the "transparency" of the MSI installation technology. This transparency is one of the key benefits of the MSI technology (list slightly down the page). Make sure that your MSI works properly during administrative installations. I think there is a bug in some WiX GUI-sets for example. There is a trick to make them work still by suppressing the GUI. Something like this: msiexec.exe /a MySetup.msi TARGETDIR=D:\ExtractHere /qn
What do you need the custom action to do during administrative installation?
Upvotes: 1