Пример #1
0
        public static ActionResult UninstallClickOnce(Session session)
        {
            session.Log("Begin to uninstall ClickOnce deployment");

            var appName = "IPFilter Updater";

            try
            {
                var uninstallInfo = UninstallInfo.Find(appName);
                if (uninstallInfo == null)
                {
                    session.Log("No uninstall information found for " + appName);
                    return(ActionResult.NotExecuted);
                }

                session.Log("Waiting for files to become free...");
                Thread.Sleep(TimeSpan.FromSeconds(10));

                session.Log("Uninstalling " + appName);
                var uninstaller = new Uninstaller();
                uninstaller.Uninstall(uninstallInfo);
            }
            catch (Exception ex)
            {
                session.Log("ERROR in ClickOnceUninstaller custom action:\n {0}", ex.ToString());
                return(ActionResult.Failure);
            }

            return(ActionResult.Success);
        }
Пример #2
0
        public void Uninstall(UninstallInfo uninstallInfo)
        {
            var toRemove = FindComponentsToRemove(uninstallInfo.GetPublicKeyToken());

            Console.WriteLine("Components to remove:");
            toRemove.ForEach(Console.WriteLine);
            Console.WriteLine();

            var steps = new List<IUninstallStep>
                            {
                                new RemoveFiles(),
                                new RemoveStartMenuEntry(uninstallInfo),
                                new RemoveRegistryKeys(_registry, uninstallInfo),
                                new RemoveUninstallEntry(uninstallInfo)
                            };

            steps.ForEach(s => s.Prepare(toRemove));
            steps.ForEach(s => s.PrintDebugInformation());
            steps.ForEach(s => s.Execute());

            steps.ForEach(s => s.Dispose());
        }
Пример #3
0
        public void Uninstall(UninstallInfo uninstallInfo)
        {
            var toRemove = FindComponentsToRemove(uninstallInfo.GetPublicKeyToken());

            Console.WriteLine("Components to remove:");
            toRemove.ForEach(Console.WriteLine);
            Console.WriteLine();

            var steps = new List <IUninstallStep>
            {
                new RemoveFiles(),
                new RemoveStartMenuEntry(uninstallInfo),
                new RemoveRegistryKeys(_registry, uninstallInfo),
                new RemoveUninstallEntry(uninstallInfo)
            };

            steps.ForEach(s => s.Prepare(toRemove));
            steps.ForEach(s => s.PrintDebugInformation());
            steps.ForEach(s => s.Execute());

            steps.ForEach(s => s.Dispose());
        }
Пример #4
0
 public RemoveRegistryKeys(ClickOnceRegistry registry, UninstallInfo uninstallInfo)
 {
     _registry = registry;
     _uninstallInfo = uninstallInfo;
 }
Пример #5
0
 public RemoveRegistryKeys(ClickOnceRegistry registry, UninstallInfo uninstallInfo)
 {
     _registry      = registry;
     _uninstallInfo = uninstallInfo;
 }
Пример #6
0
 public RemoveStartMenuEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }
Пример #7
0
 public RemoveUninstallEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }
Пример #8
0
 public RemoveStartMenuEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }
Пример #9
0
 public RemoveUninstallEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }