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 ins开发者_JS百科tall (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.
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.
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]
}
精彩评论