启动条件是否以静默模式显示?

Is launch Condition shown in silent mode?

使用 WixSharp 构建安装程序,

当 运行 处于静音模式时是否显示 LaunchCondition? (例如“msiexec /i /qn /quiet”)

MSI GUI: MSI has many UILevels - degrees of visible GUI (). When a setup is run in silent mode, any errors from Launch Conditions will show up in the MSI log instead of a dialog.

This makes sense since you must avoid dialogs showing up when there might be nobody to dismiss them (for example in automatic package deployment systems).

Essentially you can run with basic GUI /qb or reduced GUI /qr or completely silently /qn. When you run silently no dialogs should be shown, and you should consult the log file for results:

静默 MSI 安装:

msiexec /i MySetup.msi /qn /L test.log

测试项目https://github.com/glytzhkof/WiXLaunchConditionTestMYVALUE是在 属性 table 中定义 - 将其更改为 0 或 1)。

这是一个示例日志输出:

=== Logging started: 28.10.2021  13:07:12 ===
Action start 13:07:12: INSTALL.
Action start 13:07:12: FindRelatedProducts.
Action ended 13:07:12: FindRelatedProducts. Return value 1.
Action start 13:07:12: LaunchConditions.
MSI (s) (F4:DC) [13:07:12:491]: Product: WiXLaunchConditionTest -- Value for MYFLAG must be 1 (true) or 0 (false)

Value for MYFLAG must be 1 (true) or 0 (false)
Action ended 13:07:12: LaunchConditions. Return value 3.
Action ended 13:07:12: INSTALL. Return value 3.
MSI (s) (F4:DC) [13:07:12:493]: Product: WiXLaunchConditionTest -- Installation failed.

MSI (s) (F4:DC) [13:07:12:493]: Windows Installer installerte produktet. Produktnavn: WiXLaunchConditionTest. Produktversjon: 1.0.0.0. Produktspråk: 1033. Produsent: -. Installasjonens resultatstatus: 1603.

=== Logging stopped: 28.10.2021  13:07:12 ===

管理员权限:需要注意的是,MSI 应该是 运行 来自 cmd.exe 具有管理员权限 - 或者您没有从静默安装程序中收到安装失败的消息,因为缺少管理员权限(失败是由于缺少管理员权限,而不是因为启动条件)。

此注册表脚本在 Windows 资源管理器中添加了上下文菜单,它可以在具有或不具有管理员权限的任何文件夹中打开 cmd.exehttps://github.com/glytzhkof/all/blob/master/HKCU_Run-CMD-Shell-Extension.reg.只需合并注册表文件,然后在任何文件夹的 Windows Explorer 中右键单击空的 space。查看对话框底部的命令: