[wix-users] FW: Restart manager always schedules restart when IIS has files in use

pdebruine at outlook.com pdebruine at outlook.com
Thu Aug 18 01:28:57 PDT 2022


Hi all,

We have a msi setup built with WiX which installs the files for our application. Among these files is a website built with ASP.Net Core. We don't do any IIS configuration in the msi. Recently I found that when a website is manually created in IIS which uses the website files and the website is active when an upgrade is executed then the restart manager will try to restart/shutdown IIS but it fails with this error message:

Application 'C:\Windows\System32\inetsrv\w3wp.exe' (pid 45896) cannot be restarted - Application SID does not match Conductor SID..

This error message is somewhat confusing as we are running the msi as Administrator so we should have enough permissions to restart the application?

 We want to prevent the need to reboot, so I'm trying to add a custom action to stop the website before the restart manager determines if the reboot is needed. I did some searching and found that the custom action should be scheduled before InstallValidate (found here: https://stackoverflow.com/a/3221478). But even if I scheduled the custom action before InstallValidate I still get the popup that a reboot is required. Scheduling the custom action even earlier (tried to do it before CostInitialize even) makes no difference. From the logs I've taken it seems that the restart manager runs before any custom actions are executed.

So in my logs I find these log messages pretty early on:

        Line  111: MSI (c) (78:DC) [10:06:29:463]: PROPERTY CHANGE: Adding MsiSystemRebootPending property. Its value is '1'.
        Line  939: MSI (s) (28:5C) [10:06:45:645]: PROPERTY CHANGE: Adding MsiSystemRebootPending property. Its value is '1'.

and a bit later my custom action is executed:

        Line 1453: MSI (s) (28:5C) [10:06:50:977]: Doing action: StopInstallationFolderSites

In the log I see the website holding the files in use is shutdown correctly, but still further in the log I see this:
        Line 2800: MSI (c) (78:94) [10:06:54:178]: RESTART MANAGER: Session opened.
        Line 2801: MSI (s) (28:5C) [10:06:54:257]: Note: 1: 1610
        Line 2802: MSI (s) (28:5C) [10:06:54:257]: Transforming table Error.

        Line 2804: Tijdens de installatie moeten bestanden of services worden bijgewerkt die niet kunnen worden bijgewerkt als het systeem actief is. Als u wilt doorgaan, dient u de computer opnieuw op te starten om de installatie te voltooien.

Last line is the localized error message which is shown in the installer UI.

Is there a way I can shutdown the website to release the files before the restart manager determines if a restart is needed?

Regards
Peter de Bruine


More information about the wix-users mailing list