cleanup: remove legacy Tweaked files and tidy support icon
This commit is contained in:
+42
-19
@@ -112,16 +112,16 @@ class WowSetupTool:
|
||||
"script_memory": "Sets WoW's AddOn Script Memory to 0 (unlimited). When disabled, the tool leaves your existing Config.wtf value unchanged.",
|
||||
"crossfaction_res": "Allows the client to attempt resurrection of released cross-faction players.",
|
||||
"custom_glues": "Enables custom GlueXML frames and XML on the login and character-selection screens.",
|
||||
"bluemoon": "Restores the rare blue moon visual effect that appears around 1 AM on some nights.",
|
||||
"bluemoon": "Restores the rare blue moon visual effect that appears around 1 AM on some nights. Installed as a patch inside WoW_Modernized.exe by vanilla-tweaks (no MPQ).",
|
||||
"clear_wdb": "Automatically clears the current WDB cache and prevents stale WDB data from rebuilding by placing an empty WDB blocker file in the game folder. Unchecking this option removes the blocker so WoW can create its WDB folder normally.",
|
||||
"darker_nights": "Installs Project Reforged Patch-N for darker, more atmospheric nights. Project Reforged recommends VanillaHelpers.",
|
||||
"pretty_night_sky": "Replaces the Vanilla night sky with a more detailed starry sky. Installed as patch-Z.mpq so the official numeric patch-9.mpq is never overwritten.",
|
||||
"epoch_water": "Replaces Vanilla water textures with the Epoch Water visual pack.",
|
||||
"fog_pushback": "Pushes environmental fog farther back for a clearer long-distance view. Works best together with an increased Farclip value.",
|
||||
"pink_herbs": "Turns most herb-node textures bright pink/purple to make gathering nodes easier to spot.",
|
||||
"no_error_sounds": "Installs the complete NoErrorSounds pack: muted spell fizzle sounds plus its included muted interface sounds.",
|
||||
"fish_ping": "Replaces the fishing bite sound with a much more noticeable ping. Designed specifically for WoW Vanilla 1.12.1.",
|
||||
"warlock_muted_demons": "Mutes the repeated voice lines from Warlock demons using Vanilla-compatible loose sound replacements."
|
||||
"darker_nights": "Installs Project Reforged Patch-N for darker, more atmospheric nights. Installed file: Data\\patch-N.mpq. Project Reforged recommends VanillaHelpers.",
|
||||
"pretty_night_sky": "Replaces the Vanilla night sky with a more detailed starry sky. Installed file: Data\\patch-Z.mpq. The original hosted patch-9 name is deliberately changed so the official numeric patch-9.mpq is never overwritten.",
|
||||
"epoch_water": "Replaces Vanilla water textures with the Epoch Water visual pack. Installed file: Data\\patch-W.mpq.",
|
||||
"fog_pushback": "Pushes environmental fog farther back for a clearer long-distance view. Installed file: Data\\patch-Y.mpq. Works best together with an increased Farclip value.",
|
||||
"pink_herbs": "Turns most herb-node textures bright pink/purple to make gathering nodes easier to spot. Installed file: Data\\patch-H.mpq.",
|
||||
"no_error_sounds": "Installs the complete NoErrorSounds pack: muted spell fizzle sounds plus its included muted interface sounds. Installed as loose WAV files under Sound\\Spells\\Fizzle and Sound\\interface (no MPQ).",
|
||||
"fish_ping": "Replaces the fishing bite sound with a much more noticeable ping. Installed file: Sound\\Spells\\Tradeskills\\FishBite.wav (no MPQ). Designed specifically for WoW Vanilla 1.12.1.",
|
||||
"warlock_muted_demons": "Mutes the repeated voice lines from Warlock demons using Vanilla-compatible loose sound replacements. Installed as loose WAV files under Data\\Sound\\Creature (no MPQ)."
|
||||
}
|
||||
|
||||
# Basic Setup Variables
|
||||
@@ -1005,18 +1005,40 @@ class WowSetupTool:
|
||||
messagebox.showerror("Installation Error", str(e))
|
||||
|
||||
def cleanup_legacy_outputs(self, target_dir):
|
||||
"""Remove executable names produced by older Modernization Tool builds."""
|
||||
"""Remove only known leftovers from older Modernization Tool builds."""
|
||||
modernized = os.path.join(target_dir, "WoW_Modernized.exe")
|
||||
if not os.path.exists(modernized):
|
||||
return
|
||||
|
||||
old_path = os.path.join(target_dir, "WoW_Tweaked.exe")
|
||||
if os.path.exists(old_path):
|
||||
# These names were generated by the old WoW_Tweaked.exe workflow and
|
||||
# are no longer used after switching to WoW_Modernized.exe.
|
||||
legacy_names = (
|
||||
"WoW_Tweaked.exe",
|
||||
"WoW_Tweaked.dxvk-cache",
|
||||
"WoW_Tweaked_d3d9.log",
|
||||
)
|
||||
for filename in legacy_names:
|
||||
path = os.path.join(target_dir, filename)
|
||||
if os.path.isfile(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except OSError:
|
||||
# Cleanup is best-effort and must not turn a successful
|
||||
# installation into an error because a stale log is locked.
|
||||
pass
|
||||
|
||||
# New shortcuts keep the icon in the tool's own support directory.
|
||||
# Remove the old root copy only after the replacement exists.
|
||||
managed_icon = os.path.join(
|
||||
target_dir,
|
||||
".modernization_tool",
|
||||
"PurpleWowLogo.ico",
|
||||
)
|
||||
root_icon = os.path.join(target_dir, "PurpleWowLogo.ico")
|
||||
if os.path.isfile(managed_icon) and os.path.isfile(root_icon):
|
||||
try:
|
||||
os.remove(old_path)
|
||||
os.remove(root_icon)
|
||||
except OSError:
|
||||
# A stale executable being locked should not make an otherwise
|
||||
# successful modernization fail.
|
||||
pass
|
||||
|
||||
def create_launcher_shortcut(self, target_dir):
|
||||
@@ -1024,18 +1046,19 @@ class WowSetupTool:
|
||||
shortcut_path = os.path.join(target_dir, "Play Modernized WoW.lnk")
|
||||
vanilla_fixes_exe = os.path.join(target_dir, "VanillaFixes.exe")
|
||||
|
||||
# Check for the icon in the setup tool's root directory
|
||||
# Keep support assets out of the game root.
|
||||
source_icon = os.path.join(get_base_path(), "PurpleWowLogo.ico")
|
||||
target_icon = os.path.join(target_dir, "PurpleWowLogo.ico")
|
||||
support_dir = os.path.join(target_dir, ".modernization_tool")
|
||||
target_icon = os.path.join(support_dir, "PurpleWowLogo.ico")
|
||||
icon_vbs_line = ""
|
||||
|
||||
# If the icon exists, copy it to the WoW folder and add it to the shortcut
|
||||
if os.path.exists(source_icon):
|
||||
try:
|
||||
os.makedirs(support_dir, exist_ok=True)
|
||||
shutil.copy2(source_icon, target_icon)
|
||||
icon_vbs_line = f'oLink.IconLocation = "{target_icon}, 0"'
|
||||
except Exception:
|
||||
pass # Fail silently on icon copy if there's a permission issue
|
||||
pass # The shortcut can still be created without a custom icon.
|
||||
|
||||
vbs_script = f"""
|
||||
Set oWS = WScript.CreateObject("WScript.Shell")
|
||||
|
||||
Reference in New Issue
Block a user