Is there any guaranteed way to get the location of the ".appref-ms" file of some application other than the executing application?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With