繁体   English   中英

Wix 安装程序自定义操作运行 dism 失败

[英]Wix installer custom action for running dism failing

所以这个安装程序工作正常,直到我添加以下,奇怪的部分是在它回滚安装后由于错误我通过 dism.exe 添加的功能实际上像我想要的那样打开。 很想添加一些东西来忽略错误,但我宁愿不必将其破解。

相关 xml

<CustomAction Id="SetEnableWindowsFeatures" Property="BatchFeatures" Value="&quot;[System64Folder]Dism.exe&quot; /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.

摘要:看起来您需要在Dism.exe运行后重新启动( 0x80070bc2 : ERROR_SUCCESS_REBOOT_REQUIRED )。 但还有更多...


需要重新启动错误The error 0x80070bc2 means ERROR_SUCCESS_REBOOT_REQUIRED (链接到幻数数据库 - 有关错误查找的一些详细信息,使用什么工具)。 换句话说,安装看起来不错,但自定义操作返回代码指示需要重新启动,并且您已设置自定义操作以检查退出代码。 Can you just flush the error? You can. I wouldn't. What else is there? 我想您可以刷新错误并检查之后安装了哪些功能? 也不是很好。

DISM API :您可以通过 C++ API (Win32) 访问 DISM。 由于对返回值、错误代码和整体代码流的增强控制,我会诚实地尝试而不是命令行工具。 一旦运行 C++ 代码也很好调试( 只需附加调试器):

C# :似乎有人为 dism.exe 推送命令行创建了 C# 包装器(未测试)。

安全性和 Windows 更新:控制 Windows 在 package 中安装的功能不一定是好事。 一方面,我会在之后立即运行Windows 更新,以检查可能已经打开的任何新安全漏洞。

活动目录? :我认为这个 Windows 功能安装最好从Active Directory控制(所有工作站的集中控制),但我对这个过程也不太熟悉。 只是想提一下。 从外观上看,这可能是用于 SOE 环境的企业 package? 如果是这样,我会与高级系统管理员聊天吗? 如果有部门的话,还有保安人员吗? (审计)。 有时他们自己要求这样的包裹......


链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM