Search code examples
c#processclickoncewaitforexit

C# Process.Start - how to enforce WaitForExit


I have a console app that calls other console apps.

I am using the following link for howto: https://robindotnet.wordpress.com/2010/03/21/how-to-pass-arguments-to-an-offline-clickonce-application/

I cannot instantiate Process and use that as I get the error message "The specified executable is not a valid application for this OS platform."

I can call the apps using static version of Process e.g.

Process.Start(shortcutPath, arguments);

or

Process.Start(shortcutPath, arguments).WaitForExit();

However, I cannot get the Process to WaitForExit - one app is called and after a while, before the first app completes, the second one is called - which is a problem as it depends on the first app to complete.

Any suggestions on how to get Static version of Process to wait for exit (alt. how to instantiate Process and be able to call clickonce deployed apps?)


Solution

  • Ok, after bashing my head against a wall for the best part of a day, I found this... Start an offline ClickOnce Application and wait for Exit

    Used the mutex option. Fek me Microsoft, you've take something that used to be really simple and made a real horse's ass out of it.

    I was just about to scrap my called exe's and create one monster - was feeling ill at the thought.