You can get most of the info you want using the System.Deployment.Application.InPlaceHostingManager
class - don't be fooled by the name, it is primarily for browser-hosted ClickOnce apps, but also works for standalone ClickOnce apps. Once you initialise an instance and pass it the URL to the .application file, you can call GetManifestAsync()
- in the event handler for GetManifestCompleted
, you can get the application name and version:
void iphm_GetManifestCompleted(object sender, GetManifestCompletedEventArgs e) {
Console.WriteLine("Application name: {0}", e.ApplicationIdentity);
Console.WriteLine("Application version: {0}", e.Version);
}
The icon is usually referenced in the application manifest (.application is the deployment manifest) - the app manifest can be accessed using InPlaceHostingManager
; in the above example, you'd get the value from e.ApplicationManifest
which would give you an XmlReader
to play with.
Probably best to study the relevant XML schema(s) and then find the icon using XQuery.