Windows Wix安装程序运行dism的自定义操作失败
因此,这个安装程序工作正常,直到我添加以下内容,奇怪的是,由于错误,它回滚了安装。我通过dism.exe添加的功能实际上已按我所希望的那样打开。我只是想添加一些东西来忽略错误,但我宁愿不必将其破解 相关xmlWindows Wix安装程序运行dism的自定义操作失败,windows,wix,wix3,dism,Windows,Wix,Wix3,Dism,因此,这个安装程序工作正常,直到我添加以下内容,奇怪的是,由于错误,它回滚了安装。我通过dism.exe添加的功能实际上已按我所希望的那样打开。我只是想添加一些东西来忽略错误,但我宁愿不必将其破解 相关xml <CustomAction Id="SetEnableWindowsFeatures" Property="BatchFeatures" Value=""[System64Folder]Dism.exe" /norestart /quiet /on
<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.
未安装
未安装
产生的错误
正在执行op:ActionStart(Name=BatchFeatures,,)
动作11:16:48:批处理功能。
MSI(24:2C)[11:16:48:829]:执行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(24:2C)[11:16:48:831]:为线程24108创建790536类型的MSI句柄(131)
MSI(24:A4)[11:16:48:832]:调用远程自定义操作。DLL:C:\WINDOWS\Installer\MSIC518.tmp,入口点:CAQuietExec
MSI(24!D0)[11:16:50:676]:为线程29392创建790531类型的MSI句柄(132)
CAQuietExec:错误0x80070bc2:命令行返回错误。
MSI(24!D0)[11:16:50:676]:关闭螺纹29392的790531型MSI手柄(132)
MSI(24!D0)[11:16:50:676]:为线程29392创建790531类型的MSI句柄(133)
CAQuietExec:错误0x80070bc2:QuietExec失败
MSI(24!D0)[11:16:50:676]:关闭螺纹29392的790531型MSI手柄(133)
MSI(24!D0)[11:16:50:676]:为线程29392创建790531类型的MSI句柄(134)
CAQuietExec:错误0x80070bc2:在ExecCommon方法中失败
MSI(24!D0)[11:16:50:677]:关闭螺纹29392的790531型MSI手柄(134)
CustomAction BatchFeatures返回了实际错误代码1603(注意,如果转换发生在沙箱中,则可能不是100%准确)
MSI(24:A4)[11:16:50:678]:闭合24108螺纹790536型MSI手柄(131)
行动于11:16:50结束:InstallFinalize。返回值3。
摘要:运行Dism.exe
后,您似乎需要重新启动(0x80070bc2
:错误\u成功\u需要重新启动
)。但还有更多
需要重新启动时出错:(链接到Magic Number数据库-,使用什么工具)。换句话说,安装看起来很好,但自定义操作返回代码表示需要重新启动,并且您已将自定义操作设置为检查退出代码<代码>您可以清除错误吗?你可以。我不会的。还有什么?我想您可以清除错误,然后检查安装了哪些功能?也没那么好
<强> DISM API :可以通过C++ API(Win32)访问DISM。由于对返回值、错误代码和整个代码流的控制得到了增强,因此我会诚实地尝试这一点,而不是使用命令行工具。一旦运行C++代码,调试也很好():
- (微软)
- 一个github.com搜索结果如下:(看起来质量很高,请检查一下。我还没有测试它)
链接:
- (要传递给dism.exe的XML文件)
- (推荐)
dism.exe
进行测试,我猜(控制较少)。(以管理员身份运行)。事实上,我发现了一个c#版本的基本版本(隐藏在所有地方的在线powershell脚本中),它更适合我们的支持配置文件,但感谢您的努力/帮助。现在就把它放在待办事项上。