From 8bb46337e1daed4a93958784faa0fcba44186c73 Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 21 Jun 2021 04:01:03 +0300 Subject: [PATCH] flash: Fix protected mode issues and invalid registry entires --- CleanFlashCommon/RegistryManager.cs | 3 ++- CleanFlashCommon/SystemInfo.cs | 3 ++- CleanFlashCommon/Uninstaller.cs | 2 +- CleanFlashInstaller/Installer.cs | 4 ++-- .../Properties/Resources.Designer.cs | 8 ++++---- CleanFlashInstaller/Properties/Resources.resx | 14 +++++++------- 6 files changed, 18 insertions(+), 16 deletions(-) diff --git a/CleanFlashCommon/RegistryManager.cs b/CleanFlashCommon/RegistryManager.cs index a2d3795..2b41ee5 100644 --- a/CleanFlashCommon/RegistryManager.cs +++ b/CleanFlashCommon/RegistryManager.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.IO; +using System.Text; namespace CleanFlashCommon { public class RegistryManager { @@ -9,7 +10,7 @@ namespace CleanFlashCommon { registryContents = "Windows Registry Editor Version 5.00\n\n" + SystemInfo.FillString(registryContents); string filename = Path.GetTempFileName(); - File.WriteAllText(filename, registryContents); + File.WriteAllText(filename, registryContents, Encoding.Unicode); Directory.SetCurrentDirectory(Path.GetDirectoryName(filename)); diff --git a/CleanFlashCommon/SystemInfo.cs b/CleanFlashCommon/SystemInfo.cs index 9f56265..aec76bd 100644 --- a/CleanFlashCommon/SystemInfo.cs +++ b/CleanFlashCommon/SystemInfo.cs @@ -21,7 +21,8 @@ namespace CleanFlashCommon { { "${FLASH_64_PATH}", flash64Path.Replace(@"\", @"\\") }, { "${VERSION}", version }, { "${VERSION_PATH}", versionPath }, - { "${VERSION_COMMA}", versionComma } + { "${VERSION_COMMA}", versionComma }, + { "${ARCH}", Environment.Is64BitOperatingSystem ? "64" : "32" } }; public static string GetSystem32Path() { diff --git a/CleanFlashCommon/Uninstaller.cs b/CleanFlashCommon/Uninstaller.cs index 705d9a2..58f98f1 100644 --- a/CleanFlashCommon/Uninstaller.cs +++ b/CleanFlashCommon/Uninstaller.cs @@ -15,7 +15,7 @@ namespace CleanFlashCommon { "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" + "seamonkey", "palemoon", "k-meleon", "plugin-container" }; static Uninstaller() { diff --git a/CleanFlashInstaller/Installer.cs b/CleanFlashInstaller/Installer.cs index 1decb1a..e995b5e 100644 --- a/CleanFlashInstaller/Installer.cs +++ b/CleanFlashInstaller/Installer.cs @@ -121,11 +121,11 @@ namespace CleanFlashInstaller { 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()))); + RegisterActiveX(Path.Combine(flash32Path, string.Format("Flash32_{0}.ocx", SystemInfo.GetVersionPath()))); if (Environment.Is64BitOperatingSystem) { form.UpdateProgressLabel("Activating 64-bit Flash Player for Internet Explorer...", true); - RegisterActiveX(Path.Combine(flash64Path, string.Format("Flash_{0}.ocx", SystemInfo.GetVersionPath()))); + RegisterActiveX(Path.Combine(flash64Path, string.Format("Flash64_{0}.ocx", SystemInfo.GetVersionPath()))); } } } diff --git a/CleanFlashInstaller/Properties/Resources.Designer.cs b/CleanFlashInstaller/Properties/Resources.Designer.cs index 76f6e1b..23d3239 100644 --- a/CleanFlashInstaller/Properties/Resources.Designer.cs +++ b/CleanFlashInstaller/Properties/Resources.Designer.cs @@ -104,7 +104,7 @@ namespace CleanFlashInstaller.Properties { /// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPlugin] ///"isPartner"=dword:00000001 ///"Version"="${VERSION}" - ///"PlayerPath"="${FLASH_64_PATH}\\NPSWF_${VERSION_PATH}.dll" + ///"PlayerPath"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll" ///"UninstallerPath"=- ///"isScriptDebugger"=dword:00000000 ///"isESR"=dword:00000000 @@ -115,7 +115,7 @@ namespace CleanFlashInstaller.Properties { /// ///[HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@adobe.com/FlashPlayer] ///"Vendor"="Adobe" - ///"ProductName"="Adobe® Flash® Player ${VERSION} P [rest of string was truncated]";. + ///"ProductName"="Adobe® Flash® Player ${VER [rest of string was truncated]";. /// internal static string installNP { get { @@ -203,7 +203,7 @@ namespace CleanFlashInstaller.Properties { /// /// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepper] ///"UninstallerPath"=- - ///"PlayerPath"="${FLASH_64_PATH}\\pepflashplayer_${VERSION_PATH}.dll" + ///"PlayerPath"="${FLASH_64_PATH}\\pepflashplayer${ARCH}_${VERSION_PATH}.dll" ///"isScriptDebugger"=dword:00000000 ///"isESR"=dword:00000000 ///"isMSI"=dword:00000000 @@ -222,7 +222,7 @@ namespace CleanFlashInstaller.Properties { /// /// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepper] ///"UninstallerPath"=- - ///"PlayerPath"="${FLASH_32_PATH}\\pepflashplayer_${VERSION_PATH}.dll" + ///"PlayerPath"="${FLASH_32_PATH}\\pepflashplayer32_${VERSION_PATH}.dll" ///"isScriptDebugger"=dword:00000000 ///"isESR"=dword:00000000 ///"isMSI"=dword:00000000 diff --git a/CleanFlashInstaller/Properties/Resources.resx b/CleanFlashInstaller/Properties/Resources.resx index 2c3ef01..ff5e815 100644 --- a/CleanFlashInstaller/Properties/Resources.resx +++ b/CleanFlashInstaller/Properties/Resources.resx @@ -154,7 +154,7 @@ [HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPlugin] "isPartner"=dword:00000001 "Version"="${VERSION}" -"PlayerPath"="${FLASH_64_PATH}\\NPSWF_${VERSION_PATH}.dll" +"PlayerPath"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll" "UninstallerPath"=- "isScriptDebugger"=dword:00000000 "isESR"=dword:00000000 @@ -166,7 +166,7 @@ [HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@adobe.com/FlashPlayer] "Vendor"="Adobe" "ProductName"="Adobe® Flash® Player ${VERSION} Plugin" -"Path"="${FLASH_64_PATH}\\NPSWF_${VERSION_PATH}.dll" +"Path"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll" "Version"="${VERSION}" "Description"="Adobe® Flash® Player ${VERSION} Plugin" @@ -192,7 +192,7 @@ "Version"="${VERSION}" "XPTPath"="${FLASH_32_PATH}\\flashplayer.xpt" "Vendor"="Adobe" -"Path"="${FLASH_32_PATH}\\NPSWF_${VERSION_PATH}.dll" +"Path"="${FLASH_32_PATH}\\NPSWF32_${VERSION_PATH}.dll" [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerPlugin_${VERSION_PATH}.exe] "DisableExceptionChainValidation"=dword:00000000 @@ -234,7 +234,7 @@ [HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerActiveX] "Version"="${VERSION}" -"PlayerPath"="${FLASH_64_PATH}\\Flash_${VERSION_PATH}.ocx" +"PlayerPath"="${FLASH_64_PATH}\\Flash${ARCH}_${VERSION_PATH}.ocx" "UninstallerPath"=- "isScriptDebugger"=dword:00000000 "isMSI"=dword:00000000 @@ -284,7 +284,7 @@ "isESR"=dword:00000000 "isScriptDebugger"=dword:00000000 "UninstallerPath"=- -"PlayerPath"="${FLASH_32_PATH}\\Flash_${VERSION_PATH}.ocx" +"PlayerPath"="${FLASH_32_PATH}\\Flash32_${VERSION_PATH}.ocx" "Version"="${VERSION}" "isPartner"=dword:00000001 @@ -294,7 +294,7 @@ [HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepper] "UninstallerPath"=- -"PlayerPath"="${FLASH_64_PATH}\\pepflashplayer_${VERSION_PATH}.dll" +"PlayerPath"="${FLASH_64_PATH}\\pepflashplayer${ARCH}_${VERSION_PATH}.dll" "isScriptDebugger"=dword:00000000 "isESR"=dword:00000000 "isMSI"=dword:00000000 @@ -307,7 +307,7 @@ [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepper] "UninstallerPath"=- -"PlayerPath"="${FLASH_32_PATH}\\pepflashplayer_${VERSION_PATH}.dll" +"PlayerPath"="${FLASH_32_PATH}\\pepflashplayer32_${VERSION_PATH}.dll" "isScriptDebugger"=dword:00000000 "isESR"=dword:00000000 "isMSI"=dword:00000000