Creating a custom action in Wix for use in silent installation

4.7k views Asked by At

We use Wix to create our MSI installer. We have a few custom actions that work great when using the installer normally with a GUI, but when using silent install (with "msiexec /qb /i" ), the custom actions won't run.

What can I do to make them work through Wix?

3

There are 3 answers

0
Christopher Painter On

I suggest you read (several times if needed... it took me awhile at first):

Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer

There are a great many things to consider when authoring questions and the details are in that well written article. Basically it sounds like you only put the custom action in the UI sequence and not the Execute Sequence but there are other things beyond that you should make sure you are doing correctly.

2
Yan Sklyarenko On

Do they simply not run or fail? It might be the case they are conditioned not to run in quiet mode (see UILevel property). If they fail, they might lack some input information (properties) which comes from user in full UI mode.

Anyway, the verbose log should give you more information.

0
DaNeSh On

You can set "[UILevel]" in ExeCommand and access it trough arguments.

 <CustomAction Id="customActionId" BinaryKey="InstallerProgram" ExeCommand="[UILevel]" Execute="deferred" Return="check" />


    static void Main(string[] args)
    {
     var uiLevel = args[0]; //==> [Here is the UILevel][1]
    }