因此,这个安装程序可以正常工作,直到我添加以下内容,奇怪的部分是在它回滚安装后,由于错误,我通过dism.exe添加的特性实际上是按我的要求打开的。只想添加一些东西来忽略错误,但我不想将它黑客化。
相关xml
<CustomAction Id="SetEnableWindowsFeatures" Property="BatchFeatures" Value=""[System64Folder]Dism.exe" /norestart /quiet /online /enable-feature /featureName:Client-DeviceLockdown /featurename:Client-EmbeddedShellLauncher /featurename:Client-KeyboardFilter" />
<CustomAction Id="BatchFeatures" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action="SetEnableWindowsFeatures" Before="BatchFeatures">NOT Installed</Custom>
<Custom Action="BatchFeatures" After="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
Error generated
Executing op: ActionStart(Name=BatchFeatures,,)
Action 11:16:48: BatchFeatures.
MSI (s) (24:2C) [11:16:48:829]: Executing op: CustomActionSchedule(Action=BatchFeatures,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="C:\WINDOWS\system32\Dism.exe" /norestart /quiet /online /enable-feature /featureName:Client-DeviceLockdown /featurename:Client-EmbeddedShellLauncher /featurename:Client-KeyboardFilter)
MSI (s) (24:2C) [11:16:48:831]: Creating MSIHANDLE (131) of type 790536 for thread 24108
MSI (s) (24:A4) [11:16:48:832]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSIC518.tmp, Entrypoint: CAQuietExec
MSI (s) (24!D0) [11:16:50:676]: Creating MSIHANDLE (132) of type 790531 for thread 29392
CAQuietExec: Error 0x80070bc2: Command line returned an error.
MSI (s) (24!D0) [11:16:50:676]: Closing MSIHANDLE (132) of type 790531 for thread 29392
MSI (s) (24!D0) [11:16:50:676]: Creating MSIHANDLE (133) of type 790531 for thread 29392
CAQuietExec: Error 0x80070bc2: QuietExec Failed
MSI (s) (24!D0) [11:16:50:676]: Closing MSIHANDLE (133) of type 790531 for thread 29392
MSI (s) (24!D0) [11:16:50:676]: Creating MSIHANDLE (134) of type 790531 for thread 29392
CAQuietExec: Error 0x80070bc2: Failed in ExecCommon method
MSI (s) (24!D0) [11:16:50:677]: Closing MSIHANDLE (134) of type 790531 for thread 29392
CustomAction BatchFeatures returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (24:A4) [11:16:50:678]: Closing MSIHANDLE (131) of type 790536 for thread 24108
Action ended 11:16:50: InstallFinalize. Return value 3.发布于 2019-11-08 22:18:41
Dism.exe摘要:看起来您需要在运行之后重新启动(0x80070bc2:ERROR_SUCCESS_REBOOT_REQUIRED)。但还有更多..。
错误重新引导需要:错误0x80070bc2表示ERROR_SUCCESS_REBOOT_REQUIRED。 (链接到魔术数字数据库- 关于错误查找的一些细节,使用什么工具)。换句话说,安装看起来很好,但是自定义操作返回代码表示需要重新启动,并且您已经将自定义操作设置为检查退出代码。Can you just flush the error? You can. I wouldn't. What else is there?,我想您可以刷新错误,然后检查安装了哪些特性?也没那么好。
DISM :您可以通过C++ API (Win32)访问DISM。我会诚实地尝试,而不是命令行工具,因为它增强了对返回值、错误代码和整个代码流的控制。一旦运行C++代码,也可以进行调试(只需附加调试器):
C#:似乎有人已经创建了一个用于C#推送命令行的dism.exe包装器 (未经测试)。
Windows和更新:在包中控制已安装的功能不一定是件好事。首先,我会在之后运行Windows ,以检查可能已经打开的任何新的安全漏洞。
Active Directory?:我认为从Active Directory (所有工作站的集中控制)控制更好,但我也不太熟悉这个过程。只是想提一下。从表面上看,这可能是一个针对国有企业环境的企业包?如果是这样的话,我会和高级系统管理员们聊天吗?还有保安如果有部门的话?(审计)。有时他们自己要求这样的包裹..。
链接
https://stackoverflow.com/questions/58771561
复制相似问题