简体   繁体   中英

How to determine location of a different application that was installed with ClickOnce?

What's the best way to determine the directories associated with another application (not the running one) that was installed with ClickOnce? The first application has no knowledge of the new application that is searching for it, and has no ability to notify the new application. Changing the first application is not an option. This solution must work across versions--that is, it must work without specifying the version of the first application.

I'm open to reading directly from the registry, but using the .NET Framework would be preferable. (It would certainly be nice to know where the data hides in the registry, though, assuming it's there.)

There is no built-in way to tell where a ClickOnce application is installed. The folder names are random, and they change every time an update is installed. What are you trying to accomplish? When you say you can't change the ClickOnce app, does that mean you don't own it and/or can't make any changes to the code base for it? If you could, you could have it write a file somewhere (LocalApplicationData) where the second application could find it. If you just want the second application to run the ClickOnce application, use process.start with IE and the installation URL of the ClickOnce application (this is what happens when you click on the shortcut to run a ClickOnce application).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM