1. Quiet Execution Custom Act
例1,安静模式下执行CMD操作
<Property Id="QtExecCmdLine" Value="command line to run"/>
<CustomAction Id="QtExecExample" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
<InstallExecuteSequence>
<Custom Act
</InstallExecuteSequence>
采用安静模式执行CMD操作,但是不出现CMD命令窗口。注意Value中的命令以及应用程序必须加引号,即使没有空格也要加上。
例2,安静模式下执行其他应用程序操作
<CustomAction Id="QtExecDeferredExampleWithProperty_Cmd" Property="QtExecDeferredExampleWithProperty"
Value=""[#MyExecutable.exe]"" Execute="immediate"/>
<CustomAction Id="QtExecDeferredExampleWithProperty" BinaryKey="WixCA" DllEntry="CAQuietExec"
Execute="deferred" Return="check" Impersonate="no"/>
<InstallExecuteSequence>
<Custom Act
<Custom Act
</InstallExecuteSequence>
2.ShellExecute CustomAction 执行打开文档或URL等操作。典型应用为安装完成后打开帮助文件或则运行安装程序。
例:
<Property Id="WixShellExecTarget" Value="myapplication.exe" />
<CustomAction Id="LaunchApplication"
BinaryKey="WixCA"
DllEntry="WixShellExec"
Impersonate="yes" />
</Product>
安装卸载时进行日志记录
Wix制作的Installer的调试很麻烦,没有直接的Bug工具,可以通过记录安装日志的方式进行间接调试。命令为
msiexec /i package.msi /l log.txt