Ejemplo n.º 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);
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 4
0
 public RemoveRegistryKeys(ClickOnceRegistry registry, UninstallInfo uninstallInfo)
 {
     _registry = registry;
     _uninstallInfo = uninstallInfo;
 }
Ejemplo n.º 5
0
 public RemoveRegistryKeys(ClickOnceRegistry registry, UninstallInfo uninstallInfo)
 {
     _registry      = registry;
     _uninstallInfo = uninstallInfo;
 }
Ejemplo n.º 6
0
 public RemoveStartMenuEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }
Ejemplo n.º 7
0
 public RemoveUninstallEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }
Ejemplo n.º 8
0
 public RemoveStartMenuEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }
Ejemplo n.º 9
0
 public RemoveUninstallEntry(UninstallInfo uninstallInfo)
 {
     _uninstallInfo = uninstallInfo;
 }