コード例 #1
0
ファイル: Program.cs プロジェクト: shockwavemk/pace
        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);
            }
        }
コード例 #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());
     }
 }
コード例 #3
0
ファイル: SystemOps.cs プロジェクト: shockwavemk/pace
 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());
     }
 }