I'm using Microsoft Visual Studio Installer Projects for my Hybrid Widndows Forms/WPF project. I need to make sure the user has closed the Application (an older version), if active, before the installer can proceed, can this be possible with a Visual Studio Installer Project?
All I've seen so far is that the installer adds by default a dependency to .NET Framework and it won't run unless the dependency is installed first.
RestartManager: The RestartManager feature of MSI is designed to allow your application to gracefully shut down and restart itself during an installation process: How do I add support for Windows Restart Manager to my application? (Advanced Installer)
In essence: The whole idea is basically to prefer restarting applications rather than restarting the OS. To that end:
RegisterApplicationRestart()
with a command line specified for its eventual restart - it "signs up" for restart management.WM_QUERYENDSESSION
messages and shuts down gracefully saving data in an appropriate way when told to do so.Importance: Just to state the obvious: rebooting a knowledge workers PC is a big deal (ethics of rebooting - no less - read towards bottom). This is why you should avoid reboots whenever possible. RestartManager support for your application can help (restart application rather than rebooting OS). This feature helps enormously for large scale deployment where you might target thousands of PCs. And please make sure your QA guys understand and know how to test the functionality / scenario relating to RestartManager.
Also avoid setting REINSTALLMODE to amus (force overwrite) - which can trigger unnecessary reboot prompts.
Links: