I am a beginner in case of packaging of software. I am using cpack + Wix. I tried to find helpful information or a good documentation about util:RestartResource, but could not find any awnser to my question.
Issue: I have to install a ShellExtension which needs a restart of explorer.exe after setting some registry values. Because of that i use the command (https://wixtoolset.org/documentation/manual/v3/xsd/util/restartresource.html):
<util:RestartResource ProcessName="explorer.exe"/>
Everything nearly works like expected. Explorer.exe will be killed as expected but the restart of the explorer.exe will be triggered after the user is finishing the installation. That is to unpleasant, because explorer.exe disappears till the user clicks the finalize button of the installation. I would like a direct restart of the explorer after the registry values was set. I know this should be possible, because if WiX is triggering a restart of the explorer.exe by himself, it will be executed immediately and does not wait till the installation was finished. What is the trick? I tried already CustomActions and placing util:RestartResource at different position of the WiX-Code (I am desperate.).
[EDIT] I am analyzing the logs of the installation. And i realized that by default a Restart Manager is called at the beginning of progress and closed himself before the final Dialog. If i add a ProcessName to RestartResource it opens another Restart Manager which closed himself after the final dialog. Need to find out how to call RestartResource like the default RestartResource.
[EDIT2] I guess util:RestartResource is buggy. At the moment i crawl throw the WiX implementation code and MSI documentation and normally you should register all RestartResources before the state "InstallValidate". And that is exactly what WiX is trying to do in UtilExtension_Platform.wxi:
<Fragment>
<CustomAction Id="WixRegisterRestartResources$(var.Suffix)" BinaryKey="WixCA" DllEntry="WixRegisterRestartResources$(var.Suffix)" Execute="immediate" Return="check" SuppressModularization="yes" />
<InstallExecuteSequence>
<Custom Action="WixRegisterRestartResources$(var.Suffix)" Before="InstallValidate" Overridable="yes" />
</InstallExecuteSequence>
</Fragment>
Because after this state MsiRestartManagerSessionKey will be terminated. And WiX tries to use this key in case of the registration of a RestartResource. But what i see inside of the logs is, that my util:RestartResource call will always executed after the "InstallValidate" state. And the log already says at this point, that the MsiRestartManagerSessionKey was terminated earlier (after "InstallValidate" state). That is from my point of view against the MSI policy.
[EDIT3] It is not buggy. I will post an awnser.