コード例 #1
0
        /// <summary>
        /// This routine should be called automatically by the MSI during Remove Programs, but it can also be called using:
        ///     "installutil.exe /u MSR.LST.Net.Rtp.dll"
        /// </summary>
        /// <param name="savedState">State dictionary passed in by the installer code</param>
        public override void Uninstall(IDictionary savedState)
        {
            #region Check to make sure we're in an Administrator role
            WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            if (wp.IsInRole(WindowsBuiltInRole.Administrator) == false)
            {
                RtlAwareMessageBox.Show(null, Strings.YouMustBeAnAdministratorToInstall,
                                        Strings.AdministratorPrivilegesRequired, MessageBoxButtons.OK, MessageBoxIcon.Stop,
                                        MessageBoxDefaultButton.Button1, (MessageBoxOptions)0);
                Application.Exit();
            }
            #endregion
            #region Delete the Event Logs

            RtpEL.Uninstall();

            #endregion
            #region Whack PerfCounters

            PCInstaller.Uninstall();

            #endregion
            #region Whack registry entry saying we're installed
            Installed = false;
            #endregion
            #region Call base.Uninstall
            if (savedState.Count != 0)
            {
                base.Uninstall(savedState);
            }
            #endregion
        }
コード例 #2
0
ファイル: Installation.cs プロジェクト: tmpkus/openvss
        /// <summary>
        /// This routine should be called automatically by the MSI during Remove Programs, but it can also be called using:
        ///     "installutil.exe /u MSR.LST.Net.Rtp.dll"
        /// </summary>
        /// <param name="savedState">State dictionary passed in by the installer code</param>
        public override void Uninstall(IDictionary savedState)
        {
            #region Check to make sure we're in an Administrator role
            WindowsPrincipal wp = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            if (wp.IsInRole(WindowsBuiltInRole.Administrator) == false)
            {
                MessageBox.Show("You must be an Administrator to install Rtp or run it for the first time.", "Administrator Privileges Required", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                Application.Exit();
            }
            #endregion
            #region Delete the Event Logs

            RtpEL.Uninstall();

            #endregion
            #region Whack PerfCounters

            PCInstaller.Uninstall();

            #endregion
            #region Whack registry entry saying we're installed
            Installed = false;
            #endregion
            #region Call base.Uninstall
            if (savedState.Count != 0)
            {
                base.Uninstall(savedState);
            }
            #endregion
        }