Search code examples
c#windows-installervsinstaller

Installer does not exit once new version is installed and loaded


I have a Visual Studio Installer project for my C# application. It's been set up to uninstall any previous versions of my app, install the new version and then run the app once it's been installed. It works as expected up to the very end where it sits on the final 'Please Wait' stage:

Example

At this point, the new version of my app has has been installed and it is running quite happily, however the above screenshot just sits there (fully responsive) and it will only move onto the "Installation Complete" window once I've manually closed down the newly installed version of my application.

enter image description here

Have I done something wrong with the config of my Installer project? I don't want people to have to close the app down just to complete the install process, only to then have to manually run the app again! That's why I set up the installer to auto run the new version once it's been installed!


Solution

  • That seems to be a common problem when using a Visual Studio Installer project. The following question identifies a similar issue:

    Visual Studio Installer > How To Launch App at End of Installer

    The question following shows a solution, however with disagreement on how advisable it is:

    Run exe after msi installation?

    The solution I would recommend though would be, if possible, attempt to use WiX (http://wixtoolset.org/) to author your Windows Installer. The learning curve may be a little steeper than compared to Visual Studio Installer projects, but once you're comfortable with it you'll find you're exposed to a lot more of the capabilities of Windows Installer along with having a series of additional features provided by the Wix Toolset. The documentation for WiX gives an example of how to achieve what you're trying to do:

    http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/run_program_after_install.html