示例#1
0
 public static IDisposable CleanupSquirrel(IUpdateManager updateManager)
 {
     return(Disposable.Create(() =>
     {
         updateManager.FullUninstall().Wait();
         updateManager.RemoveUninstallerRegistryEntry();
     }));
 }
        /// <summary>
        /// Removes registry keys under HKCU/SOFTWARE/OpenLiveWriter and deletes the AppData and Roaming profiles.
        /// </summary>
        /// <param name="mgr">An instance of Squirrel.UpdateManager to be used as helper class.</param>
        private static async void OnAppUninstall(IUpdateManager mgr)
        {
            await mgr.FullUninstall();

            string OLWRegKey = @"SOFTWARE\OpenLiveWriter";

            Registry.CurrentUser.DeleteSubKeyTree(OLWRegKey);
            mgr.RemoveShortcutForThisExe();
            mgr.RemoveUninstallerRegistryEntry();
            Directory.Delete(ApplicationEnvironment.LocalApplicationDataDirectory, true);
            Directory.Delete(ApplicationEnvironment.ApplicationDataDirectory, true);
        }