Exemple #1
0
        public int InstallPackages()
        {
            // We don't want two instances of Rhino to be installing packages at the same time!
            if (IsRhiExecRunning())
            {
                return((int)Model.InstallerPhase.AlreadyRunning);
            }

            // One time cleanup to fix http://dev.mcneel.com/bugtrack/?q=105783
            int lastSdkSrNo = GetLastInstalledSdkServiceReleaseNumber();

            if (lastSdkSrNo > 0 && lastSdkSrNo <= 201207195)
            {
                string localProfileLocalization = Path.Combine(InstallerEngine.CurrentUserLocalProfileRoot, "Localization");
                try
                {
                    if (Directory.Exists(localProfileLocalization))
                    {
                        Directory.Delete(localProfileLocalization, true);
                    }
                }
// ReSharper disable EmptyGeneralCatchClause
                catch
// ReSharper restore EmptyGeneralCatchClause
                {
                    // Don't worry if we can't delete these folders; it's just a little house keeping anyway.
                }
            }


            // See if the m_sdkservicerelease is the same as the
            // last time this was run. If it is, do nothing.
            if (ArePackagesCurrentByRegistry())
            {
                Logger.Log(LogLevel.Info, string.Format("InstallPackages exiting because RhinoSdkServiceRelease number has not changed: {0}", m_sdkservicerelease));
                return(0);
            }

            // Display modeless window telling user that it's installing packages.
            System.Windows.Forms.Application.EnableVisualStyles();
            System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
            m_dlg = new RMA.RhiExec.View.InitializingRhinoDialog(this);
            System.Windows.Forms.Application.Run(m_dlg);

            return(0);
        }
Exemple #2
0
        public int InstallPackages()
        {
            // We don't want two instances of Rhino to be installing packages at the same time!
              if (IsRhiExecRunning())
              {
            return (int)Model.InstallerPhase.AlreadyRunning;
              }

              // One time cleanup to fix http://dev.mcneel.com/bugtrack/?q=105783
              int lastSdkSrNo = GetLastInstalledSdkServiceReleaseNumber();
              if (lastSdkSrNo > 0 && lastSdkSrNo <= 201207195)
              {
            string localProfileLocalization = Path.Combine(InstallerEngine.CurrentUserLocalProfileRoot, "Localization");
            try
            {
              if (Directory.Exists(localProfileLocalization))
            Directory.Delete(localProfileLocalization, true);
            }
            // ReSharper disable EmptyGeneralCatchClause
            catch
            // ReSharper restore EmptyGeneralCatchClause
            {
              // Don't worry if we can't delete these folders; it's just a little house keeping anyway.
            }
              }

              // See if the m_sdkservicerelease is the same as the
              // last time this was run. If it is, do nothing.
              if (ArePackagesCurrentByRegistry())
              {
            Logger.Log(LogLevel.Info, string.Format("InstallPackages exiting because RhinoSdkServiceRelease number has not changed: {0}", m_sdkservicerelease));
            return 0;
              }

              // Display modeless window telling user that it's installing packages.
              System.Windows.Forms.Application.EnableVisualStyles();
              System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false);
              m_dlg = new RMA.RhiExec.View.InitializingRhinoDialog(this);
              System.Windows.Forms.Application.Run(m_dlg);

              return 0;
        }