From 718a11622b19413a3cda95766c9f3ffe20bb054d Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sun, 26 Sep 2021 12:50:53 +0200 Subject: [PATCH] Make build scripts work with spaces in path, Fix Release build --- Patch104pZH/MAKE_Install.bat | 8 ++-- Patch104pZH/MAKE_Install_Run.bat | 6 +-- Patch104pZH/MAKE_Release.bat | 6 +-- Patch104pZH/MAKE_Uninstall.bat | 8 ++-- Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat | 42 ++++++++--------- Patch104pZH/Scripts/MAKE_Patch104pZH.bat | 52 ++++++++++----------- Patch104pZH/Scripts/SETUP_Folders.bat | 2 +- 7 files changed, 62 insertions(+), 62 deletions(-) diff --git a/Patch104pZH/MAKE_Install.bat b/Patch104pZH/MAKE_Install.bat index e31607969..77b66aacc 100644 --- a/Patch104pZH/MAKE_Install.bat +++ b/Patch104pZH/MAKE_Install.bat @@ -25,12 +25,12 @@ if '%errorlevel%' NEQ '0' ( :-------------------------------------- echo on -set ThisDir0=%~dp0 +set ThisDir0="%~dp0." set GeneratedReleaseUnpackedFiles= -call %ThisDir0%Scripts\MAKE_Patch104pZH.bat build -call %ThisDir0%Scripts\MAKE_Patch104pArtZH.bat build -call %ThisDir0%SETUP_UserSettings.bat +call %ThisDir0%\Scripts\MAKE_Patch104pZH.bat build +call %ThisDir0%\Scripts\MAKE_Patch104pArtZH.bat build +call %ThisDir0%\SETUP_UserSettings.bat :: Rename files as per setup in SETUP_UserSettings.bat for %%f in (%GameFilesToDisable%) do ( diff --git a/Patch104pZH/MAKE_Install_Run.bat b/Patch104pZH/MAKE_Install_Run.bat index c6af0d072..7cbe41fed 100644 --- a/Patch104pZH/MAKE_Install_Run.bat +++ b/Patch104pZH/MAKE_Install_Run.bat @@ -25,14 +25,14 @@ if '%errorlevel%' NEQ '0' ( :-------------------------------------- echo on -set ThisDir0=%~dp0 +set ThisDir0="%~dp0." :: Install -call %ThisDir0%MAKE_Install.bat +call %ThisDir0%\MAKE_Install.bat :: Run game set GameExeArgs0=%GameExeArgs:"=% %GameRootDir%\%GameExeFile% %GameExeArgs0% :: Uninstall -call %ThisDir0%MAKE_Uninstall.bat +call %ThisDir0%\MAKE_Uninstall.bat diff --git a/Patch104pZH/MAKE_Release.bat b/Patch104pZH/MAKE_Release.bat index f376b407f..5b8ba1fe6 100644 --- a/Patch104pZH/MAKE_Release.bat +++ b/Patch104pZH/MAKE_Release.bat @@ -1,6 +1,6 @@ -set ThisDir0=%~dp0 -call %ThisDir0%Scripts\MAKE_Patch104pZH.bat -call %ThisDir0%Scripts\MAKE_Patch104pArtZH.bat +set ThisDir0="%~dp0." +call %ThisDir0%\Scripts\MAKE_Patch104pZH.bat build +call %ThisDir0%\Scripts\MAKE_Patch104pArtZH.bat build :: Copy base release files xcopy /y /s %ReleaseUnpackedDir%\* %GeneratedReleaseUnpackedDir%\* diff --git a/Patch104pZH/MAKE_Uninstall.bat b/Patch104pZH/MAKE_Uninstall.bat index 84ef60e76..08426901f 100644 --- a/Patch104pZH/MAKE_Uninstall.bat +++ b/Patch104pZH/MAKE_Uninstall.bat @@ -25,12 +25,12 @@ if '%errorlevel%' NEQ '0' ( :-------------------------------------- echo on -set ThisDir0=%~dp0 +set ThisDir0="%~dp0." set GeneratedReleaseUnpackedFiles= -call %ThisDir0%Scripts\MAKE_Patch104pZH.bat -call %ThisDir0%Scripts\MAKE_Patch104pArtZH.bat -call %ThisDir0%SETUP_UserSettings.bat +call %ThisDir0%\Scripts\MAKE_Patch104pZH.bat +call %ThisDir0%\Scripts\MAKE_Patch104pArtZH.bat +call %ThisDir0%\SETUP_UserSettings.bat :: Remove release files from game for %%f in (%GeneratedReleaseUnpackedFiles%) do ( diff --git a/Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat b/Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat index 7b72aaf2b..962e9f531 100644 --- a/Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat +++ b/Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat @@ -1,29 +1,29 @@ echo on -set ThisDir1=%~dp0 -set ThisArg1=%1 -call %ThisDir1%SETUP_Folders.bat +set ThisDir1="%~dp0." +set ThisArg1=%~1 +call %ThisDir1%\SETUP_Folders.bat :: Define big file name(s) set BigName=600_Patch104pArtZH set GeneratedReleaseUnpackedFiles=%GeneratedReleaseUnpackedFiles% %BigName%.big if "%ThisArg1%"=="build" ( - :: Free folders of big file contents - del /s /f /q %GeneratedBigFilesUnpackedDir%\%BigName% - del /s /f /q %GeneratedBigFilesDir%\%BigName%.big - - :: Copy .big contents - :: Add optional non-essential art files here. - xcopy /y %GameFilesDir%\Art\W3D\NBPTower_DNS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\NBPTower_DS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\NBPTower_ENS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\NBPTower_ES.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\NBPTower_NS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\NBPTower_S.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - - :: Generate .big file(s) - %ToolsDir%\GeneralsBigCreator\GeneralsBigCreator.exe -source %GeneratedBigFilesUnpackedDir%\%BigName% -dest %GeneratedBigFilesDir%\%BigName%.big - - :: Generate Release file(s) - xcopy /y %GeneratedBigFilesDir%\%BigName%.big %GeneratedReleaseUnpackedDir%\%BigName%.big* + :: Free folders of big file contents + del /s /f /q %GeneratedBigFilesUnpackedDir%\%BigName% + del /s /f /q %GeneratedBigFilesDir%\%BigName%.big + + :: Copy .big contents + :: Add optional non-essential art files here. + xcopy /y %GameFilesDir%\Art\W3D\NBPTower_DNS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\NBPTower_DS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\NBPTower_ENS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\NBPTower_ES.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\NBPTower_NS.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\NBPTower_S.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + + :: Generate .big file(s) + %ToolsDir%\GeneralsBigCreator\GeneralsBigCreator.exe -source %GeneratedBigFilesUnpackedDir%\%BigName% -dest %GeneratedBigFilesDir%\%BigName%.big + + :: Generate Release file(s) + xcopy /y %GeneratedBigFilesDir%\%BigName%.big %GeneratedReleaseUnpackedDir%\%BigName%.big* ) diff --git a/Patch104pZH/Scripts/MAKE_Patch104pZH.bat b/Patch104pZH/Scripts/MAKE_Patch104pZH.bat index 935155bcd..e2d4ef7a0 100644 --- a/Patch104pZH/Scripts/MAKE_Patch104pZH.bat +++ b/Patch104pZH/Scripts/MAKE_Patch104pZH.bat @@ -1,34 +1,34 @@ echo on -set ThisDir1=%~dp0 -set ThisArg1=%1 -call %ThisDir1%SETUP_Folders.bat +set ThisDir1="%~dp0." +set ThisArg1=%~1 +call %ThisDir1%\SETUP_Folders.bat :: Define big file name(s) set BigName=600_Patch104pZH set GeneratedReleaseUnpackedFiles=%GeneratedReleaseUnpackedFiles% %BigName%.big if "%ThisArg1%"=="build" ( - :: Free folders of big file contents - del /s /f /q %GeneratedBigFilesUnpackedDir%\%BigName% - del /s /f /q %GeneratedBigFilesDir%\%BigName%.big - - :: Copy .big contents - :: All files listed here become part of the core of Patch104p and are meant - :: to be critical for client compatibility and essential for functionality. - :: Optional files should be moved into one of the other scripts. - xcopy /y /s %GameFilesDir%\*.ini %GeneratedBigFilesUnpackedDir%\%BigName%\ - xcopy /y /s %GameFilesDir%\*.wnd %GeneratedBigFilesUnpackedDir%\%BigName%\ - xcopy /y %GameFilesDir%\Art\Textures\exlaser3.dds %GeneratedBigFilesUnpackedDir%\%BigName%\Art\Textures\ - xcopy /y %GameFilesDir%\Art\W3D\ABSWGLink_L.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\AVAvnger.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\AVAvnger_D.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\EXCarptBmb2.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\NVLOutpost.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - xcopy /y %GameFilesDir%\Art\W3D\NVLOutpost_D.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ - - :: Generate .big file(s) - %ToolsDir%\GeneralsBigCreator\GeneralsBigCreator.exe -source %GeneratedBigFilesUnpackedDir%\%BigName% -dest %GeneratedBigFilesDir%\%BigName%.big - - :: Generate Release file(s) - xcopy /y %GeneratedBigFilesDir%\%BigName%.big %GeneratedReleaseUnpackedDir%\%BigName%.big* + :: Free folders of big file contents + del /s /f /q %GeneratedBigFilesUnpackedDir%\%BigName% + del /s /f /q %GeneratedBigFilesDir%\%BigName%.big + + :: Copy .big contents + :: All files listed here become part of the core of Patch104p and are meant + :: to be critical for client compatibility and essential for functionality. + :: Optional files should be moved into one of the other scripts. + xcopy /y /s %GameFilesDir%\*.ini %GeneratedBigFilesUnpackedDir%\%BigName%\ + xcopy /y /s %GameFilesDir%\*.wnd %GeneratedBigFilesUnpackedDir%\%BigName%\ + xcopy /y %GameFilesDir%\Art\Textures\exlaser3.dds %GeneratedBigFilesUnpackedDir%\%BigName%\Art\Textures\ + xcopy /y %GameFilesDir%\Art\W3D\ABSWGLink_L.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\AVAvnger.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\AVAvnger_D.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\EXCarptBmb2.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\NVLOutpost.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + xcopy /y %GameFilesDir%\Art\W3D\NVLOutpost_D.W3D %GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\ + + :: Generate .big file(s) + %ToolsDir%\GeneralsBigCreator\GeneralsBigCreator.exe -source %GeneratedBigFilesUnpackedDir%\%BigName% -dest %GeneratedBigFilesDir%\%BigName%.big + + :: Generate Release file(s) + xcopy /y %GeneratedBigFilesDir%\%BigName%.big %GeneratedReleaseUnpackedDir%\%BigName%.big* ) diff --git a/Patch104pZH/Scripts/SETUP_Folders.bat b/Patch104pZH/Scripts/SETUP_Folders.bat index 6041ad4a4..a7ebf83f9 100644 --- a/Patch104pZH/Scripts/SETUP_Folders.bat +++ b/Patch104pZH/Scripts/SETUP_Folders.bat @@ -1,5 +1,5 @@ :: Setup work folders -set ProjectDir=%~dp0.. +set ProjectDir="%~dp0.." set ToolsDir=%ProjectDir%\..\Tools set GameFilesDir=%ProjectDir%\GameFilesEdited set ReleaseUnpackedDir=%ProjectDir%\ReleaseUnpacked