[英]Executing dism batch command from WIX installer
I have created a WIX msi installer which executes a batch command using dism.exe to enable IIS windows features. 我创建了WIX msi安装程序,该安装程序使用dism.exe执行批处理命令以启用IIS Windows功能。 When I execute the msi installer the executed command doesn't take effect and the desired windows features are not enabled also the control panel doesn't show that a new application is installed, but when I run the same msi installer using command line arguments:
当我执行msi安装程序时,执行的命令不会生效,并且所需的Windows功能也未启用,控制面板也不会显示已安装新的应用程序,但是当我使用命令行参数运行相同的msi安装程序时:
msiexec /i BatchFileExecutor.msi /Lime logfile.txt
the desired windows features get enabled and the control panel shows that the application is installed. 将启用所需的Windows功能,并且控制面板显示已安装该应用程序。
Below is the WIX code that I am using: 以下是我正在使用的WIX代码:
<CustomAction Id="BatchCmd"
Property="BatchRun"
Value='"[WindowsFolder]Sysnative\dism.exe" /Online /Enable-Feature /FeatureName:IIS-WebServerRole"'
Execute='immediate'
Return='check'>
</CustomAction>
<CustomAction Id="BatchRun" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="yes">
</CustomAction>
<InstallExecuteSequence>
<Custom Action="BatchCmd" Before="BatchRun">NOT Installed</Custom>
<Custom Action="BatchRun" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
Is there some code fragment out of place or have I wrongly set some property? 是否有一些代码片段不合适或我错误地设置了某些属性?
The customaction value attribute doesn't seem to have the right number of "'s to me. Note that QuietExecCA requires a full path wrapped in quotes for the EXE but I don't think there's any need for a " after the feature name. 对我来说,customaction值属性似乎没有正确的“。”。请注意,QuietExecCA要求用完整的路径将EXE引号引起来,但我认为功能名称后不需要“”。
Also you don't want impersonation for your deferred CA. 另外,您也不想假冒您的延迟CA。 You want no impersonation so it runs elevated in the system context.
您不需要模拟,因此它可以在系统上下文中提升运行。
Finally I'd be sure to include switches that prevent DISM from forcing a reboot during the middle of your installation. 最后,我将确保包括一些开关,这些开关可以防止DISM在安装过程中强制重新启动。 Some windows features take a reboot to become effective.
某些Windows功能需要重新启动才能生效。 For this reason I put DISM commands as their own package inside of a bootstrapper bundle / chain outside of my MSI.
因此,我将DISM命令作为它们自己的包放在MSI外部的引导程序包/链中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.