I don't know a way to query the ClickOnce store.
But as @Vojtěch Dohnal said. All ClickOnce applicaitons will be stored in C:\Users\xxxx\AppData\Local\Apps\2.0
We could imagine a solution who will, for each user, list all the executable files in the tree, and only save the last versions.
Here is an example code snippet (single user) :
var exes = Directory.EnumerateFiles(@"C:\Users\<user>\AppData\Local\Apps\2.0", "*.exe",
SearchOption.AllDirectories);
var apps = new Dictionary<String, Tuple<String, Version>>();
foreach (var file in exes)
{
var fileName = Path.GetFileName(file);
Version v = null;
Version.TryParse(FileVersionInfo.GetVersionInfo(file).FileVersion, out v);
if (fileName == null || v == null) continue;
if (!apps.ContainsKey(fileName))
{
apps.Add(fileName, new Tuple<string, Version>(file, v));
}
else if (v > apps[fileName].Item2)
{
apps[fileName] = new Tuple<string, Version>(file, v);
}
}
You'll find in the apps dictionary all the applications names as keys, and as values a Tuple containing the full path to the executable and it's version.
Didn't find another way to get the information, but i hope it'll do the job
Tried on my computer and it seems to work fine
If you know your application name, you can this way get the path to the last installed version.
If not but you know where the .appref-ms
is, you'll have to open it, get the application manifest (the .application
file published by ClickOnce) and get the executable name from the assemblyIdentity
node.