|
If have a requirement to be able to launch a ClickOnce app from another Windows app.
Usually, I would know the pathname of where an app is installed, but ClickOnce apps installation folders vary.
How can I do this?
Thanks, Bren | | BrenB Thursday, August 13, 2009 8:50 PM | You can do this by tracking down the shortcut to the ClickOnce application on the start menu and then doing a process.start on it. Here's some code to help you find the shortcut. "company" is the folder name on the start menu for the other app, and "description" is the description on the shortcut that the user runs to run the app.
shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), "\\", company, "\\", description, ".appref-ms");
Then just do a process.Start(shortcutName) on it. If you have a lot of firefox users, you might want to be more specific, and do Process.Start("iexplore.exe", shortcutName) so it opens with IE, just in case. (We have mixed problems with Firefox.
RobinDotNet Click here to visit my ClickOnce blog!- Marked As Answer byBrenB Friday, August 14, 2009 2:19 PM
-
| | RobinDotNet Thursday, August 13, 2009 11:48 PM | You can do this by tracking down the shortcut to the ClickOnce application on the start menu and then doing a process.start on it. Here's some code to help you find the shortcut. "company" is the folder name on the start menu for the other app, and "description" is the description on the shortcut that the user runs to run the app.
shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs), "\\", company, "\\", description, ".appref-ms");
Then just do a process.Start(shortcutName) on it. If you have a lot of firefox users, you might want to be more specific, and do Process.Start("iexplore.exe", shortcutName) so it opens with IE, just in case. (We have mixed problems with Firefox.
RobinDotNet Click here to visit my ClickOnce blog!- Marked As Answer byBrenB Friday, August 14, 2009 2:19 PM
-
| | RobinDotNet Thursday, August 13, 2009 11:48 PM | Robin,
Thanks for your reply. I marked it as the Answer, but I've not yet actually tried to use the code. However, I'm confident that it is the solution.
I thought that my problem was a bit obscure and that instead of trying to find the answer first by searching the forums, I'd just go ahead and post a new question.
After posting my question, I copied the text right out of my subject line and pasted it into the search, and the search results listed several threads with the same question, the first of which you alsohad answered. My apologies for not doing a better search first.
Bren
| | BrenB Friday, August 14, 2009 2:26 PM | It's no problem. I'll add this question to my blog, because it doesget asked a lot. :-) Robin Click here to visit my ClickOnce blog! | | RobinDotNet Friday, August 14, 2009 6:19 PM |
|