Bräuchte den um eine Deinstallation anzustarten, hatte da etwas imNetz gefunden:
how-to-initiate-an-uninstall-of-a-clickonce-app-from-within-the-app
For the crazy or desperate, reflection to the rescue! Replace the "X"s with your app's .application file name (not path) and public key token.
Tested on Windows 10 only.
var textualSubId = "XXXXXXXXXXXXXXXXXX.application, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXXXXX, processorArchitecture=amd64";
var deploymentServiceCom = new System.Deployment.Application.DeploymentServiceCom();
var _r_m_GetSubscriptionState = typeof(System.Deployment.Application.DeploymentServiceCom).GetMethod("GetSubscriptionState", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
var subState = _r_m_GetSubscriptionState.Invoke(deploymentServiceCom, new[] { textualSubId });
var subscriptionStore = subState.GetType().GetProperty("SubscriptionStore").GetValue(subState);
subscriptionStore.GetType().GetMethod("UninstallSubscription").Invoke(subscriptionStore, new[] { subState });
Hope this helps someone.
Nun würde ich gerne testen ob das klappt, aber leider brauche ich den "Public key token ".
Hat schon mal jemand so etwas gemacht?