SETLOCAL
cd /d %DPATH%

for /f "delims=" %%a in ('type BWP_DL_input.txt') do @set BWD=%%a

:: correct wrongly extracted files
%IF% "%BWD%\GharethNPC.exe" (
	MD "GharethNPC\2da"
	MD "GharethNPC\Audio"
	MD "GharethNPC\Backup"
	MD "GharethNPC\CRE"
	MD "GharethNPC\d"
	MD "GharethNPC\english"
	MD "GharethNPC\epilogue"
	MD "GharethNPC\portraits"
	MD "GharethNPC\scripts"
	Move GharethNPC\fwghand1.2DA GharethNPC\2da"
	Move GharethNPC\*.ogg GharethNPC\Audio"
	Move GharethNPC\oggdec.exe GharethNPC\Audio"
	Move GharethNPC\keep-me GharethNPC\Backup"
	Move GharethNPC\*.cre GharethNPC\CRE"
	Move GharethNPC\*.d GharethNPC\d"
	Move GharethNPC\*.bmp GharethNPC\portraits"
	Move GharethNPC\*.baf GharethNPC\scripts"
	Move "GharethNPC\Setup-Ghareth.* "."
	%W5%
	ren GharethNPC Ghareth
)

%IF% "%BWD%\TurnaboutV1.exe" (
	MD "TurnaboutV1\2da"
	MD "TurnaboutV1\backup"
	MD "TurnaboutV1\baf"
	MD "TurnaboutV1\baf-extend"
	MD "TurnaboutV1\balthazar"
	MD "TurnaboutV1\copy"
	MD "TurnaboutV1\dialog"
	MD "TurnaboutV1\dialogsep"
	MD "TurnaboutV1\portrait"
	MD "TurnaboutV1\scripts"
	MD "TurnaboutV1\wavs"
	Move TurnaboutV1\*.2DA TurnaboutV1\2da"
	Move TurnaboutV1\keepme TurnaboutV1\backup"
	Move TurnaboutV1\ar6200.baf TurnaboutV1\baf-extend"
	Move TurnaboutV1\yoshimox.baf TurnaboutV1\baf-extend"
	Move TurnaboutV1\*.baf TurnaboutV1\baf"
	Move TurnaboutV1\BALTHAZS.bmp TurnaboutV1\balthazar"
	Move TurnaboutV1\NBALTHAL.bmp TurnaboutV1\balthazar"
	Move TurnaboutV1\*.cre TurnaboutV1\copy"
	Move TurnaboutV1\*.spl TurnaboutV1\copy"
	Move TurnaboutV1\*.itm TurnaboutV1\copy"
	Move TurnaboutV1\1.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\2.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\3.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\4.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\5.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\6.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\7.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\7b.d TurnaboutV1\dialogsep"
	Move TurnaboutV1\*.d TurnaboutV1\dialog"
	Move TurnaboutV1\*.bmp TurnaboutV1\portrait"
	Move TurnaboutV1\*.bcs TurnaboutV1\scripts"
	Move TurnaboutV1\*.ogg TurnaboutV1\wavs"
	Move "TurnaboutV1\setup-turnabout.* "."
	%W5%
	ren TurnaboutV1 turnabout
)

:: correct wrongly packed files
:: because of a bug in Windows (who is surprised?) the subfolder must be removed separately otherwise all files and folders may randomly vanish or not.
%IF% "7C-Yoshi-master" (
	Move ".\7C-Yoshi-master\7C-Yoshi" "."
	RD /S /Q ".\7C-Yoshi-master"
)
%IF% "A4Auror" (
	Move ".\A4Auror\Setup-A4Auror.exe" "."
)
%IF% "AC_QUEST-master" (
	Move ".\AC_QUEST-master\setup-*" "."
	Move ".\AC_QUEST-master\AC_QUEST" "."
	RD /S /Q ".\AC_QUEST-master"
)
%IF% "ACBre-master" (
	Move ".\ACBre-master\Setup-*" "."
	Move ".\ACBre-master\ACBre" "."
	RD /S /Q ".\ACBre-master"
)
%IF% "Aran-Whitehand-Beta_Luridel" %IFN% "Aran-Whitehand-master" (
	Move ".\Aran-Whitehand-Beta_Luridel\setup-*" "."
	Move ".\Aran-Whitehand-Beta_Luridel\aranw" "."
	RD /S /Q ".\Aran-Whitehand-Beta_Luridel"
)
%IF% "Aran-Whitehand-master" (
	Move ".\Aran-Whitehand-master\setup-*" "."
	Move ".\Aran-Whitehand-master\aranw" "."
	RD /S /Q ".\Aran-Whitehand-master"
)
%IF% "Auroras-Shoes-and-Boots-5.2.1" (
	Move ".\Auroras-Shoes-and-Boots-5.2.1\Setup-*" "."
	Move ".\Auroras-Shoes-and-Boots-5.2.1\aurora" "."
	RD /S /Q ".\Auroras-Shoes-and-Boots-5.2.1"
)
%IF% "bg1ub-14.0_beta_150228a" (
	Move ".\bg1ub-14.0_beta_150228a\setup-*" "."
	Move ".\bg1ub-14.0_beta_150228a\bg1ub" "."
	RD /S /Q ".\bg1ub-14.0_beta_150228a"
)
%IF% "BGT-WeiDU-master" (
	Move ".\BGT-WeiDU-master\setup-*" "."
	Move ".\BGT-WeiDU-master\bgt" "."
	Move ".\BGT-WeiDU-master\BGTReadme.htm" "."
	RD /S /Q ".\BGT-WeiDU-master"
)
%IF% "Club Of Pain V1.5" (
	Move ".\Club Of Pain V1.5\*.*" "."
	Move ".\Club Of Pain V1.5\ClubOfPain" "."
	RD /S /Q ".\Club Of Pain V1.5"
)
%IF% "CoranEE-master" (
	Move ".\CoranEE-master\setup-*" "."
	Move ".\CoranEE-master\Coran" "."
	RD /S /Q ".\CoranEE-master"
)
%IF% "CritterParts-1.1" (
	Move ".\CritterParts-1.1\*.*" "."
	Move ".\CritterParts-1.1\CritterParts" "."
	RD /S /Q ".\CritterParts-1.1"
)
%IF% "CtBv1.13a" (
	Move ".\CtBv1.13a\CtBv1.13\*.*" "."
	Move ".\CtBv1.13a\CtBv1.13\CtB" "."
	Move ".\CtBv1.13a\CtBv1.13\CtB_FF" "."
	RD /S /Q ".\CtBv1.13a\CtBv1.13"
	RD /S /Q ".\CtBv1.13a"
)
%IF% "D0Tweak-24beta" (
	Move ".\D0Tweak-24beta\setup-d0tweak.exe" "."
	Move ".\D0Tweak-24beta\d0Tweak" "."
	RD /S /Q ".\D0Tweak-24beta"
)
%IF% "Diff_Tweak" (
	Move ".\Diff_Tweak\*.*" "."
	Move ".\Diff_Tweak\DiffTweak" "."
	RD /S /Q ".\Diff_Tweak"
)
%IF% "Ardanis-divine_remix-2f5752e" (
	Move ".\Ardanis-divine_remix-2f5752e\divine_remix" "."
	RD /S /Q ".\Ardanis-divine_remix-2f5752e"
)
%IF% "Divine_Remix-master" (
	Move ".\Divine_Remix-master\divine_remix" "."
	RD /S /Q ".\Divine_Remix-master"
)
%IF% "DSotSC-master" (
	Move ".\DSotSC-master\DSotSC" "."
	Move ".\DSotSC-master\setup-DSotSC.exe" "."
	RD /S /Q ".\DSotSC-master"
)
%IF% "DungeonCrawl-master" (
	Move ".\DungeonCrawl-master\DC" "."
	Move ".\DungeonCrawl-master\setup-DC.exe" "."
	RD /S /Q ".\DungeonCrawl-master"
)
%IF% "EET_Tweaks-latest" (
	Move ".\EET_Tweaks-latest\setup-*" "."
	Move ".\EET_Tweaks-latest\EET_Tweaks" "."
	RD /S /Q ".\EET_Tweaks-latest"
)
%IF% "FishingForTrouble-3.2.1" (
	Move ".\FishingForTrouble-3.2.1\Setup-*" "."
	Move ".\FishingForTrouble-3.2.1\FishingForTrouble" "."
	RD /S /Q ".\FishingForTrouble-3.2.1"
)
%IF% "ggib_tweaks-master" (
	Move ".\ggib_tweaks-master\ggib_tweaks" "."
	RD /S /Q ".\ggib_tweaks-master"
)
%IF% "hiddenadventure-master" (
	Move ".\hiddenadventure-master\hiddenadventure" "."
	Move ".\hiddenadventure-master\setup-hiddenadventure.exe" "."
	RD /S /Q ".\hiddenadventure-master"
)
%IF% Imoen-v1202Full %IFN% "Imoen Romance - v3.3" (
	Move ".\Imoen-v1202Full\*.*" "."
	Move ".\Imoen-v1202Full\ImoenRom" "."
	RD /S /Q ".\Imoen-v1202Full"
)
%IF% "Imoen Romance - v3.3" (
	Move ".\Imoen Romance - v3.3\*.*" "."
	Move ".\Imoen Romance - v3.3\imoenRomance" "."
	RD /S /Q ".\Imoen Romance - v3.3"
)
%IF% "InifKit" (
	Move ".\InifKit\*.*" "."
	Move ".\InifKit\IK" "."
	RD /S /Q ".\InifKit"
)
%IF% "Keenmarker" (
	Move ".\Keenmarker\*.*" "."
	Move ".\Keenmarker\portraits" "."
	Move ".\Keenmarker\Storm" "."
	RD /S /Q ".\Keenmarker"
)
%IF% "King_Dutka's_Thief v1.1" (
	Move ".\King_Dutka's_Thief v1.1\*.*" "."
	Move ".\King_Dutka's_Thief v1.1\King_Dutka's_Thief" "."
	RD /S /Q ".\King_Dutka's_Thief v1.1"
)
%IF% "Might_and_Guile-master" (
	Move ".\Might_and_Guile-master\Setup-*" "."
	Move ".\Might_and_Guile-master\might_and_guile" "."
	RD /S /Q ".\Might_and_Guile-master"
)
%IF% "NPC_EE-master" (
	Move ".\NPC_EE-master\Setup-*" "."
	Move ".\NPC_EE-master\npc_ee" "."
	RD /S /Q ".\NPC_EE-master"
)
%IF% "NTotSC-2.2.2" (
	Move ".\NTotSC-2.2.2\Setup-*" "."
	Move ".\NTotSC-2.2.2\NTotSC" "."
	RD /S /Q ".\NTotSC-2.2.2"
)
%IF% "Paladins_of_Faerun_Kitpack_V4" (
	Move ".\Paladins_of_Faerun_Kitpack_V4\Setup-*" "."
	Move ".\Paladins_of_Faerun_Kitpack_V4\PofKits" "."
	RD /S /Q ".\Paladins_of_Faerun_Kitpack_V4"
)
%IF% "refinements-master" (
	Move ".\refinements-master\setup-refinements.exe" "."
	Move ".\refinements-master\refinements" "."
	RD /S /Q ".\refinements-master"
)
%IFN% "refinements-master" %IF% "refinements-*" (
	PUSHD "refinements-*"
	Move /y "*.*" ".."
	Move /y "refinements" ".."
	POPD
	for /d %%i in (".\refinements-*") do RD /S /Q %%i
)
%IF% "RotB Armor Set v1.0" (
	Move ".\RotB Armor Set v1.0\*.*" "."
	Move ".\RotB Armor Set v1.0\RotBArmorSet" "."
	RD /S /Q ".\RotB Armor Set v1.0"
)
%IF% SETUP-ROTBARMORSET.DEBUG del SETUP-ROTBARMORSET.DEBUG
%IF% "RoTerror-EE-master" (
	Move ".\RoTerror-EE-master\Setup-RoTerror.exe" "."
	Move ".\RoTerror-EE-master\RoTerror" "."
	RD /S /Q ".\RoTerror-EE-master"
)
%IF% "%BWD%\1309492052_rukrakiav.08.7z" %IFN% Setup-rukrakia.exe call ".\%BWIPS%\rukrakia.vbs"
%W5%
%IF% "rukrakia_v.08" (
	Move ".\rukrakia_v.08\*.*" "."
	Move ".\rukrakia_v.08\rukrakia" "."
	RD /S /Q ".\rukrakia_v.08
)
%IF% "SandrahItm-master" (
	Move ".\SandrahItm-master\Setup-*" "."
	Move ".\SandrahItm-master\SandrahItm" "."
	RD /S /Q ".\SandrahItm-master"
)
%IF% "SandrahNPC-master" (
	Move ".\SandrahNPC-master\Setup-*" "."
	Move ".\SandrahNPC-master\SandrahNPC" "."
	RD /S /Q ".\SandrahNPC-master"
)
%IF% "SandrahRTF-master" (
	Move ".\SandrahRtF-master\Setup-*" "."
	Move ".\SandrahRtF-master\SandrahRTF" "."
	RD /S /Q ".\SandrahRTF-master"
)
%IF% "SandrahToT-master" (
	Move ".\SandrahToT-master\SandrahToT-Setup*" "."
	Move ".\SandrahToT-master\SandrahToT" "."
	RD /S /Q ".\SandrahToT-master"
)
%IF% "Scales_of_Balance-master" (
	Move ".\Scales_of_Balance-master\Setup-*" "."
	Move ".\Scales_of_Balance-master\scales_of_balance" "."
	RD /S /Q ".\Scales_of_Balance-master"
)
%IF% "ScionMod" (
	Move ".\ScionMod\ScionMod.exe" "."
	ren ScionMod.exe setup-ScionMod.exe
)
%IF% "Sellswords-master" (
	Move ".\Sellswords-master\Sellswords" "."
	Move ".\Sellswords-master\setup-Sellswords.exe" "."
	RD /S /Q ".\Sellswords-master"
)
%IF% "Sheena_v2.5" (
	Move ".\Sheena_v2.5\*.*" "."
	Move ".\Sheena_v2.5\Sheena" "."
	RD /S /Q ".\Sheena_v2.5
)
%IF% "stivan-master" (
	Move ".\stivan-master\stivan" "."
	RD /S /Q ".\stivan-master"
)
%IF% "StuffofTheMagi v4" (
	Move ".\StuffofTheMagi v4\*.*" "."
	Move ".\StuffofTheMagi v4\StuffofTheMagi" "."
	RD /S /Q ".\StuffofTheMagi v4"
)
%IF% "ToBR beta 4" (
	Move ".\ToBR beta 4\*.*" "."
	Move ".\ToBR beta 4\tobr" "."
	RD /S /Q ".\ToBR beta 4"
)
%IF% "ThrownHammers-master" (
	Move ".\ThrownHammers-master\*.*" "."
	Move ".\ThrownHammers-master\hammers" "."
	RD /S /Q ".\ThrownHammers-master"
)
%IF% "Tiax-master" (
	Move ".\Tiax-master\*.*" "."
	Move ".\Tiax-master\Tiax" "."
	RD /S /Q ".\Tiax-master"
)
%IF% "TowerOfDeception-4.0.1" (
	Move ".\TowerOfDeception-4.0.1\*.*" "."
	Move ".\TowerOfDeception-4.0.1\TOD" "."
	RD /S /Q ".\TowerOfDeception-4.0.1"
)
%IF% "Tweaks-Anthology-master" (
	Move ".\Tweaks-Anthology-master\package_mod.bat" "."
	Move ".\Tweaks-Anthology-master\cdtweaks" "."
	RD /S /Q ".\Tweaks-Anthology-master"
)
%IF% "uniqueartifacts_v1.12" (
	Move ".\uniqueartifacts_v1.12\*.*" "."
	Move ".\uniqueartifacts_v1.12\uniqueartifacts" "."
	RD /S /Q ".\uniqueartifacts_v1.12"
)
%IF% "bg2-uniqueartifacts-master" (
	Move ".\bg2-uniqueartifacts-master\uniqueartifacts" "."
	RD /S /Q ".\bg2-uniqueartifacts-master"
)

:: correct wrongly packed files with extended filenames
%IF% "*-Tweaks-Anthology-*" (
	PUSHD "*-Tweaks-Anthology-*"
	Move /y "cdtweaks" ".."
	POPD
	for /d %%i in (".\*-Tweaks-Anthology-*") do RD /S /Q %%i
)
%IF% "*-DjinniCompanion-*" (
	PUSHD "*-DjinniCompanion-*"
	Move /y "*.*" ".."
	Move /y "DjinniCompanion" ".."
	POPD
	for /d %%i in (".\*-DjinniCompanion-*") do RD /S /Q %%i
)
%IF% "*-SpellRevisions-*" (
	PUSHD "*-SpellRevisions-*"
	Move /y "spell_rev" ".."
	POPD
	for /d %%i in (".\*-SpellRevisions-*") do RD /S /Q %%i
)
%IF% "*-TowerOfDeception-*" (
	PUSHD "*-TowerOfDeception-*"
	Move /y "*.*" ".."
	Move /y "TOD" ".."
	POPD
	for /d %%i in (".\*-TowerOfDeception-*") do RD /S /Q %%i
)

:: Vecna text replacement
%IF% vecna %IF% "Vecna v23 - Text Overhaul v1.0" (
	copy /y ".\Vecna v23 - Text Overhaul v1.0\Language\English\*.*" ".\vecna\Language\English"
)

:: IR revision
%IF% item_rev %IF% IR_Revised-master (
	copy /y ".\IR_Revised-master\item_rev" ".\item_rev"
	RD /S /Q ".\IR_Revised-master"
)

:: IA add-ons
%IF% .\infinityanimations (
	%IF% .\frost_giant (
		move .\frost_giant\*.* .\infinityanimations\content
		RD /S /Q .\frost_giant
	)
	%IF% .\harpy (
		move .\harpy\*.* .\infinityanimations\content
		RD /S /Q .\harpy
		)
	%IF% .\shadow_large_murky (
		move .\shadow_large_murky\*.* .\infinityanimations\content
		RD /S /Q .\shadow_large_murky
	)
	%IF% .\shadow_small_murky (
		move .\shadow_small_murky\*.* .\infinityanimations\content
		RD /S /Q .\shadow_small_murky
	)
)

:: remove empty folders
for /D %%a in ("infinityanimations\content\*") do rd /q /s "%%a"

:: remove unnecessary OneNote files
%IF% NMTP (
	attrib "NMTP\*.*" -s -h -r /D /S
	For /R "NMTP" %%G IN (*.onetoc2) do del "%%G"
)

:: add missing setup-###.exe
%IF% Setup-Area_Patcher.tp2 copy /Y WeiDU.exe Setup-Area_Patcher.exe | %M%
%IF% setup-bgt.tp2 copy /Y WeiDU.exe setup-bgt.exe | %M%
%IF% cdtweaks\setup-cdtweaks.tp2 copy /Y WeiDU.exe setup-cdtweaks.exe | %M%
%IF% Setup-Cre_Patcher.tp2 copy /Y WeiDU.exe Setup-Cre_Patcher.exe | %M%
%IF% setup-crefixer.tp2 copy /Y WeiDU.exe setup-crefixer.exe | %M%
%IF% CtBcutImp\setup-CtBcutImp.tp2 copy /Y WeiDU.exe setup-CtBcutImp.exe | %M%
%IF% Setup-Item_Patcher.tp2 copy /Y WeiDU.exe Setup-Item_Patcher.exe | %M%
%IF% setup-lolfixer.tp2 copy /Y WeiDU.exe setup-lolfixer.exe | %M%
%IF% setup-tooltipfix.tp2 copy /Y WeiDU.exe setup-tooltipfix.exe | %M%
%IF% SETUP-NMT.tp2 copy /Y WeiDU.exe SETUP-NMT.exe | %M%
%IF% SETUP-NMR-HAPPY.tp2 copy /Y WeiDU.exe SETUP-NMR-HAPPY.exe | %M%
%IF% 7C-Yoshi\7C-Yoshi.tp2 copy /Y WeiDU.exe SETUP-7C-Yoshi.exe | %M%
%IF% aranw\setup-aranw.tp2 copy /Y WeiDU.exe setup-aranw.exe | %M%
%IF% cdtweaks\setup-cdtweaks.tp2 copy /Y WeiDU.exe setup-cdtweaks.exe | %M%
%IF% divine_remix\setup-divine_remix.tp2 copy /Y WeiDU.exe setup-divine_remix.exe | %M%
%IF% ggib_tweaks\ggib_tweaks.tp2 copy /Y WeiDU.exe setup-ggib_tweaks.exe | %M%
%IF% spell_rev\setup-spell_rev.tp2 copy /Y WeiDU.exe setup-spell_rev.exe | %M%
%IF% stivan\setup-stivan.tp2 copy /Y WeiDU.exe setup-stivan.exe | %M%
%IF% stratagems\setup-stratagems.tp2 copy /Y WeiDU.exe setup-stratagems.exe | %M%
%IF% tb#kits\tb#kits.tp2 copy /Y WeiDU.exe setup-tb#kits.exe | %M%
%IF% Setup-W_3kradziej.tp2 copy /Y WeiDU.exe Setup-W_3kradziej.exe | %M%
%IF% DjinniCompanion\setup-DjinniCompanion.tp2 %IFN% setup-DjinniCompanion.exe copy /Y WeiDU.exe setup-DjinniCompanion.exe | %M%
%IF% uniqueartifacts\uniqueartifacts.tp2 copy /Y WeiDU.exe setup-uniqueartifacts.exe | %M%
%IF% refinements\setup-refinements.tp2 copy /Y WeiDU.exe setup-refinements.exe | %M%

:: rename filenames otherwise these mods cannot be installed automatically by WeiDU or checked by List.bat
%IF% "1Sylm-setup.tp2" ren "1Sylm-setup.tp2" "setup-1Sylm.tp2" | %M%
%IF% "1Sylm-setup.exe" ren "1Sylm-setup.exe" "setup-1Sylm.exe" | %M%
%IF% "setup RGenie.tp2" ren "setup RGenie.tp2" "setup-RGenie.tp2" | %M%
%IF% "setup RGenie.exe" ren "setup RGenie.exe" "setup-RGenie.exe" | %M%
%IF% "Setup-BWL Contest.tp2" ren "Setup-BWL Contest.tp2" "Setup-BWL_Contest.tp2" | %M%
%IF% "Setup-BWL Contest.exe" ren "Setup-BWL Contest.exe" "Setup-BWL_Contest.exe" | %M%
%IF% "SandrahToT-setup.tp2" ren "SandrahToT-setup.tp2" "setup-SandrahToT.tp2" | %M%
%IF% "SandrahToT-setup.exe" ren "SandrahToT-setup.exe" "setup-SandrahToT.exe" | %M%

:: workaround to handle filenames with special charcters
%IF% setup-b!tweak.exe move .\b!tweak\setup-b!tweak.tp2 "." | %M%
%IF% setup-b!tweak.exe ren setup-b!tweak.exe setup-btweak.exe | %M%
%IF% setup-b!tweak.tp2 ren setup-b!tweak.tp2 setup-btweak.tp2 | %M%

%IF% setup-b!tweak_lite.exe move .\b!tweak_lite\setup-b!tweak_lite.tp2 "." | %M%
%IF% setup-b!tweak_lite.exe ren setup-b!tweak_lite.exe setup-btweak_lite.exe | %M%
%IF% setup-b!tweak_lite.tp2 ren setup-b!tweak_lite.tp2 setup-btweak_lite.tp2 | %M%

%IF% setup-LavaIt!.exe move .\LavaIt!\Setup-LavaIt!.tp2 "." | %M%
%IF% Setup-LavaIt!.exe ren Setup-LavaIt!.exe Setup-LavaIt.exe | %M%
%IF% Setup-LavaIt!.tp2 ren Setup-LavaIt!.tp2 Setup-LavaIt.tp2 | %M%

%IF% "Setup-R*deur.exe" ren "Setup-R*deur.exe" "Setup-Rodeur.exe" | %M%
%IF% "Setup-R*deur.tp2" ren "Setup-R*deur.tp2" "Setup-Rodeur.tp2" | %M%

%IF% "SetupP!Bhaal.exe" ren "SetupP!Bhaal.exe" "Setup-PBhaal.exe" | %M%
%IF% "SetupP!Bhaal.tp2" ren "SetupP!Bhaal.tp2" "Setup-PBhaal.tp2" | %M%

%IF% "Setup-Grimuars_v4.1.exe" ren "Setup-Grimuars_v4.1.exe" "Setup-Grimuars.exe" | %M%
%IF% "Setup-Grimuars_v4.1.tp2" ren "Setup-Grimuars_v4.1.tp2" "Setup-Grimuars.tp2" | %M%

%IF% "lyricsetup.exe" ren "lyricsetup.exe" "Setup-lyric.exe" | %M%
%IF% "lyricsetup.tp2" ren "lyricsetup.tp2" "Setup-lyric.tp2" | %M%

:: There may be no "%M%" in the following lines because otherwise "^&Sith" causes a syntax error.
%IF% Setup-Jedi^&Sith.exe ren Setup-Jedi^&Sith.exe Setup-Jedi_Sith.exe
%IF% Setup-Jedi^&Sith.tp2 ren Setup-Jedi^&Sith.tp2 Setup-Jedi_Sith.tp2

%IF% Setup-!BInfinitySounds.exe move .\!BInfinitySounds\Setup-!BInfinitySounds.tp2 "." | %M%
%IF% Setup-!BInfinitySounds.exe ren Setup-!BInfinitySounds.exe Setup-BInfinitySounds.exe | %M%
%IF% Setup-!BInfinitySounds.tp2 ren Setup-!BInfinitySounds.tp2 Setup-BInfinitySounds.tp2 | %M%
