1

So this installer works fine until I add the following, strange part is after it rolls back the install due to the error the features I am adding via dism.exe are actually turned on like I want. Tempted to just add something to ignore the error but I would rather not have to hack that into it.

Relevant 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.
Paul Swetz
  • 2,175
  • 1
  • 9
  • 26

1 Answers1

1

Summary: Looks like you need a reboot after Dism.exe has run (0x80070bc2 : ERROR_SUCCESS_REBOOT_REQUIRED). But there is more...


Error Reboot Required: The error 0x80070bc2 means ERROR_SUCCESS_REBOOT_REQUIRED (link to Magic Number database - some details on error lookup, what tools to use). In other words it looks like the installation was fine, but the custom action return code indicates a required reboot and you have set the custom action to check exit code. Can you just flush the error? You can. I wouldn't. What else is there? I suppose you could flush the error and inspect what features are installed afterwards? Not that nice either.

DISM API: You can access DISM via C++ APIs (Win32). I would honestly try that rather than command line tools due to the enhanced control of return values, error codes and the overall code flow. Once running C++ code is nice to debug as well (just attach debugger):

C#: It seems someone has created a C# wrapper for dism.exe pushing command lines (not tested).

Security and Windows Updates: Controlling Windows Features that are installed is not necessarily a good thing to do in a package. For one thing I would run a Windows Update right afterwards to check for any new security holes that may have opened.

Active Directory?: I would think this Windows Feature installation is better controlled from Active Directory (centralized control for all workstations), but I am not too familiar with that process either. Just wanted to mention it. By the looks of it this might be a corporate package for an SOE environment? If so I would have a chat with the senior system administrator guys? Also the security guys if there is a department for that? (audit). Sometimes they ask for such packages themselves...


Links:

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
  • So this was great information. Hate to say it but we took the cheap way out and just made the CAQuiteExec actions Return="ignore". AD was not an option as this is part of a product installed only client systems via a cloud deployment system where the systems are neither controlled by us or attached to our AD in any way. For reference this is the first step in setting the installation to run in single-user kiosk mode utilizing shell launcher. – Paul Swetz Nov 12 '19 at 19:07
  • Doesn't look like there is anything but the executable and the Win32 / C++ API, and the latter is quite involved, so I guess that is fine. I guess you can query the system after install to see if all features are there using simple C++. – Stein Åsmul Nov 13 '19 at 01:27
  • I got some C++ code working to test Windows feature states, I can check into [github.com](https://www.github.com) tomorrow if you want it. That way you can check if the feature made it - or discover new problems as one tends to :-). Or you can test with `dism.exe` I guess (less control). – Stein Åsmul Nov 13 '19 at 02:49
  • [DismBasicFeatureCheck](https://github.com/glytzhkof/DismBasicFeatureCheck) (run as admin). – Stein Åsmul Nov 13 '19 at 13:24
  • I actually found a c# version of what appears to be basically this (hidden in an online powershell script of all places) which would fit our support profile a little bit better but appreciate the effort/assist. Throwing it on the backlog for now. – Paul Swetz Nov 13 '19 at 14:28
  • Yeah, I like native code in custom actions that don't depend on the .NET framework, that is why I use C++ if I can. – Stein Åsmul Nov 13 '19 at 15:44