用于运行Dism的Wix安装程序自定义操作失败

因此,在我添加以下内容之前,该安装程序可以正常工作,奇怪的部分是由于错误,我通过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.
youaremyjay 回答:用于运行Dism的Wix安装程序自定义操作失败

  

摘要 :运行 Dism.exe 后,您似乎需要重新启动(0x80070bc2:{{1 }})。但是还有更多...


需要重新启动错误 The error 0x80070bc2 means ERROR_SUCCESS_REBOOT_REQUIRED(链接至幻数数据库-some details on error lookup,使用哪些工具)。换句话说,安装看起来不错,但是自定义操作返回代码指示需要重新启动,并且您已将自定义操作设置为检查退出代码。 ERROR_SUCCESS_REBOOT_REQUIRED 我想您可以清除错误并检查之后安装了哪些功能?也不是很好。

DISM API :您可以通过C ++ API(Win32)访问DISM。老实说,由于增强了对返回值,错误代码和整体代码流的控制,因此我会尝试使用命令行工具而不是命令行工具。运行C ++代码后,也很容易调试(just attach debugger):

  
      
  • Basic DISM API Sample(Microsoft)
  •   
  • 通过github.com搜索得出:Dism.cpp(看起来像高质量,请检查。我尚未对其进行测试)
  •   

C# :似乎有人创建了C# wrapper for dism.exe pushing command lines(未经测试)。

安全性和Windows更新 :控制已安装的Windows功能不一定是软件包中的一件好事。一方面,我将随后立即运行 Windows Update ,以检查是否可能存在任何新的安全漏洞。

Active Directory? :我认为可以通过 Active Directory (对所有工作站的集中控制)更好地控制此Windows功能安装,但是我对这个过程也不是很熟悉。只是想提一下。从外观上看,这可能是针对SOE环境的企业软件包?如果是这样,我会和高级系统管理员聊天吗?还有安全人员,如果有部门的话? (审计)。有时他们自己要这样的包裹...


链接

本文链接:https://www.f2er.com/3135993.html

大家都在问