因此,在我添加以下内容之前,该安装程序可以正常工作,奇怪的部分是由于错误,我通过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.