How to start the application after the installation wizard (visual studio 2010) completes

I am using visual studio 2010 (C #, .NET 4) to create an installation wizard project. I have to make sure that the application (Windows form application) starts after installing it. For this purpose I have indicated a custom action. in particular, what I'm doing (inside the window form application project) extends the System.Configuration.Install.Installer class; inside this constructor class, I add a new event handler to the Comitted event. the event handler simply calls System.Diagnostics.Process.Start (the string path), where the path is the path to the executable.

now again in the project of the installation wizard, in the section "Custom action" β†’ "Commit", I add the main output from the application of the window form.

it "works" somewhat, but not quite. when I run the installation wizard (when I actually try to install), the wizard progresses almost all the way, starts the window form, but then never exits and, in addition, the progress bar never reaches 100%. if I do not exit the window form application, then the installer will freeze in this state.

I did quite a lot of searches on the Internet and tried different combinations (for example, I put the code in Process.Start in different events with the placement of the user action in Install vs Commit), but some of them fail. I can provide links if necessary.

Does anyone have pointers on how to use the Visual Studio 2010 installation wizard to successfully launch a Windows form application (and exit)?

+4
source share
1 answer

Perhaps this will help: Run exe after installing msi?

+5
source

Source: https://habr.com/ru/post/1345983/


All Articles