简体   繁体   English

在Wix中创建自定义操作以用于静默安装

[英]Creating a custom action in Wix for use in silent installation

We use Wix to create our MSI installer. 我们使用Wix创建我们的MSI安装程序。 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. 当正常将安装程序与GUI一起使用时,我们有一些自定义操作效果很好,但是当使用静默安装(通过“ msiexec / qb / i”)时,自定义操作将无法运行。

What can I do to make them work through Wix? 如何使它们通过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 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. 基本上,听起来您只将自定义操作放到了UI序列中,而不是在“执行序列”中,但是还有其他事情需要确保操作正确。

You can set "[UILevel]" in ExeCommand and access it trough arguments. 您可以在ExeCommand中设置“ [UILevel]”并通过参数访问它。

 <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). 可能是因为它们被限制不在安静模式下运行(请参阅UILevel属性)。 If they fail, they might lack some input information (properties) which comes from user in full UI mode. 如果失败,则它们可能会缺少一些来自完全UI模式下来自用户的输入信息(属性)。

Anyway, the verbose log should give you more information. 无论如何,详细的日志应该为您提供更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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