Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exclamation points in file names breaking the patcher #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Windows/WiiWarePatcher.bat
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@echo off
REM --- Important for file counter to work ---
setlocal ENABLEDELAYEDEXPANSION
rem ---

cd /d "%~dp0"
set currentPath=%cd%
goto begin
Expand Down Expand Up @@ -59,6 +57,12 @@ set /a errorwinxp=0
set /a updateserver=1
goto choose_patch_type

rem This is called to remove exclamation points from file names.
rem Exclamation points break the script when ENABLEDELAYEDEXPANSION is set for the file counter.
:RemoveExclamationPoints
set "filename=%~n1"
ren %1 "%filename:!=%%~x1"
goto :EOF

:begin_main
if %aio_assisted%==1 exit
Expand Down Expand Up @@ -790,6 +794,13 @@ if not exist temp md temp
if not exist wiimmfi-wads md wiimmfi-wads
if not exist backup-wads md backup-wads

rem Removes Exclamation Points for ENABLEDELAYEDEXPANSION
for %%r in ("*.wad") do call :RemoveExclamationPoints "%%r"

rem --- Important for file counter to work ---
setlocal ENABLEDELAYEDEXPANSION
rem ---

for %%f in ("*.wad") do (
cls
echo %header_loop%
Expand Down