因此,此安装程序可以正常工作,直到我添加以下内容,奇怪的部分是由于错误,我通过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.
Summary:运行
Dism.exe
后,您似乎需要重新启动(0x80070bc2
:ERROR_SUCCESS_REBOOT_REQUIRED
)。但是还有更多...
需要重新启动错误:The error 0x80070bc2 means ERROR_SUCCESS_REBOOT_REQUIRED
(链接至幻数数据库-The error 0x80070bc2 means ERROR_SUCCESS_REBOOT_REQUIRED
,使用哪些工具)。换句话说,安装看起来不错,但是自定义操作返回代码指示需要重新启动,并且您已将自定义操作设置为检查退出代码。 some details on error lookup我想您可以清除错误并检查之后安装了哪些功能?也不太好。
DISM API:您可以通过C ++ API(Win32)访问DISM。老实说,由于增强了对返回值,错误代码和整体代码流的控制,因此我会尝试使用命令行工具而不是命令行工具。一旦运行C ++代码,调试也很好(Can you just flush the error? You can. I wouldn't. What else is there?
):
- just attach debugger(Microsoft)
- 一个github.com搜索产生了这个:Basic DISM API Sample(看起来像高质量,请检查。我还没有测试)
[C#:似乎有人创建了Dism.cpp(未经测试)。
[安全性和Windows更新:控制已安装的Windows功能不一定是软件包中的好事。一方面,我会在之后立即运行Windows Update,以检查是否可能存在任何新的安全漏洞。
[Active Directory?:我认为可以通过Active Directory(对所有工作站的集中控制)更好地控制Windows Feature安装,但是我对这个过程也不太熟悉。只是想提一下。从外观上看,这可能是针对SOE环境的企业软件包?如果是这样,我会和高级系统管理员聊天吗?还有安全人员,如果有部门的话? (审核)
链接: