コード例 #1
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
        }
コード例 #2
0
ファイル: Installation.cs プロジェクト: tmpkus/openvss
        /// <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
        }