I'm developing a VSTO add-in for Microsoft Word and packaging it using a .msi installer (Visual Studio Installer Project). Before proceeding with the installation, I want to ensure that Word (winword.exe) is not running. If it is, I’d like to block the installation with a user-friendly message like:
"Please close Microsoft Word before installing StyleGuard Pro."
What I've tried:
✅ Custom Action DLL: Tried adding a custom action in the Installer project to check for running processes using Process.GetProcessesByName("WINWORD"), but that results in Error 1001 or similar issues during installation.
throw new InstallException("Microsoft Word is currently running.\n\nPlease close Word and run the installer again.");
✅ Tried running the check in Install, Commit, and InstallUI phases — but still unreliable or unstable, especially in silent installations or under limited permissions.
❌ Launch Conditions don’t support checking running processes — only registry, file system, or Windows Installer properties.
❌ MSI dialogs like MsiRMFilesInUse can list Word as in-use, but don’t give me control to block the install programmatically.
My current workaround:
I created a WPF-based bootstrapper .exe that:
- Checks for running winword.exe
- If running, shows a MessageBox to prompt the user to close it
- Only then extracts and runs the embedded .msi using msiexec
This works fine — but it adds complexity, an extra build step, and now I’m shipping two files (exe + msi).
My Question: 👉 Is it possible to check if Word is running directly inside a .msi installation without causing Error 1001 or installer failure?
- Can I detect winword.exe cleanly within a pure .msi (no bootstrapper)?
- Can this be done reliably using any deferred, immediate, or UI custom actions?
- Are there better patterns or supported ways of handling this in Visual Studio Installer Projects or WiX?
- Or is a bootstrapper .exe the only safe and reliable way to block installation if Word is open?
Any suggestions, best practices, or real-world guidance would be appreciated.