Example #1
0
        static void Main()
        {
            try
            {
                bool createdNew;
                instanceMutex = new Mutex(true, @"Local\" + Assembly.GetExecutingAssembly().GetType().GUID, out createdNew);
                if (!createdNew)
                {
                    instanceMutex = null;
                    return;
                }

                if (MessageBox.Show(Resources.Uninstall_Question, Resources.Uninstall + Globals.ProductName,
                                        MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    var clickOnceHelper = new ClickOnceHelper(Globals.PublisherName, Globals.ProductName, Globals.ProductSuite);
                    clickOnceHelper.Uninstall();

                    //Delete all files from publisher folder and folder itself on uninstall
                    var publisherFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Globals.PublisherName);
                    if (Directory.Exists(publisherFolder))
                        Directory.Delete(publisherFolder, true);
                }

                ReleaseMutex();

            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Example #2
0
 public static void SetAutoStart()
 {
     try
     {
         var clickOnceHelper = new ClickOnceHelper(Globals.PublisherName, Globals.ProductName, Globals.ProductSuite);
         clickOnceHelper.UpdateUninstallParameters();
         clickOnceHelper.AddShortcutToStartup();
     }
     catch (Exception ex)
     {
         TraceOps.Out(ex.ToString());
     }
 }
Example #3
0
 public static void SetAutoStart()
 {
     try
     {
         var clickOnceHelper = new ClickOnceHelper(Globals.PublisherName, Globals.ProductName, Globals.ProductSuite);
         clickOnceHelper.UpdateUninstallParameters();
         clickOnceHelper.AddShortcutToStartup();
     }
     catch (Exception ex)
     {
         TraceOps.Out(ex.ToString());
     }
 }