diff --git a/Rectify11Installer/Core/Backend/Icons.cs b/Rectify11Installer/Core/Backend/Icons.cs index e33430c25..9a4eb73e1 100644 --- a/Rectify11Installer/Core/Backend/Icons.cs +++ b/Rectify11Installer/Core/Backend/Icons.cs @@ -385,105 +385,24 @@ private static bool Patch(string file, PatchesPatch patch, PatchType type) /// Xml element containing all the info private static bool MatchAndApplyRule(PatchesPatch patch) { - string newhardlink; - if (patch.HardlinkTarget.Contains("%sys32%")) + string newhardlink = Helper.FixString(patch.HardlinkTarget, false); + if (newhardlink.Contains(".mui")) { - newhardlink = patch.HardlinkTarget.Replace(@"%sys32%", Variables.sys32Folder); - if (!Patch(newhardlink, patch, PatchType.General)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("%lang%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%lang%", Path.Combine(Variables.sys32Folder, CultureInfo.CurrentUICulture.Name)); - if (!Patch(newhardlink, patch, PatchType.Mui)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("%en-US%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%en-US%", Path.Combine(Variables.sys32Folder, "en-US")); - if (!Patch(newhardlink, patch, PatchType.Mui)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("%windirLang%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%windirLang%", Path.Combine(Variables.Windir, CultureInfo.CurrentUICulture.Name)); - if (!Patch(newhardlink, patch, PatchType.Mui)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("%windirEn-US%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%windirEn-US%", Path.Combine(Variables.Windir, "en-US")); - if (!Patch(newhardlink, patch, PatchType.Mui)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("mun")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%sysresdir%", Variables.sysresdir); - if (!Patch(newhardlink, patch, PatchType.General)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("%branding%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%branding%", Variables.BrandingFolder); - if (!Patch(newhardlink, patch, PatchType.General)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("%prog%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%prog%", Variables.progfiles); - if (!Patch(newhardlink, patch, PatchType.General)) - { - return false; - } + if (!Patch(newhardlink, patch, PatchType.Mui)) return false; } else if (patch.HardlinkTarget.Contains("%diag%")) { - newhardlink = patch.HardlinkTarget.Replace(@"%diag%", Variables.diag); - if (!Patch(newhardlink, patch, PatchType.Troubleshooter)) - { - return false; - } + if (!Patch(newhardlink, patch, PatchType.Troubleshooter)) return false; } - else if (patch.HardlinkTarget.Contains("%windir%")) + else { - newhardlink = patch.HardlinkTarget.Replace(@"%windir%", Variables.Windir); - if (!Patch(newhardlink, patch, PatchType.General)) - { - return false; - } + if (!Patch(newhardlink, patch, PatchType.General)) return false; } + if (!string.IsNullOrWhiteSpace(patch.x86)) { - if (patch.HardlinkTarget.Contains("%sys32%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%sys32%", Variables.sysWOWFolder); - if (!Patch(newhardlink, patch, PatchType.x86)) - { - return false; - } - } - else if (patch.HardlinkTarget.Contains("%prog%")) - { - newhardlink = patch.HardlinkTarget.Replace(@"%prog%", Variables.progfiles86); - if (!Patch(newhardlink, patch, PatchType.x86)) - { - return false; - } - } + newhardlink = Helper.FixString(patch.HardlinkTarget, true); + if (!Patch(newhardlink, patch, PatchType.x86)) return false; } return true; } diff --git a/Rectify11Installer/Core/Helpers.cs b/Rectify11Installer/Core/Helpers.cs index 2c429aead..2d68f6751 100644 --- a/Rectify11Installer/Core/Helpers.cs +++ b/Rectify11Installer/Core/Helpers.cs @@ -114,6 +114,7 @@ public static bool CheckIfUpdate() return false; } } + public static void UpdateSideImageOptns(string name, FrmWizard _frmWizard) { switch (name) @@ -152,7 +153,7 @@ public static void UpdateSideImageOptns(string name, FrmWizard _frmWizard) public static string FixString(string path, bool x86) { - if (path.Contains("mun")) + if (path.Contains(".mun")) { return path.Replace(@"%sysresdir%", Variables.sysresdir); } @@ -209,7 +210,6 @@ public static string FixString(string path, bool x86) return path; } - #endregion #region Private Methods private static bool RebootRequired() diff --git a/Rectify11Installer/Pages/InstallOptnsPage.cs b/Rectify11Installer/Pages/InstallOptnsPage.cs index 384c2e30f..efb025377 100644 --- a/Rectify11Installer/Pages/InstallOptnsPage.cs +++ b/Rectify11Installer/Pages/InstallOptnsPage.cs @@ -99,7 +99,7 @@ private static void UpdateListView(PatchesPatch[] patch, TreeNode basicNode, Tre var newpath = Helper.FixString(patch[i].HardlinkTarget, !string.IsNullOrWhiteSpace(patch[i].x86)); if (File.Exists(newpath)) { - if (newpath.Contains("mun")) basicNode.Nodes.Add(patch[i].Mui); + if (newpath.Contains(".mun")) basicNode.Nodes.Add(patch[i].Mui); else advNode.Nodes.Add(patch[i].Mui); } } diff --git a/Rectify11Installer/Pages/UninstallPage.cs b/Rectify11Installer/Pages/UninstallPage.cs index 9b885811b..add31ac41 100644 --- a/Rectify11Installer/Pages/UninstallPage.cs +++ b/Rectify11Installer/Pages/UninstallPage.cs @@ -99,7 +99,7 @@ private static void UpdateListView(PatchesPatch[] patch, TreeNode basicNode, Tre var newpath = Helper.FixString(patch[i].HardlinkTarget, !string.IsNullOrWhiteSpace(patch[i].x86)); if (File.Exists(newpath)) { - if (newpath.Contains("mun")) basicNode.Nodes.Add(patch[i].Mui); + if (newpath.Contains(".mun")) basicNode.Nodes.Add(patch[i].Mui); else advNode.Nodes.Add(patch[i].Mui); } }