コード例 #1
0
        private void BeginInstall()
        {
            InstallFlags flags = new InstallFlags();

            flags.SetConditionally(pepperBox.Checked, InstallFlags.PEPPER);
            flags.SetConditionally(netscapeBox.Checked, InstallFlags.NETSCAPE);
            flags.SetConditionally(activeXBox.Checked, InstallFlags.ACTIVEX);
            flags.SetConditionally(playerBox.Checked, InstallFlags.PLAYER);
            flags.SetConditionally(playerDesktopBox.Checked, InstallFlags.PLAYER_DESKTOP);
            flags.SetConditionally(playerStartMenuBox.Checked, InstallFlags.PLAYER_START_MENU);

            progressBar.Value   = 0;
            progressBar.Maximum = flags.GetTicks();

            new Task(new Action(() => {
                IntPtr redirection = RedirectionManager.DisableRedirection();

                try {
                    Uninstaller.Uninstall(this);
                    Installer.Install(this, flags);
                    Complete();
                } catch (Exception e) {
                    Failure(e);
                } finally {
                    RedirectionManager.EnableRedirection(redirection);
                }
            })).Start();
        }
コード例 #2
0
        private void BeginInstall()
        {
            int requiredValue = (pepperBox.Checked ? 1 : 0) + (netscapeBox.Checked ? 1 : 0) + (activeXBox.Checked ? 2 : 0);

            if (Environment.Is64BitOperatingSystem)
            {
                requiredValue *= 2;
            }

            requiredValue += UNINSTALL_TICKS;
            requiredValue += INSTALL_GENERAL_TICKS;

            progressBar.Value   = 0;
            progressBar.Maximum = requiredValue;

            new Task(new Action(() => {
                IntPtr redirection = RedirectionManager.DisableRedirection();

                try {
                    Uninstaller.Uninstall(this);
                    Installer.Install(this, pepperBox.Checked, netscapeBox.Checked, activeXBox.Checked);
                    Complete();
                } catch (Exception e) {
                    Failure(e);
                } finally {
                    RedirectionManager.EnableRedirection(redirection);
                }
            })).Start();
        }
コード例 #3
0
        private void BeginInstall()
        {
            progressBar.Value   = 0;
            progressBar.Maximum = UNINSTALL_TICKS;

            new Task(new Action(() => {
                IntPtr redirection = RedirectionManager.DisableRedirection();

                try {
                    Uninstaller.Uninstall(this);
                    Complete();
                } catch (Exception e) {
                    Failure(e);
                } finally {
                    RedirectionManager.EnableRedirection(redirection);
                }
            })).Start();
        }