0

I stumbled upon a problem with which I need some help!

When a process is executed from within a Windows application that runs directly, the call to Process.Start opens up the webpage to the default browser.

But when the same Windows application is run through a Setup Project, Process.Start does not open the URL.

You can download the VS solution from here: https://pxstorage.blob.core.windows.net/pub/TestSetup.zip

Unfortunately, due to the nature of the problem, it was meaningless to append code snippets.

To replicate the issue:

  1. Build the solution
  2. Expected behavior: Run the SetupHelper project and click the Button, and you should see your default browser opening the URL.
  3. Unexpected behavior: Right-click the TestSetup project, click Install and follow the steps. After a popup message, the SetupHelper window will show up, but by clicking the Button, the URL does not open.

Any help would be much appreciated!

Remarks:

  • I run it as Administrator.
  • I already use UseShellExecute = true
lk74
  • 51
  • 1
  • 3

1 Answers1

0

The problem is that when the Windows application is run from a Setup Project, the Process.Start method does not open the URL.

One possible solution would be to use the Process.StartInfo.UseShellExecute property and set it to true. This will cause the process to be started using the ShellExecute method instead of the CreateProcess method.

Process.StartInfo.UseShellExecute = true;
Process.Start("http://www.google.com");
Mohamed Elgazar
  • 778
  • 4
  • 9