简体   繁体   中英

Creating a custom action in Wix for use in silent installation

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?

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.

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]
    }

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM