Ejemplo n.º 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
        }
Ejemplo n.º 2
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)
            {
                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
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This routine should be called automatically by the MSI during setup, but it can also be called using:
        ///     "installutil.exe MSR.LST.Net.Rtp.dll"
        /// </summary>
        /// <param name="savedState">State dictionary passed in by the installer code</param>
        public override void Install(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 Uninstall in case we weren't uninstalled cleanly before
            IDictionary state = new Hashtable();
            Uninstall(state);
            if (state.Count != 0)
            {
                Commit(state);
            }
            state = null;
            #endregion
            #region Call base.Install
            base.Install(savedState);
            #endregion
            #region Install the Event Logs

            RtpEL.Install();

            #endregion
            #region Create PerfCounters

            PCInstaller.Install();

            #endregion
            #region Save the fact that we're installed to the registry
            Installed = true;
            #endregion
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This routine should be called automatically by the MSI during setup, but it can also be called using:
        ///     "installutil.exe MSR.LST.Net.Rtp.dll"
        /// </summary>
        /// <param name="savedState">State dictionary passed in by the installer code</param>
        public override void Install(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 Uninstall in case we weren't uninstalled cleanly before
            IDictionary state = new Hashtable();
            Uninstall(state);
            if (state.Count != 0)
            {
                Commit(state);
            }
            state = null;
            #endregion
            #region Call base.Install
            base.Install(savedState);
            #endregion
            #region Install the Event Logs

            RtpEL.Install();

            #endregion
            #region Create PerfCounters

            PCInstaller.Install();

            #endregion
            #region Save the fact that we're installed to the registry
            Installed = true;
            #endregion
        }