wixwindows-installermajor-upgradewix3.11restartmanager

wix Restart Manager successfully shuts down application but says it couldn't


In my wix project, I have a file "connect.exe" that will usually be running during uninstall or update. During uninstallation and major update Wix will prompt before closing with the usual "The following applications should be closed before continuing the install."

This dialogue will successfully shut down the program:

Action 17:19:59: ShutdownApplications. Shutting down applications
MSI (s) (5C:44) [17:20:02:880]: RESTART MANAGER: Successfully shut down all applications in the service's session that held files in use.
MSI (c) (A4:08) [17:20:02:880]: RESTART MANAGER: Successfully shut down all applications that held files in use.

But then right after, it'll throw an error saying that it could not shut down the application:

MSI (s) (5C:44) [17:20:33:300]: Note: 1: 1611 
MSI (s) (5C:44) [17:20:33:300]: Note: 1: 2205 2:  3: Error 
MSI (s) (5C:44) [17:20:33:300]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 1611 
The setup was unable to automatically close all requested applications. Please ensure that the applications holding files in use are closed before continuing with the installation.

Even though the application is clearly shut down on the system. Also, it won't restart it when doing a major update after the installer is finished updating.

Everything else seems to work just fine.

Notably, the program connect.exe runs a window that is hidden most of the time. It's mainly used as an on screen display for service.exe which runs via Windows System Service.

How can I fix this to work? Am I not handling something on the connect.exe application end?

connect.exe component entry:

            <Component Id="ConnectExe" Guid="..." DiskId="1">
                <File Id="connect.exe" Name="connect.exe" Source="..\data\connect.exe" KeyPath="yes">
                    <Shortcut Advertise="yes" Description="Connect front end application." Directory="ApplicationProgramsFolder" Icon="connect.exe" Id="ConnectStartMenuShortcut" Name="Connect" IconIndex="0" WorkingDirectory="INSTALLDIR">
                        <Icon Id="connect.exe" SourceFile="..\data\connect.exe" />
                    </Shortcut>
                    <Shortcut Advertise="yes" Description="Connect front end application." Directory="StartupFolder" Icon="connect.exe" IconIndex="0" Id="ConnectStartupShortcut" Name="Connect" WorkingDirectory="INSTALLDIR"></Shortcut>
                </File>
                <RemoveFolder Id="ApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall" />
            </Component>

Solution

  • Improved?: Different ways to create and interpret MSI logs.


    Log File: What does the rest of the log file say? Any mention of other files that are locked? Some logging and log-file interpretation hints can be found here.

    I wouldn't be surprised if you have found a bug in the restart manager. Though a relatively simple concept, it involves some seriously complicated stuff. Hidden windows are exactly a source of such complexity.

    Quick Questions:


    Some Links: