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
1
  • There were no errors during my testing, please check if your computer has a firewall or something. Or try it on another machine. Commented Oct 17, 2022 at 9:35

1 Answer 1

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");
Sign up to request clarification or add additional context in comments.

2 Comments

Exactly! That's the problem. Any ideas?
Thanks for your time, @LuckyOwl. I already use the UseShellExecute there. Did you try (and see) the code?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.