[MSI] Add Close app

If your MSI package installs an Add-on, Plug-in, or may update shared files used by other processes, it would be a great idea to check if these processes are running and, if so, close them. In addition, to ensure clear package removal, the applications from this package must be closed.

Add the ‘Close app’ entry to detect and close the application in a proper manner (send Close and End Session messages) or forcedly terminate it.

Warning

If ALL the listed below conditions are true, the built-in “File in Use” dialog of the Restart Manager will appear before the Close app runs. In this particular case you need to click ‘Ignore’ to continue the package uninstall and proceed to Close app.

Conditions:

  • Restart Manager is enabled on your system;

  • MSI uninstall is run in the UI (non-silent) mode;

  • Running app was installed by this package.

Important

Precondition: Open an MSI package in MSI Editor (see Open MSI/MST).

  1. Go to the Package Designer > Close applications tab.

    msi-editor-closeapps

  2. Click Add in the toolbox.

    msi-editor-closeapps-add

  3. Enter the Executable name and set the required options to close the application in the necessary manner. For information, see the description of close app options below.

    msi-editor-closeapps-edit-dialog


Description of Close app options:

Option

Description

Executable name

Name of the executable to be closed. This should only be the file name.

Sequence

Optionally orders the applications to be closed.

Conditions

Condition that determines if the application should be closed. Must be blank or evaluate to true for the application to be scheduled for closing.

Set MSI property

Property to be set if application is still running. Useful for launch conditions or to conditionalize custom UI to ask user to shut down apps.

Prompt the user with the message

Prompt the user with the message if the application is running. The prompt occurs before executing any of the other options and gives the options to “Abort”, “Retry”, or “Ignore”. Abort will cancel the install. Retry will attempt the check again and if the application is still running, prompt again. “Ignore” will continue and execute other options, selected to close the application.

Send a Close message to app

Sends a close message to the application.

Send an End Session message to app

Sends WM_QUERYENDSESSION then WM_ENDSESSION messages to the application.

Timeout (in seconds)

Time in seconds to wait for the application to exit after the Close and/or End Session messages. If the application is still running after the timeout then the Terminate app with exit code or Prompt for reboot will be executed.

Terminate app with exit code

Attempts to terminate the process and returns the specified exit code if the application is still running.

Prompt for reboot

Prompts for reboot if application is still running.




Note

PACE Suite covers the whole range of application packaging tasks - learn more.

Try PACE Suite for free - 21 days no obligations unlimited trial with all functions unlocked.