Run second instance of WPF application from first

If our stand-alone application was only a downloaded .exe file (i.e. deployed using the Windows installer), it would be quite simple to start launching an instance of the second instance using System.Diagnostics.Process.Start . Unfortunately, our WPF application is deployed by VIA ClickOnce , so there is no way to the local file system as far as I know.

How to start a second instance of a running ClickOnce application? (And, if possible, pass command line options.)

+4
source share
3 answers

Well, there is a local file system path when you deploy it using clickonce. Try

 yourWindow.GetType().Assembly.Location 

-> this will give you the full path to your build.

+3
source

You are mistaken: there is a local path in the local Application Data folder. Alternatively, you can restart the application using Uri. In short, you should be able to develop a launch path for your application (perhaps using Environment.CommandLine or System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName ), as well as for a regular application, and use it.

+5
source

If you know the application deployment URL, you can simply run Process.Start and it will install or run it.

0
source

All Articles