0

所以这个安装程序工作正常,直到我添加以下,奇怪的部分是在它回滚安装后由于错误我通过 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.
4

1 回答 1

1

摘要:看起来您在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 功能在包中不一定是一件好事。一方面,我会在之后立即运行Windows 更新以检查是否存在任何新的安全漏洞。

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


链接

于 2019-11-08T22:18:41.967 回答