Ravi Raj
Ravi Raj

Reputation: 66

Check if application is not running

I am developing a WiX installer (I am very new to this) and want to implement a method (like launch condition) which check if a particular application is running or not. If it's running then a warning message will popup displaying close the application message. I want this check before the welcome screen.

How can I implement this? Some working example will really help me a lot.

Upvotes: 1

Views: 1575

Answers (2)

Christopher Painter
Christopher Painter

Reputation: 55581

Windows Installer already has a FilesInUse and RMFilesInUse (Restart Manager) support. Does this not meet your needs? With these patterns you'll get a dialog telling the user that they need to exit a program or risk needing a reboot.

Upvotes: 3

Cosmin
Cosmin

Reputation: 21416

This can be done only through a custom action. Here is a tutorial for a C++ DLL native custom action: http://www.codeproject.com/Articles/1747/MSI-Custom-Action-DLL

Your custom action can perform the check and then show a message to the user if necessary. It can return 0 to continue the installation or 1602 to stop.

To show the message before Welcome dialog, you can try scheduling your custom action right after CostFinalize action in InstallUISequence.

Upvotes: 2

Related Questions