diff --git a/CleanFlashCommon/Uninstaller.cs b/CleanFlashCommon/Uninstaller.cs index 61a0d4f..0357d20 100644 --- a/CleanFlashCommon/Uninstaller.cs +++ b/CleanFlashCommon/Uninstaller.cs @@ -12,7 +12,7 @@ namespace CleanFlashCommon { "flashcenterservice", "flashcenteruninst", "flashplay", "update", "wow_helper", "dummy_cmd", "flashhelperservice", // Flash Player-related processes - "flashplayerapp", + "flashplayerapp", "flashplayer_sa", "flashplayer_sa_debug", // Browsers that might be using Flash Player right now "opera", "iexplore", "chrome", "chromium", "brave", "vivaldi", "basilisk", "msedge", "seamonkey", "palemoon", "plugin-container" @@ -80,11 +80,13 @@ namespace CleanFlashCommon { // Remove shared start menu shortcuts FileUtil.RecursiveDelete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu), "Programs", "Flash Center")); FileUtil.RecursiveDelete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Programs", "Flash Center")); - + FileUtil.DeleteFile(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Flash Player.lnk")); + // Remove Desktop shortcut FileUtil.DeleteFile(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory), "Flash Center.lnk")); + FileUtil.DeleteFile(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "Flash Player.lnk")); - // Remove spyware dropped by Flash Center in the temporary folder + // Remove spyware dropped by Flash Center in the temporary folder string tempFolder = Path.GetTempPath(); foreach (string dir in Directory.GetDirectories(tempFolder)) { diff --git a/CleanFlashCommon/UpdateChecker.cs b/CleanFlashCommon/UpdateChecker.cs index f477f4c..0cbb011 100644 --- a/CleanFlashCommon/UpdateChecker.cs +++ b/CleanFlashCommon/UpdateChecker.cs @@ -34,6 +34,7 @@ namespace CleanFlashCommon { public class UpdateChecker { private static readonly string FLASH_VERSION = "34.0.0.155"; private static readonly string VERSION = "v34.0.0.155"; + private static readonly string FLASH_PLAYER_EXECUTABLE = "flashplayer_sa.exe"; private static readonly string AUTHOR = "cleanflash"; private static readonly string REPO = "installer"; private static readonly string USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36"; @@ -50,6 +51,10 @@ namespace CleanFlashCommon { return VERSION; } + public static string GetFlashPlayerExecutable() { + return FLASH_PLAYER_EXECUTABLE; + } + private static Version GetLatestVersionUnsafe() { using (WebClient client = new WebClient()) { client.Headers.Add("user-agent", USER_AGENT); diff --git a/CleanFlashInstaller/CleanFlashInstaller.csproj b/CleanFlashInstaller/CleanFlashInstaller.csproj index ba4a06d..7dc6175 100644 --- a/CleanFlashInstaller/CleanFlashInstaller.csproj +++ b/CleanFlashInstaller/CleanFlashInstaller.csproj @@ -123,6 +123,7 @@ + Form @@ -153,6 +154,7 @@ + @@ -173,7 +175,17 @@ - + + + {F935DC20-1CF0-11D0-ADB9-00C04FD58A0B} + 1 + 0 + 0 + tlbimp + False + True + + False @@ -197,4 +209,4 @@ - + \ No newline at end of file diff --git a/CleanFlashInstaller/InstallFlags.cs b/CleanFlashInstaller/InstallFlags.cs new file mode 100644 index 0000000..00d0dbe --- /dev/null +++ b/CleanFlashInstaller/InstallFlags.cs @@ -0,0 +1,55 @@ +using System; + +namespace CleanFlashInstaller { + public class InstallFlags { + public static int PEPPER = 1 << 0; + public static int NETSCAPE = 1 << 1; + public static int ACTIVEX = 1 << 2; + public static int PLAYER = 1 << 3; + public static int PLAYER_START_MENU = 1 << 4; + public static int PLAYER_DESKTOP = 1 << 5; + + private static int UNINSTALL_TICKS = 9; + private static int INSTALL_GENERAL_TICKS = 2; + + private int value = 0; + + public InstallFlags() { + value = 0; + } + + public bool IsSet(int flag) { + return (value & flag) == flag; + } + + public bool IsNoneSet() { + return value == 0; + } + + public void SetFlag(int flag) { + value |= flag; + } + + public void SetConditionally(bool set, int flag) { + if (set) { + SetFlag(flag); + } + } + + public int GetTicks() { + int ticks = (IsSet(PEPPER) ? 1 : 0) + (IsSet(NETSCAPE) ? 1 : 0) + (IsSet(ACTIVEX) ? 2 : 0); + + if (Environment.Is64BitOperatingSystem) { + ticks *= 2; + } + + if (IsSet(PLAYER)) { + ticks++; + } + + ticks += UNINSTALL_TICKS; + ticks += INSTALL_GENERAL_TICKS; + return ticks; + } + } +} diff --git a/CleanFlashInstaller/InstallForm.Designer.cs b/CleanFlashInstaller/InstallForm.Designer.cs index 758e835..8f0c51a 100644 --- a/CleanFlashInstaller/InstallForm.Designer.cs +++ b/CleanFlashInstaller/InstallForm.Designer.cs @@ -33,12 +33,17 @@ namespace CleanFlashInstaller { this.titleLabel = new System.Windows.Forms.Label(); this.subtitleLabel = new System.Windows.Forms.Label(); this.disclaimerPanel = new System.Windows.Forms.Panel(); + this.disclaimerBox = new CleanFlashCommon.ImageCheckBox(); this.choicePanel = new System.Windows.Forms.Panel(); this.activeXLabel = new System.Windows.Forms.Label(); + this.activeXBox = new CleanFlashCommon.ImageCheckBox(); this.netscapeLabel = new System.Windows.Forms.Label(); + this.netscapeBox = new CleanFlashCommon.ImageCheckBox(); this.pepperLabel = new System.Windows.Forms.Label(); - this.label1 = new System.Windows.Forms.Label(); + this.pepperBox = new CleanFlashCommon.ImageCheckBox(); + this.browserAskLabel = new System.Windows.Forms.Label(); this.installPanel = new System.Windows.Forms.Panel(); + this.progressBar = new CleanFlashCommon.SmoothProgressBar(); this.progressLabel = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.beforeInstallPanel = new System.Windows.Forms.Panel(); @@ -46,16 +51,19 @@ namespace CleanFlashInstaller { this.completePanel = new System.Windows.Forms.Panel(); this.completeLabel = new System.Windows.Forms.LinkLabel(); this.failurePanel = new System.Windows.Forms.Panel(); + this.copyErrorButton = new CleanFlashCommon.GradientButton(); this.failureBox = new System.Windows.Forms.TextBox(); this.failureText = new System.Windows.Forms.Label(); - this.copyErrorButton = new CleanFlashCommon.GradientButton(); - this.progressBar = new CleanFlashCommon.SmoothProgressBar(); this.nextButton = new CleanFlashCommon.GradientButton(); this.prevButton = new CleanFlashCommon.GradientButton(); - this.activeXBox = new CleanFlashCommon.ImageCheckBox(); - this.netscapeBox = new CleanFlashCommon.ImageCheckBox(); - this.pepperBox = new CleanFlashCommon.ImageCheckBox(); - this.disclaimerBox = new CleanFlashCommon.ImageCheckBox(); + this.playerChoicePanel = new System.Windows.Forms.Panel(); + this.playerStartMenuLabel = new System.Windows.Forms.Label(); + this.playerStartMenuBox = new CleanFlashCommon.ImageCheckBox(); + this.playerDesktopLabel = new System.Windows.Forms.Label(); + this.playerDesktopBox = new CleanFlashCommon.ImageCheckBox(); + this.playerLabel = new System.Windows.Forms.Label(); + this.playerBox = new CleanFlashCommon.ImageCheckBox(); + this.playerAskLabel = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.flashLogo)).BeginInit(); this.disclaimerPanel.SuspendLayout(); this.choicePanel.SuspendLayout(); @@ -63,6 +71,7 @@ namespace CleanFlashInstaller { this.beforeInstallPanel.SuspendLayout(); this.completePanel.SuspendLayout(); this.failurePanel.SuspendLayout(); + this.playerChoicePanel.SuspendLayout(); this.SuspendLayout(); // // disclaimerLabel @@ -93,7 +102,7 @@ namespace CleanFlashInstaller { // // flashLogo // - this.flashLogo.Image = Properties.Resources.flashLogo; + this.flashLogo.Image = global::CleanFlashInstaller.Properties.Resources.flashLogo; this.flashLogo.Location = new System.Drawing.Point(90, 36); this.flashLogo.Margin = new System.Windows.Forms.Padding(0); this.flashLogo.Name = "flashLogo"; @@ -130,6 +139,26 @@ namespace CleanFlashInstaller { this.disclaimerPanel.Size = new System.Drawing.Size(545, 105); this.disclaimerPanel.TabIndex = 8; // + // disclaimerBox + // + this.disclaimerBox.Appearance = System.Windows.Forms.Appearance.Button; + this.disclaimerBox.AutoSize = true; + this.disclaimerBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.disclaimerBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.disclaimerBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.disclaimerBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.disclaimerBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.disclaimerBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.disclaimerBox.ImageIndex = 0; + this.disclaimerBox.ImageList = this.checkboxImages; + this.disclaimerBox.Location = new System.Drawing.Point(0, 0); + this.disclaimerBox.Margin = new System.Windows.Forms.Padding(0); + this.disclaimerBox.Name = "disclaimerBox"; + this.disclaimerBox.Size = new System.Drawing.Size(21, 21); + this.disclaimerBox.TabIndex = 2; + this.disclaimerBox.UseVisualStyleBackColor = true; + this.disclaimerBox.CheckedChanged += new System.EventHandler(this.disclaimerBox_CheckedChanged); + // // choicePanel // this.choicePanel.Controls.Add(this.activeXLabel); @@ -138,7 +167,7 @@ namespace CleanFlashInstaller { this.choicePanel.Controls.Add(this.netscapeBox); this.choicePanel.Controls.Add(this.pepperLabel); this.choicePanel.Controls.Add(this.pepperBox); - this.choicePanel.Controls.Add(this.label1); + this.choicePanel.Controls.Add(this.browserAskLabel); this.choicePanel.Location = new System.Drawing.Point(90, 162); this.choicePanel.Name = "choicePanel"; this.choicePanel.Size = new System.Drawing.Size(545, 105); @@ -154,6 +183,27 @@ namespace CleanFlashInstaller { this.activeXLabel.Text = "ActiveX (OCX)\r\n(IE/Embedded/Desktop)"; this.activeXLabel.Click += new System.EventHandler(this.activeXLabel_Click); // + // activeXBox + // + this.activeXBox.Appearance = System.Windows.Forms.Appearance.Button; + this.activeXBox.AutoSize = true; + this.activeXBox.Checked = true; + this.activeXBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.activeXBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.activeXBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.activeXBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.activeXBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.activeXBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.activeXBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.activeXBox.ImageIndex = 1; + this.activeXBox.ImageList = this.checkboxImages; + this.activeXBox.Location = new System.Drawing.Point(365, 47); + this.activeXBox.Margin = new System.Windows.Forms.Padding(0); + this.activeXBox.Name = "activeXBox"; + this.activeXBox.Size = new System.Drawing.Size(21, 21); + this.activeXBox.TabIndex = 7; + this.activeXBox.UseVisualStyleBackColor = true; + // // netscapeLabel // this.netscapeLabel.AutoSize = true; @@ -164,6 +214,27 @@ namespace CleanFlashInstaller { this.netscapeLabel.Text = "Netscape API (NPAPI)\r\n(Firefox/ESR/Basilisk)\r\n"; this.netscapeLabel.Click += new System.EventHandler(this.netscapeLabel_Click); // + // netscapeBox + // + this.netscapeBox.Appearance = System.Windows.Forms.Appearance.Button; + this.netscapeBox.AutoSize = true; + this.netscapeBox.Checked = true; + this.netscapeBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.netscapeBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.netscapeBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.netscapeBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.netscapeBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.netscapeBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.netscapeBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.netscapeBox.ImageIndex = 1; + this.netscapeBox.ImageList = this.checkboxImages; + this.netscapeBox.Location = new System.Drawing.Point(186, 47); + this.netscapeBox.Margin = new System.Windows.Forms.Padding(0); + this.netscapeBox.Name = "netscapeBox"; + this.netscapeBox.Size = new System.Drawing.Size(21, 21); + this.netscapeBox.TabIndex = 5; + this.netscapeBox.UseVisualStyleBackColor = true; + // // pepperLabel // this.pepperLabel.AutoSize = true; @@ -174,14 +245,35 @@ namespace CleanFlashInstaller { this.pepperLabel.Text = "Pepper API (PPAPI)\r\n(Chrome/Opera/Brave)"; this.pepperLabel.Click += new System.EventHandler(this.pepperLabel_Click); // - // label1 + // pepperBox // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(-2, 2); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(287, 17); - this.label1.TabIndex = 0; - this.label1.Text = "Which browser plugins would you like to install?"; + this.pepperBox.Appearance = System.Windows.Forms.Appearance.Button; + this.pepperBox.AutoSize = true; + this.pepperBox.Checked = true; + this.pepperBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.pepperBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.pepperBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.pepperBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.pepperBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.pepperBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.pepperBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.pepperBox.ImageIndex = 1; + this.pepperBox.ImageList = this.checkboxImages; + this.pepperBox.Location = new System.Drawing.Point(0, 47); + this.pepperBox.Margin = new System.Windows.Forms.Padding(0); + this.pepperBox.Name = "pepperBox"; + this.pepperBox.Size = new System.Drawing.Size(21, 21); + this.pepperBox.TabIndex = 3; + this.pepperBox.UseVisualStyleBackColor = true; + // + // browserAskLabel + // + this.browserAskLabel.AutoSize = true; + this.browserAskLabel.Location = new System.Drawing.Point(-2, 2); + this.browserAskLabel.Name = "browserAskLabel"; + this.browserAskLabel.Size = new System.Drawing.Size(287, 17); + this.browserAskLabel.TabIndex = 0; + this.browserAskLabel.Text = "Which browser plugins would you like to install?"; // // installPanel // @@ -193,6 +285,18 @@ namespace CleanFlashInstaller { this.installPanel.Size = new System.Drawing.Size(545, 105); this.installPanel.TabIndex = 10; // + // progressBar + // + this.progressBar.Location = new System.Drawing.Point(49, 58); + this.progressBar.Maximum = 100; + this.progressBar.Minimum = 0; + this.progressBar.Name = "progressBar"; + this.progressBar.ProgressBarColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(97)))), ((int)(((byte)(147)))), ((int)(((byte)(232))))); + this.progressBar.ProgressBarColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(99)))), ((int)(((byte)(232))))); + this.progressBar.Size = new System.Drawing.Size(451, 23); + this.progressBar.TabIndex = 2; + this.progressBar.Value = 0; + // // progressLabel // this.progressLabel.AutoSize = true; @@ -258,25 +362,6 @@ namespace CleanFlashInstaller { this.failurePanel.Name = "failurePanel"; this.failurePanel.Size = new System.Drawing.Size(545, 105); this.failurePanel.TabIndex = 13; - // - // failureBox - // - this.failureBox.Location = new System.Drawing.Point(4, 44); - this.failureBox.Multiline = true; - this.failureBox.Name = "failureBox"; - this.failureBox.ReadOnly = true; - this.failureBox.Size = new System.Drawing.Size(431, 58); - this.failureBox.TabIndex = 15; - // - // failureText - // - this.failureText.AutoSize = true; - this.failureText.Location = new System.Drawing.Point(3, 2); - this.failureText.Name = "failureText"; - this.failureText.Size = new System.Drawing.Size(432, 34); - this.failureText.TabIndex = 14; - this.failureText.Text = "Oops! The installation process has encountered an unexpected problem.\r\nThe follow" + - "ing details could be useful. Press the Retry button to try again."; // // copyErrorButton // @@ -295,17 +380,24 @@ namespace CleanFlashInstaller { this.copyErrorButton.UseVisualStyleBackColor = false; this.copyErrorButton.Click += new System.EventHandler(this.copyErrorButton_Click); // - // progressBar + // failureBox // - this.progressBar.Location = new System.Drawing.Point(49, 58); - this.progressBar.Maximum = 100; - this.progressBar.Minimum = 0; - this.progressBar.Name = "progressBar"; - this.progressBar.ProgressBarColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(97)))), ((int)(((byte)(147)))), ((int)(((byte)(232))))); - this.progressBar.ProgressBarColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(99)))), ((int)(((byte)(232))))); - this.progressBar.Size = new System.Drawing.Size(451, 23); - this.progressBar.TabIndex = 2; - this.progressBar.Value = 0; + this.failureBox.Location = new System.Drawing.Point(4, 44); + this.failureBox.Multiline = true; + this.failureBox.Name = "failureBox"; + this.failureBox.ReadOnly = true; + this.failureBox.Size = new System.Drawing.Size(431, 58); + this.failureBox.TabIndex = 15; + // + // failureText + // + this.failureText.AutoSize = true; + this.failureText.Location = new System.Drawing.Point(3, 2); + this.failureText.Name = "failureText"; + this.failureText.Size = new System.Drawing.Size(432, 34); + this.failureText.TabIndex = 14; + this.failureText.Text = "Oops! The installation process has encountered an unexpected problem.\r\nThe follow" + + "ing details could be useful. Press the Retry button to try again."; // // nextButton // @@ -341,88 +433,122 @@ namespace CleanFlashInstaller { this.prevButton.UseVisualStyleBackColor = false; this.prevButton.Click += new System.EventHandler(this.prevButton_Click); // - // activeXBox - // - this.activeXBox.Appearance = System.Windows.Forms.Appearance.Button; - this.activeXBox.AutoSize = true; - this.activeXBox.Checked = true; - this.activeXBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.activeXBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.activeXBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.activeXBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.activeXBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.activeXBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.activeXBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.activeXBox.ImageIndex = 1; - this.activeXBox.ImageList = this.checkboxImages; - this.activeXBox.Location = new System.Drawing.Point(365, 47); - this.activeXBox.Margin = new System.Windows.Forms.Padding(0); - this.activeXBox.Name = "activeXBox"; - this.activeXBox.Size = new System.Drawing.Size(21, 21); - this.activeXBox.TabIndex = 7; - this.activeXBox.UseVisualStyleBackColor = true; - // - // netscapeBox - // - this.netscapeBox.Appearance = System.Windows.Forms.Appearance.Button; - this.netscapeBox.AutoSize = true; - this.netscapeBox.Checked = true; - this.netscapeBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.netscapeBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.netscapeBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.netscapeBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.netscapeBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.netscapeBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.netscapeBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.netscapeBox.ImageIndex = 1; - this.netscapeBox.ImageList = this.checkboxImages; - this.netscapeBox.Location = new System.Drawing.Point(186, 47); - this.netscapeBox.Margin = new System.Windows.Forms.Padding(0); - this.netscapeBox.Name = "netscapeBox"; - this.netscapeBox.Size = new System.Drawing.Size(21, 21); - this.netscapeBox.TabIndex = 5; - this.netscapeBox.UseVisualStyleBackColor = true; - // - // pepperBox - // - this.pepperBox.Appearance = System.Windows.Forms.Appearance.Button; - this.pepperBox.AutoSize = true; - this.pepperBox.Checked = true; - this.pepperBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.pepperBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.pepperBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.pepperBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.pepperBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.pepperBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.pepperBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.pepperBox.ImageIndex = 1; - this.pepperBox.ImageList = this.checkboxImages; - this.pepperBox.Location = new System.Drawing.Point(0, 47); - this.pepperBox.Margin = new System.Windows.Forms.Padding(0); - this.pepperBox.Name = "pepperBox"; - this.pepperBox.Size = new System.Drawing.Size(21, 21); - this.pepperBox.TabIndex = 3; - this.pepperBox.UseVisualStyleBackColor = true; - // - // disclaimerBox - // - this.disclaimerBox.Appearance = System.Windows.Forms.Appearance.Button; - this.disclaimerBox.AutoSize = true; - this.disclaimerBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.disclaimerBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.disclaimerBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.disclaimerBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.disclaimerBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.disclaimerBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); - this.disclaimerBox.ImageIndex = 0; - this.disclaimerBox.ImageList = this.checkboxImages; - this.disclaimerBox.Location = new System.Drawing.Point(0, 0); - this.disclaimerBox.Margin = new System.Windows.Forms.Padding(0); - this.disclaimerBox.Name = "disclaimerBox"; - this.disclaimerBox.Size = new System.Drawing.Size(21, 21); - this.disclaimerBox.TabIndex = 2; - this.disclaimerBox.UseVisualStyleBackColor = true; - this.disclaimerBox.CheckedChanged += new System.EventHandler(this.disclaimerBox_CheckedChanged); + // playerChoicePanel + // + this.playerChoicePanel.Controls.Add(this.playerStartMenuLabel); + this.playerChoicePanel.Controls.Add(this.playerStartMenuBox); + this.playerChoicePanel.Controls.Add(this.playerDesktopLabel); + this.playerChoicePanel.Controls.Add(this.playerDesktopBox); + this.playerChoicePanel.Controls.Add(this.playerLabel); + this.playerChoicePanel.Controls.Add(this.playerBox); + this.playerChoicePanel.Controls.Add(this.playerAskLabel); + this.playerChoicePanel.Location = new System.Drawing.Point(90, 162); + this.playerChoicePanel.Name = "playerChoicePanel"; + this.playerChoicePanel.Size = new System.Drawing.Size(545, 105); + this.playerChoicePanel.TabIndex = 10; + // + // playerStartMenuLabel + // + this.playerStartMenuLabel.AutoSize = true; + this.playerStartMenuLabel.Location = new System.Drawing.Point(389, 47); + this.playerStartMenuLabel.Name = "playerStartMenuLabel"; + this.playerStartMenuLabel.Size = new System.Drawing.Size(104, 34); + this.playerStartMenuLabel.TabIndex = 8; + this.playerStartMenuLabel.Text = "Create Shortcuts\r\nin Start Menu"; + this.playerStartMenuLabel.Click += new System.EventHandler(this.playerStartMenuLabel_Click); + // + // playerStartMenuBox + // + this.playerStartMenuBox.Appearance = System.Windows.Forms.Appearance.Button; + this.playerStartMenuBox.AutoSize = true; + this.playerStartMenuBox.Checked = true; + this.playerStartMenuBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.playerStartMenuBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerStartMenuBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerStartMenuBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerStartMenuBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerStartMenuBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.playerStartMenuBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerStartMenuBox.ImageIndex = 1; + this.playerStartMenuBox.ImageList = this.checkboxImages; + this.playerStartMenuBox.Location = new System.Drawing.Point(365, 47); + this.playerStartMenuBox.Margin = new System.Windows.Forms.Padding(0); + this.playerStartMenuBox.Name = "playerStartMenuBox"; + this.playerStartMenuBox.Size = new System.Drawing.Size(21, 21); + this.playerStartMenuBox.TabIndex = 7; + this.playerStartMenuBox.UseVisualStyleBackColor = true; + // + // playerDesktopLabel + // + this.playerDesktopLabel.AutoSize = true; + this.playerDesktopLabel.Location = new System.Drawing.Point(210, 47); + this.playerDesktopLabel.Name = "playerDesktopLabel"; + this.playerDesktopLabel.Size = new System.Drawing.Size(104, 34); + this.playerDesktopLabel.TabIndex = 6; + this.playerDesktopLabel.Text = "Create Shortcuts\r\non Desktop"; + this.playerDesktopLabel.Click += new System.EventHandler(this.playerDesktopLabel_Click); + // + // playerDesktopBox + // + this.playerDesktopBox.Appearance = System.Windows.Forms.Appearance.Button; + this.playerDesktopBox.AutoSize = true; + this.playerDesktopBox.Checked = true; + this.playerDesktopBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.playerDesktopBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerDesktopBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerDesktopBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerDesktopBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerDesktopBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.playerDesktopBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerDesktopBox.ImageIndex = 1; + this.playerDesktopBox.ImageList = this.checkboxImages; + this.playerDesktopBox.Location = new System.Drawing.Point(186, 47); + this.playerDesktopBox.Margin = new System.Windows.Forms.Padding(0); + this.playerDesktopBox.Name = "playerDesktopBox"; + this.playerDesktopBox.Size = new System.Drawing.Size(21, 21); + this.playerDesktopBox.TabIndex = 5; + this.playerDesktopBox.UseVisualStyleBackColor = true; + // + // playerLabel + // + this.playerLabel.AutoSize = true; + this.playerLabel.Location = new System.Drawing.Point(24, 47); + this.playerLabel.Name = "playerLabel"; + this.playerLabel.Size = new System.Drawing.Size(110, 34); + this.playerLabel.TabIndex = 4; + this.playerLabel.Text = "Install Standalone\r\nFlash Player"; + this.playerLabel.Click += new System.EventHandler(this.playerLabel_Click); + // + // playerBox + // + this.playerBox.Appearance = System.Windows.Forms.Appearance.Button; + this.playerBox.AutoSize = true; + this.playerBox.Checked = true; + this.playerBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.playerBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.playerBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); + this.playerBox.ImageIndex = 1; + this.playerBox.ImageList = this.checkboxImages; + this.playerBox.Location = new System.Drawing.Point(0, 47); + this.playerBox.Margin = new System.Windows.Forms.Padding(0); + this.playerBox.Name = "playerBox"; + this.playerBox.Size = new System.Drawing.Size(21, 21); + this.playerBox.TabIndex = 3; + this.playerBox.UseVisualStyleBackColor = true; + this.playerBox.CheckedChanged += new System.EventHandler(this.playerBox_CheckedChanged); + // + // playerAskLabel + // + this.playerAskLabel.AutoSize = true; + this.playerAskLabel.Location = new System.Drawing.Point(-2, 2); + this.playerAskLabel.Name = "playerAskLabel"; + this.playerAskLabel.Size = new System.Drawing.Size(314, 17); + this.playerAskLabel.TabIndex = 0; + this.playerAskLabel.Text = "Would you like to install the standalone Flash Player?"; // // InstallForm // @@ -430,18 +556,19 @@ namespace CleanFlashInstaller { this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51))))); this.ClientSize = new System.Drawing.Size(712, 329); - this.Controls.Add(this.failurePanel); - this.Controls.Add(this.completePanel); - this.Controls.Add(this.beforeInstallPanel); - this.Controls.Add(this.installPanel); this.Controls.Add(this.nextButton); this.Controls.Add(this.subtitleLabel); this.Controls.Add(this.titleLabel); this.Controls.Add(this.flashLogo); this.Controls.Add(this.prevButton); this.Controls.Add(this.separator); + this.Controls.Add(this.playerChoicePanel); this.Controls.Add(this.choicePanel); this.Controls.Add(this.disclaimerPanel); + this.Controls.Add(this.failurePanel); + this.Controls.Add(this.completePanel); + this.Controls.Add(this.beforeInstallPanel); + this.Controls.Add(this.installPanel); this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.ForeColor = System.Drawing.SystemColors.ControlLightLight; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; @@ -465,6 +592,8 @@ namespace CleanFlashInstaller { this.completePanel.PerformLayout(); this.failurePanel.ResumeLayout(false); this.failurePanel.PerformLayout(); + this.playerChoicePanel.ResumeLayout(false); + this.playerChoicePanel.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -489,7 +618,7 @@ namespace CleanFlashInstaller { private CleanFlashCommon.ImageCheckBox netscapeBox; private System.Windows.Forms.Label pepperLabel; private CleanFlashCommon.ImageCheckBox pepperBox; - private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label browserAskLabel; private System.Windows.Forms.Panel installPanel; private CleanFlashCommon.SmoothProgressBar progressBar; private System.Windows.Forms.Label progressLabel; @@ -502,6 +631,14 @@ namespace CleanFlashInstaller { private System.Windows.Forms.TextBox failureBox; private System.Windows.Forms.Label failureText; private CleanFlashCommon.GradientButton copyErrorButton; + private System.Windows.Forms.Panel playerChoicePanel; + private System.Windows.Forms.Label playerStartMenuLabel; + private CleanFlashCommon.ImageCheckBox playerStartMenuBox; + private System.Windows.Forms.Label playerDesktopLabel; + private CleanFlashCommon.ImageCheckBox playerDesktopBox; + private System.Windows.Forms.Label playerLabel; + private CleanFlashCommon.ImageCheckBox playerBox; + private System.Windows.Forms.Label playerAskLabel; } } diff --git a/CleanFlashInstaller/InstallForm.cs b/CleanFlashInstaller/InstallForm.cs index 3def8c8..f64f77d 100644 --- a/CleanFlashInstaller/InstallForm.cs +++ b/CleanFlashInstaller/InstallForm.cs @@ -7,8 +7,6 @@ using System.Windows.Forms; namespace CleanFlashInstaller { public partial class InstallForm : Form, IProgressForm { - private static int UNINSTALL_TICKS = 9; - private static int INSTALL_GENERAL_TICKS = 2; private static string COMPLETE_INSTALL_TEXT = @"Clean Flash Player has been successfully installed! Don't forget, Flash Player is no longer compatible with new browsers. We recommend using: • Older Google Chrome ≤ 87 @@ -31,6 +29,7 @@ If you ever change your mind, check out Clean Flash Player's website!"; private void HideAllPanels() { disclaimerPanel.Visible = false; choicePanel.Visible = false; + playerChoicePanel.Visible = false; beforeInstallPanel.Visible = false; installPanel.Visible = false; completePanel.Visible = false; @@ -51,6 +50,13 @@ If you ever change your mind, check out Clean Flash Player's website!"; nextButton.Text = "NEXT"; } + private void OpenPlayerChoicePanel() { + HideAllPanels(); + playerChoicePanel.Visible = true; + prevButton.Text = "BACK"; + nextButton.Text = "NEXT"; + } + private string JoinStringsWithAnd(List strings) { string text = string.Join(", ", strings); int index = text.LastIndexOf(", "); @@ -130,24 +136,23 @@ If you ever change your mind, check out Clean Flash Player's website!"; } 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; + 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 = requiredValue; + progressBar.Maximum = flags.GetTicks(); new Task(new Action(() => { IntPtr redirection = RedirectionManager.DisableRedirection(); try { Uninstaller.Uninstall(this); - Installer.Install(this, pepperBox.Checked, netscapeBox.Checked, activeXBox.Checked); + Installer.Install(this, flags); Complete(); } catch (Exception e) { Failure(e); @@ -181,6 +186,8 @@ If you ever change your mind, check out Clean Flash Player's website!"; } else if (choicePanel.Visible) { OpenDisclaimerPanel(); } else if (beforeInstallPanel.Visible) { + OpenPlayerChoicePanel(); + } else if (playerChoicePanel.Visible) { OpenChoicePanel(); } } @@ -189,6 +196,8 @@ If you ever change your mind, check out Clean Flash Player's website!"; if (disclaimerPanel.Visible) { OpenChoicePanel(); } else if (choicePanel.Visible) { + OpenPlayerChoicePanel(); + } else if (playerChoicePanel.Visible) { OpenBeforeInstall(); } else if (beforeInstallPanel.Visible || failurePanel.Visible) { OpenInstall(); @@ -207,8 +216,31 @@ If you ever change your mind, check out Clean Flash Player's website!"; activeXBox.Checked = !activeXBox.Checked; } - private void button1_Click(object sender, EventArgs e) { - BeginInstall(); + private void playerLabel_Click(object sender, EventArgs e) { + playerBox.Checked = !playerBox.Checked; + } + + private void playerDesktopLabel_Click(object sender, EventArgs e) { + if (playerBox.Checked) { + playerDesktopBox.Checked = !playerDesktopBox.Checked; + } + } + + private void playerStartMenuLabel_Click(object sender, EventArgs e) { + if (playerBox.Checked) { + playerStartMenuBox.Checked = !playerStartMenuBox.Checked; + } + } + private void playerBox_CheckedChanged(object sender, EventArgs e) { + bool enabled = playerBox.Checked; + + playerDesktopBox.Enabled = enabled; + playerStartMenuBox.Enabled = enabled; + + if (!enabled) { + playerDesktopBox.Checked = false; + playerStartMenuBox.Checked = false; + } } public void UpdateProgressLabel(string text, bool tick) { diff --git a/CleanFlashInstaller/InstallForm.resx b/CleanFlashInstaller/InstallForm.resx index c382dc3..4b032cd 100644 --- a/CleanFlashInstaller/InstallForm.resx +++ b/CleanFlashInstaller/InstallForm.resx @@ -133,7 +133,7 @@ Adobe is not required by any means to provide support for this version of Flash AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACY - CAAAAk1TRnQBSQFMAgEBAgEAAeABAQHgAQEBDwEAAQ8BAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAAegBAQHoAQEBDwEAAQ8BAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABPAMAAQ8DAAEBAQABCAUAAYQBAxgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz diff --git a/CleanFlashInstaller/Installer.cs b/CleanFlashInstaller/Installer.cs index 689973f..1decb1a 100644 --- a/CleanFlashInstaller/Installer.cs +++ b/CleanFlashInstaller/Installer.cs @@ -5,6 +5,7 @@ using System.IO; using System.Reflection; using System.Diagnostics; using Ionic.Zip; +using IWshRuntimeLibrary; namespace CleanFlashInstaller { public class Installer { @@ -32,8 +33,21 @@ namespace CleanFlashInstaller { } } - public static void Install(IProgressForm form, bool installPP, bool installNP, bool installOCX) { - if (!installPP && !installNP && !installOCX) { + public static void CreateShortcut(string folder, string executable, string name, string description) { + WshShell wsh = new WshShell(); + IWshShortcut shortcut = wsh.CreateShortcut(Path.Combine(folder, name + ".lnk")) as IWshShortcut; + + shortcut.Arguments = ""; + shortcut.TargetPath = executable; + shortcut.WindowStyle = (int) WshWindowStyle.WshNormalFocus; + shortcut.Description = description; + shortcut.WorkingDirectory = Path.GetDirectoryName(executable); + shortcut.IconLocation = executable; + shortcut.Save(); + } + + public static void Install(IProgressForm form, InstallFlags flags) { + if (flags.IsNoneSet()) { // No packages should be installed. return; } @@ -52,34 +66,50 @@ namespace CleanFlashInstaller { form.UpdateProgressLabel("Extracting uninstaller..", true); ExtractArchive("flash_uninstaller.zip", flash32Path); - if (installPP) { + if (flags.IsSet(InstallFlags.PEPPER)) { form.UpdateProgressLabel("Installing 32-bit Flash Player for Chrome...", true); ExtractArchive("flash_pp_32.zip", flash32Path); registryToApply.Add(Properties.Resources.installPP); } - if (installNP) { + if (flags.IsSet(InstallFlags.NETSCAPE)) { form.UpdateProgressLabel("Installing 32-bit Flash Player for Firefox...", true); ExtractArchive("flash_np_32.zip", flash32Path); registryToApply.Add(Properties.Resources.installNP); } - if (installOCX) { + if (flags.IsSet(InstallFlags.ACTIVEX)) { form.UpdateProgressLabel("Installing 32-bit Flash Player for Internet Explorer...", true); ExtractArchive("flash_ocx_32.zip", flash32Path); registryToApply.Add(Properties.Resources.installOCX); } + if (flags.IsSet(InstallFlags.PLAYER)) { + form.UpdateProgressLabel("Installing 32-bit Standalone Flash Player...", true); + ExtractArchive("flash_player_32.zip", flash32Path); + + string name = "Flash Player"; + string description = "Standalone Flash Player " + UpdateChecker.GetFlashVersion(); + string executable = Path.Combine(flash32Path, UpdateChecker.GetFlashPlayerExecutable()); + + if (flags.IsSet(InstallFlags.PLAYER_START_MENU)) { + CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), executable, name, description); + } + + if (flags.IsSet(InstallFlags.PLAYER_DESKTOP)) { + CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), executable, name, description); + } + } if (Environment.Is64BitOperatingSystem) { - if (installPP) { + if (flags.IsSet(InstallFlags.PEPPER)) { form.UpdateProgressLabel("Installing 64-bit Flash Player for Chrome...", true); ExtractArchive("flash_pp_64.zip", flash64Path); registryToApply.Add(Properties.Resources.installPP64); } - if (installNP) { + if (flags.IsSet(InstallFlags.NETSCAPE)) { form.UpdateProgressLabel("Installing 64-bit Flash Player for Firefox...", true); ExtractArchive("flash_np_64.zip", flash64Path); registryToApply.Add(Properties.Resources.installNP64); } - if (installOCX) { + if (flags.IsSet(InstallFlags.ACTIVEX)) { form.UpdateProgressLabel("Installing 64-bit Flash Player for Internet Explorer...", true); ExtractArchive("flash_ocx_64.zip", flash64Path); registryToApply.Add(Properties.Resources.installOCX64); @@ -89,7 +119,7 @@ namespace CleanFlashInstaller { form.UpdateProgressLabel("Applying registry changes...", true); RegistryManager.ApplyRegistry(registryToApply); - if (installOCX) { + if (flags.IsSet(InstallFlags.ACTIVEX)) { form.UpdateProgressLabel("Activating 32-bit Flash Player for Internet Explorer...", true); RegisterActiveX(Path.Combine(flash32Path, string.Format("Flash_{0}.ocx", SystemInfo.GetVersionPath()))); diff --git a/CleanFlashUninstaller/CleanFlashUninstaller.csproj b/CleanFlashUninstaller/CleanFlashUninstaller.csproj index a752d83..298469d 100644 --- a/CleanFlashUninstaller/CleanFlashUninstaller.csproj +++ b/CleanFlashUninstaller/CleanFlashUninstaller.csproj @@ -36,7 +36,7 @@ 4 - icon.ico + ..\CleanFlashCommon\icon.ico app.manifest