2

I'd like to be able to start a ClickOnce application from another executable. I know how to do this with the browser using Process.Start("http://PathToMyApp"). However, this is returning null for the Process. Therefore, I cannot check to ensure that the process has started or kill the process later.

How can I launch a click once application and get its Process Id and determine whether or not it launched successfully?

0

1 Answer 1

5

You have to find the shortcut for the ClickOnce application and do a process.start on that. Here's an example:

string shortcutName = 
  string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs),
  "\\", PublisherName, "\\", ProductName, ".appref-ms");
process.Start(shortcutName);

where PublisherName and ProductName are those filled in on the Options dialog in the Publish tab for the application you want to start.

You can also pass arguments to a ClickOnce application if you start it this way, even if it's offline.

Sign up to request clarification or add additional context in comments.

Comments

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.