Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClickOnce appref-ms file location?

Is there any guaranteed way to get the location of the ".appref-ms" file of some application other than the executing application?

like image 489
Sawan Avatar asked Feb 14 '11 18:02

Sawan


1 Answers

Yes, you can. Try this out:

shortcutName = string.Concat(Environment.GetFolderPath(Environment.SpecialFolder.Programs),
  "\\", company, "\\", description, ".appref-ms");

where company is the Publishing Company in the Options dialog, and Description is the Product Name in the Options dialog.

I use this code generically inside my application by pulling the assembly information. I make sure the Assembly Company always matches the Publishing Company, and the Assembly Description always matches the Product Name.

like image 157
RobinDotNet Avatar answered Sep 19 '22 00:09

RobinDotNet