diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e629986bf --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.* +!.gitignore diff --git a/CleanBuild.bat b/CleanBuild.bat new file mode 100644 index 000000000..400a72c85 --- /dev/null +++ b/CleanBuild.bat @@ -0,0 +1,4 @@ +set ThisDir=%~dp0. + +rd /s /q "%ThisDir%\Patch104pZH\.Build" +rd /s /q "%ThisDir%\Patch104pZH\.Release" diff --git a/Patch104pZH/.gitignore b/Patch104pZH/.gitignore deleted file mode 100644 index 98e11b94d..000000000 --- a/Patch104pZH/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.Generated -/.Release -SETUP_UserSettings.bat diff --git a/Patch104pZH/MAKE_Install.bat b/Patch104pZH/MAKE_Install.bat deleted file mode 100644 index 9a795c244..000000000 --- a/Patch104pZH/MAKE_Install.bat +++ /dev/null @@ -1,50 +0,0 @@ -@echo off -:: BatchGotAdmin -:------------------------------------- -:: --> Check for permissions ->nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" - -:: --> If error flag set, we do not have admin. -if '%errorlevel%' NEQ '0' ( - echo Requesting administrative privileges... - goto UACPrompt -) else ( goto gotAdmin ) - -:UACPrompt - echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" - set params = %*:"="" - echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" - - "%temp%\getadmin.vbs" - del "%temp%\getadmin.vbs" - exit /B - -:gotAdmin - pushd "%CD%" - CD /D "%~dp0" -:-------------------------------------- - -echo on - -setlocal - -set ThisDir0=%~dp0. -set GeneratedReleaseUnpackedFiles= - -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 ( - if exist "%GameRootDir:"=%\%%f" ( - ren "%GameRootDir:"=%\%%f" %%f.PATCH104P - ) -) - -:: Copy release files to game -for %%f in (%GeneratedReleaseUnpackedFiles%) do ( - xcopy /y "%GeneratedReleaseUnpackedDir%\%%f" "%GameRootDir:"=%\" -) - -endlocal diff --git a/Patch104pZH/MAKE_Install_Run.bat b/Patch104pZH/MAKE_Install_Run.bat deleted file mode 100644 index 030cee7a4..000000000 --- a/Patch104pZH/MAKE_Install_Run.bat +++ /dev/null @@ -1,43 +0,0 @@ -@echo off -:: BatchGotAdmin -:------------------------------------- -:: --> Check for permissions ->nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" - -:: --> If error flag set, we do not have admin. -if '%errorlevel%' NEQ '0' ( - echo Requesting administrative privileges... - goto UACPrompt -) else ( goto gotAdmin ) - -:UACPrompt - echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" - set params = %*:"="" - echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" - - "%temp%\getadmin.vbs" - del "%temp%\getadmin.vbs" - exit /B - -:gotAdmin - pushd "%CD%" - CD /D "%~dp0" -:-------------------------------------- - -echo on - -setlocal - -set ThisDir0=%~dp0. - -:: Install -call "%ThisDir0%\MAKE_Install.bat" - -:: Run game -call "%ThisDir0%\SETUP_UserSettings.bat" -"%GameRootDir:"=%\%GameExeFile:"=%" %GameExeArgs:"=% - -:: Uninstall -call "%ThisDir0%\MAKE_Uninstall.bat" - -endlocal diff --git a/Patch104pZH/MAKE_Release.bat b/Patch104pZH/MAKE_Release.bat deleted file mode 100644 index 694ef90fb..000000000 --- a/Patch104pZH/MAKE_Release.bat +++ /dev/null @@ -1,16 +0,0 @@ -setlocal - -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%\*" - -:: Define archive name(s) -set ArchiveName=Patch104pZH - -:: Generate Archive(s) -tar.exe -a -c -C "%GeneratedReleaseUnpackedDir%" -f "%ReleaseDir%\%ArchiveName%.zip" *.* - -endlocal diff --git a/Patch104pZH/MAKE_Uninstall.bat b/Patch104pZH/MAKE_Uninstall.bat deleted file mode 100644 index e3fea0ae2..000000000 --- a/Patch104pZH/MAKE_Uninstall.bat +++ /dev/null @@ -1,50 +0,0 @@ -@echo off -:: BatchGotAdmin -:------------------------------------- -:: --> Check for permissions ->nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" - -:: --> If error flag set, we do not have admin. -if '%errorlevel%' NEQ '0' ( - echo Requesting administrative privileges... - goto UACPrompt -) else ( goto gotAdmin ) - -:UACPrompt - echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" - set params = %*:"="" - echo UAC.ShellExecute "cmd.exe", "/c %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" - - "%temp%\getadmin.vbs" - del "%temp%\getadmin.vbs" - exit /B - -:gotAdmin - pushd "%CD%" - CD /D "%~dp0" -:-------------------------------------- - -setlocal - -echo on - -set ThisDir0=%~dp0. -set GeneratedReleaseUnpackedFiles= - -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 ( - del /f /q "%GameRootDir:"=%\%%f" -) - -:: Restore files as per setup in SETUP_UserSettings.bat -for %%f in (%GameFilesToDisable%) do ( - if exist "%GameRootDir:"=%\%%f.PATCH104P" ( - ren "%GameRootDir:"=%\%%f.PATCH104P" %%f - ) -) - -endlocal diff --git a/Patch104pZH/ModBundleItems.json b/Patch104pZH/ModBundleItems.json new file mode 100644 index 000000000..81dfa8500 --- /dev/null +++ b/Patch104pZH/ModBundleItems.json @@ -0,0 +1,387 @@ +{ + "bundles": { + "version": 1, + "itemsPrefix": "600_GamePatch", + "itemsSuffix": "", + "items": [ + { + "name": "CoreArt", + "big": true, + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Art/Textures/exlaser3.dds", + "Art/Textures/gxmammoth_co.tga", + "Art/Textures/gxmammothalt_HI.tga", + "Art/W3D/ABSWGLink_L.W3D", + "Art/W3D/AVAvnger.W3D", + "Art/W3D/AVAvnger_D.W3D", + "Art/W3D/EXCarptBmb2.W3D", + "Art/W3D/NVLOutpost.W3D", + "Art/W3D/NVLOutpost_D.W3D", + "Art/W3D/UIWRKR_CLMUP.W3D" + ] + }, + { + "parent": "GameFilesEdited", + "sourceList": [ + "Art/W3D/ABSWGLink_L.W3D", + "Art/W3D/AVAvnger.W3D", + "Art/W3D/AVAvnger_D.W3D", + "Art/W3D/EXCarptBmb2.W3D", + "Art/W3D/NVLOutpost.W3D", + "Art/W3D/NVLOutpost_D.W3D", + "Art/W3D/UIWRKR_CLMUP.W3D" + ] + } + ] + }, + { + "name": "CoreAudio", + "big": true, + "files": [] + }, + { + "name": "CoreINI", + "big": true, + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/INI/Default/*.ini", + "Data/INI/Object/*.ini", + "Data/INI/*.ini" + ] + } + ] + }, + { + "name": "CoreMaps", + "big": true, + "files": [] + }, + { + "name": "CoreWindow", + "big": true, + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Window/Menus/*.wnd", + "Window/*.wnd" + ] + } + ] + }, + { + "name": "OptionalArt", + "big": true, + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Art/W3D/NBPTower_DNS.W3D", + "Art/W3D/NBPTower_DS.W3D", + "Art/W3D/NBPTower_ENS.W3D", + "Art/W3D/NBPTower_ES.W3D", + "Art/W3D/NBPTower_NS.W3D", + "Art/W3D/NBPTower_S.W3D" + ] + } + ] + }, + { + "name": "LanguageArabic", + "big": true, + "setGameLanguageOnInstall": "Arabic", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Arabic/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Arabic" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Arabic/generals.csf" + } + ] + } + ] + }, + { + "name": "LanguageBrazilian", + "big": true, + "setGameLanguageOnInstall": "Brazilian", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Brazilian/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Brazilian" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Brazilian/generals.csf" + } + ] + } + ] + }, + { + "name": "LanguageChinese", + "big": true, + "setGameLanguageOnInstall": "Chinese", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Chinese/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Chinese" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Chinese/generals.csf" + }, + { + "source": "Data/Autorun.str", + "target": "Data/Chinese/Autorun.csf" + } + ] + } + ] + }, + { + "name": "LanguageEnglish", + "big": true, + "setGameLanguageOnInstall": "English", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/English/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "English" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/English/generals.csf" + } + ] + } + ] + }, + { + "name": "LanguageFrench", + "big": true, + "setGameLanguageOnInstall": "French", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/French/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "French" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/French/generals.csf" + }, + { + "source": "Data/Autorun.str", + "target": "Data/French/Autorun.csf" + } + ] + } + ] + }, + { + "name": "LanguageGerman", + "big": true, + "setGameLanguageOnInstall": "German", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/German/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "German" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/German/generals.csf" + }, + { + "source": "Data/Autorun.str", + "target": "Data/German/Autorun.csf" + } + ] + } + ] + }, + { + "name": "LanguageItalian", + "big": true, + "setGameLanguageOnInstall": "Italian", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Italian/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Italian" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Italian/generals.csf" + } + ] + } + ] + }, + { + "name": "LanguageKorean", + "big": true, + "setGameLanguageOnInstall": "Korean", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Korean/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Korean" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Korean/generals.csf" + }, + { + "source": "Data/Autorun.str", + "target": "Data/Korean/Autorun.csf" + } + ] + } + ] + }, + { + "name": "LanguagePolish", + "big": true, + "setGameLanguageOnInstall": "Polish", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Polish/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Polish" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Polish/generals.csf" + } + ] + } + ] + }, + { + "name": "LanguageRussian", + "big": true, + "setGameLanguageOnInstall": "Russian", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Russian/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Russian" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Russian/generals.csf" + } + ] + } + ] + }, + { + "name": "LanguageSpanish", + "big": true, + "setGameLanguageOnInstall": "Spanish", + "files": [ + { + "parent": "GameFilesEdited", + "sourceList": [ + "Data/Spanish/*.ini" + ] + }, + { + "parent": "GameFilesEdited", + "params": { + "language": "Spanish" + }, + "sourceTargetList": [ + { + "source": "Data/generals.str", + "target": "Data/Spanish/generals.csf" + } + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/Patch104pZH/ModBundlePacks.json b/Patch104pZH/ModBundlePacks.json new file mode 100644 index 000000000..7ab1cbcb3 --- /dev/null +++ b/Patch104pZH/ModBundlePacks.json @@ -0,0 +1,142 @@ +{ + "bundles": { + "version": 1, + "packsPrefix": "GamePatch", + "packsSuffix": "_v0.0", + "packs": [ + { + "name": "FullArabic", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageArabic", + "OptionalArt" + ] + }, + { + "name": "FullBrazilian", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageBrazilian", + "OptionalArt" + ] + }, + { + "name": "FullChinese", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageChinese", + "OptionalArt" + ] + }, + { + "install": true, + "name": "FullEnglish", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageEnglish", + "OptionalArt" + ] + }, + { + "name": "FullFrench", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageFrench", + "OptionalArt" + ] + }, + { + "name": "FullGerman", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageGerman", + "OptionalArt" + ] + }, + { + "name": "FullItalian", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageItalian", + "OptionalArt" + ] + }, + { + "name": "FullKorean", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageKorean", + "OptionalArt" + ] + }, + { + "name": "FullPolish", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguagePolish", + "OptionalArt" + ] + }, + { + "name": "FullRussian", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageRussian", + "OptionalArt" + ] + }, + { + "name": "FullSpanish", + "itemNames": [ + "CoreArt", + "CoreAudio", + "CoreINI", + "CoreMaps", + "CoreWindow", + "LanguageSpanish", + "OptionalArt" + ] + } + ] + } +} \ No newline at end of file diff --git a/Patch104pZH/ModFolders.json b/Patch104pZH/ModFolders.json new file mode 100644 index 000000000..6e0496a3c --- /dev/null +++ b/Patch104pZH/ModFolders.json @@ -0,0 +1,8 @@ +{ + "folders": { + "version": 1, + "releaseUnpackedDir": "ReleaseUnpacked", + "releaseDir": ".Release", + "buildDir": ".Build" + } +} \ No newline at end of file diff --git a/Patch104pZH/ModRunner.json b/Patch104pZH/ModRunner.json new file mode 100644 index 000000000..a408c3b16 --- /dev/null +++ b/Patch104pZH/ModRunner.json @@ -0,0 +1,13 @@ +{ + "runner": { + "version": 1, + "gameLanguageRegKey": "SOFTWARE\\WOW6432Node\\Electronic Arts\\EA Games\\Command and Conquer Generals Zero Hour:Language", + "gameInstallRegKey": "SOFTWARE\\WOW6432Node\\Electronic Arts\\EA Games\\Command and Conquer Generals Zero Hour:InstallPath", + "gameInstallPath": "", + "gameExeFile": "generals.exe", + "gameExeArgs": { + "-win": "", + "-quickstart": "" + } + } +} \ No newline at end of file diff --git a/Patch104pZH/README.md b/Patch104pZH/README.md index f8c9b2a50..a4e42410f 100644 --- a/Patch104pZH/README.md +++ b/Patch104pZH/README.md @@ -4,12 +4,6 @@ * Add and edit game files in **GameFilesEdited** folder. * When adding an original game file with text contents, please submit the file as is first before adding any changes. This will preserve change history. -#### Build and test project files in Windows 10 -* SETUP_UserSettings.bat : Create and edit this bat file based on SETUP_UserSettings.bat.txt template file -* MAKE_Install.bat : Run (As Administrator) to generate project .big files, copy to game install path. -* MAKE_Install_Run.bat : Run (As Administrator) to generate project .big files, copy to game install path, start the game process. -* MAKE_Release.bat : Run to generate project .big files, pack files to .zip file, copy to Release folder. - #### Folders | Folder | Purpose | diff --git a/Patch104pZH/ReleaseUnpacked/ReadMe.txt b/Patch104pZH/ReleaseUnpacked/ReadMe.txt index 24f13fdbe..fc844fdf2 100644 --- a/Patch104pZH/ReleaseUnpacked/ReadMe.txt +++ b/Patch104pZH/ReleaseUnpacked/ReadMe.txt @@ -1 +1,3 @@ -Write something beautiful here. \ No newline at end of file +Generals Game Patch mockup ReadMe.txt + +By TheSuperHackers diff --git a/Patch104pZH/SETUP_UserSettings.bat.txt b/Patch104pZH/SETUP_UserSettings.bat.txt deleted file mode 100644 index ebc4eb144..000000000 --- a/Patch104pZH/SETUP_UserSettings.bat.txt +++ /dev/null @@ -1,39 +0,0 @@ -:: Copy this file, remove the .txt extension from the file name, and edit it depending on your requirements. - -@echo off - -:: Set game install root directory -set GameRootDir="C:\Program Files (x86)\EA Games\Command & Conquer The First Decade\Command & Conquer(tm) Generals Zero Hour" - -:: Set game executable path and file relative to root directory -set GameExeFile="generals.exe" - -:: Set game launch command line arguments -set GameExeArgs="-win -quickstart" - -:: Set files that should be voided (renamed) before launching generals.exe -set GameFilesToDisable= -set GameFilesToDisable=%GameFilesToDisable% 200_ControlBarObsEnglishZH.big -set GameFilesToDisable=%GameFilesToDisable% 250_HideIP_WindowZH.big -set GameFilesToDisable=%GameFilesToDisable% 251_HideMail_WindowZH.big -set GameFilesToDisable=%GameFilesToDisable% 339_ControlBarProHideIpZH.big -set GameFilesToDisable=%GameFilesToDisable% 339_ControlBarProHideMailZH.big -set GameFilesToDisable=%GameFilesToDisable% 340_ControlBarPro2160ZH.big -set GameFilesToDisable=%GameFilesToDisable% 340_ControlBarPro1440ZH.big -set GameFilesToDisable=%GameFilesToDisable% 340_ControlBarPro1080ZH.big -set GameFilesToDisable=%GameFilesToDisable% 340_ControlBarPro900ZH.big -set GameFilesToDisable=%GameFilesToDisable% 340_ControlBarPro720ZH.big -set GameFilesToDisable=%GameFilesToDisable% 340_ControlBarProZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDBaseZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDBrazilianZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDChineseZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDEnglishZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDFrenchZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDGermanZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDItalianZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDKoreanZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDPolishZH.big -set GameFilesToDisable=%GameFilesToDisable% 400_ControlBarHDSpanishZH.big -set GameFilesToDisable=%GameFilesToDisable% 800_GermanUncutLiteZH.big - -echo on diff --git a/Patch104pZH/Scripts/BuildInstall.bat b/Patch104pZH/Scripts/BuildInstall.bat new file mode 100644 index 000000000..8473a770f --- /dev/null +++ b/Patch104pZH/Scripts/BuildInstall.bat @@ -0,0 +1,23 @@ +@echo off + +setlocal + +set ThisDir=%~dp0. + +call "%ThisDir%\Windows\RequestAdmin.bat" "%~s0" %* + +if %errorlevel% EQU 111 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\InstallModBuilder.bat" + +if %errorlevel% EQU 222 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\Setup.bat" print + +call "%ModBuilderExe%" --build --install --config-list %ConfigFiles% %* + +endlocal diff --git a/Patch104pZH/Scripts/BuildInstallRun.bat b/Patch104pZH/Scripts/BuildInstallRun.bat new file mode 100644 index 000000000..eb2f99197 --- /dev/null +++ b/Patch104pZH/Scripts/BuildInstallRun.bat @@ -0,0 +1,23 @@ +@echo off + +setlocal + +set ThisDir=%~dp0. + +call "%ThisDir%\Windows\RequestAdmin.bat" "%~s0" %* + +if %errorlevel% EQU 111 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\InstallModBuilder.bat" + +if %errorlevel% EQU 222 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\Setup.bat" print + +call "%ModBuilderExe%" --build --install --run --uninstall --config-list %ConfigFiles% %* + +endlocal diff --git a/Patch104pZH/Scripts/BuildRelease.bat b/Patch104pZH/Scripts/BuildRelease.bat new file mode 100644 index 000000000..d0c8a2e49 --- /dev/null +++ b/Patch104pZH/Scripts/BuildRelease.bat @@ -0,0 +1,23 @@ +@echo off + +setlocal + +set ThisDir=%~dp0. + +call "%ThisDir%\Windows\RequestAdmin.bat" "%~s0" %* + +if %errorlevel% EQU 111 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\InstallModBuilder.bat" + +if %errorlevel% EQU 222 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\Setup.bat" print + +call "%ModBuilderExe%" --build --release --config-list %ConfigFiles% %* + +endlocal diff --git a/Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat b/Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat deleted file mode 100644 index bfcbe3c22..000000000 --- a/Patch104pZH/Scripts/MAKE_Patch104pArtZH.bat +++ /dev/null @@ -1,28 +0,0 @@ -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 /f /q /s "%GeneratedBigFilesUnpackedDir%\%BigName%" - del /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%\" -) diff --git a/Patch104pZH/Scripts/MAKE_Patch104pZH.bat b/Patch104pZH/Scripts/MAKE_Patch104pZH.bat deleted file mode 100644 index 20698cb98..000000000 --- a/Patch104pZH/Scripts/MAKE_Patch104pZH.bat +++ /dev/null @@ -1,54 +0,0 @@ -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 /f /q /s "%GeneratedBigFilesUnpackedDir%\%BigName%" - del /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%\Data\INI\*.ini" "%GeneratedBigFilesUnpackedDir%\%BigName%\Data\INI\" - xcopy /y /s "%GameFilesDir%\Window\*.wnd" "%GeneratedBigFilesUnpackedDir%\%BigName%\Window\" - xcopy /y "%GameFilesDir%\Art\Textures\exlaser3.dds" "%GeneratedBigFilesUnpackedDir%\%BigName%\Art\Textures\" - xcopy /y "%GameFilesDir%\Art\Textures\gxmammoth_co.tga" "%GeneratedBigFilesUnpackedDir%\%BigName%\Art\Textures\" - xcopy /y "%GameFilesDir%\Art\Textures\gxmammothalt_HI.tga" "%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\" - xcopy /y "%GameFilesDir%\Art\W3D\UIWRKR_CLMUP.W3D" "%GeneratedBigFilesUnpackedDir%\%BigName%\Art\W3D\" - - :: TODO Move language files into separate .big file(s) later - :: Copies language files into language folders and compiles generals.csf - for %%l in (Arabic,Brazilian,Chinese,English,French,German,Italian,Korean,Polish,Russian,Spanish) do ( - xcopy /y /s "%GameFilesDir%\Data\%%l\*.*" "%GeneratedBigFilesUnpackedDir%\%BigName%\Data\%%l\" - "%ToolsDir%\gametextcompiler\gametextcompiler.exe" ^ - -LOAD_STR "%GameFilesDir%\Data\generals.str" ^ - -LOAD_STR_LANGUAGES %%l ^ - -SAVE_CSF "%GeneratedBigFilesUnpackedDir%\%BigName%\Data\%%l\generals.csf" - ) - - :: Compiles Autorun.csf for supported languages - for %%l in (Chinese,French,German,Korean) do ( - "%ToolsDir%\gametextcompiler\gametextcompiler.exe" ^ - -LOAD_STR "%GameFilesDir%\Data\Autorun.str" ^ - -LOAD_STR_LANGUAGES %%l ^ - -SAVE_CSF "%GeneratedBigFilesUnpackedDir%\%BigName%\Data\%%l\Autorun.csf" - ) - - :: 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%\" -) diff --git a/Patch104pZH/Scripts/SETUP_Folders.bat b/Patch104pZH/Scripts/SETUP_Folders.bat deleted file mode 100644 index 58fcdd815..000000000 --- a/Patch104pZH/Scripts/SETUP_Folders.bat +++ /dev/null @@ -1,16 +0,0 @@ -:: Setup work folders -set ProjectDir=%~dp0.. -set ToolsDir=%ProjectDir%\..\Tools -set GameFilesDir=%ProjectDir%\GameFilesEdited -set ReleaseUnpackedDir=%ProjectDir%\ReleaseUnpacked -set ReleaseDir=%ProjectDir%\.Release - -set GeneratedBigFilesUnpackedDir=%ProjectDir%\.Generated\BigFilesUnpacked -set GeneratedBigFilesDir=%ProjectDir%\.Generated\BigFiles -set GeneratedReleaseUnpackedDir=%ProjectDir%\.Generated\ReleaseUnpacked - -:: Create folders -if not exist "%ReleaseDir%" mkdir "%ReleaseDir%" -if not exist "%GeneratedBigFilesUnpackedDir%" mkdir "%GeneratedBigFilesUnpackedDir%" -if not exist "%GeneratedBigFilesDir%" mkdir "%GeneratedBigFilesDir%" -if not exist "%GeneratedReleaseUnpackedDir%" mkdir "%GeneratedReleaseUnpackedDir%" diff --git a/Patch104pZH/Scripts/Uninstall.bat b/Patch104pZH/Scripts/Uninstall.bat new file mode 100644 index 000000000..adafb87de --- /dev/null +++ b/Patch104pZH/Scripts/Uninstall.bat @@ -0,0 +1,23 @@ +@echo off + +setlocal + +set ThisDir=%~dp0. + +call "%ThisDir%\Windows\RequestAdmin.bat" "%~s0" %* + +if %errorlevel% EQU 111 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\InstallModBuilder.bat" + +if %errorlevel% EQU 222 ( + exit /B %errorlevel% +) + +call "%ThisDir%\Windows\Setup.bat" print + +call "%ModBuilderExe%" --uninstall --config-list %ConfigFiles% %* + +endlocal diff --git a/Patch104pZH/Scripts/Windows/InstallModBuilder.bat b/Patch104pZH/Scripts/Windows/InstallModBuilder.bat new file mode 100644 index 000000000..a723fb46a --- /dev/null +++ b/Patch104pZH/Scripts/Windows/InstallModBuilder.bat @@ -0,0 +1,63 @@ +setlocal + +set ThisDir=%~dp0. +set WasDownloaded=0 +set WasInstalled=0 + +call "%ThisDir%\Setup.bat" + +if not exist %ModBuilderExe% ( + echo Installing Generals Mod Builder at '%ModBuilderDir%' ... + + if not exist "%ModBuilderDir%" ( + mkdir "%ModBuilderDir%" + ) + + echo Download '%ModBuilderZipUrl%' ... + + curl --location "%ModBuilderZipUrl%" --output "%ModBuilderZip%" --max-filesize %ModBuilderZipSize% + + set WasDownloaded=1 +) else ( + echo Generals Mod Builder is installed +) + +if %WasDownloaded% NEQ 0 ( + if exist "%ModBuilderZip%" ( + echo Check Generals Mod Builder archive ... + for /F %%I in ("%ModBuilderZip%") do ( + if %%~zI NEQ %ModBuilderZipSize% ( + echo File '%ModBuilderZip%' does not have expected size %ModBuilderZipSize% + exit /B 222 + ) + ) + + echo Hash Generals Mod Builder archive ... + Certutil -hashfile "%ModBuilderZip%" SHA256 | findstr /c:%ModBuilderZipSha256% + + if %errorlevel% EQU 0 ( + echo Extract archive '%ModBuilderZip%' ... + tar.exe -x -k -f "%ModBuilderZip%" -C "%ModBuilderDir%" --strip-components=1 + + echo Delete archive '%ModBuilderZip%' ... + del /q "%ModBuilderZip%" + + set WasInstalled=1 + ) else ( + echo File '%ModBuilderZip%' does not have expected hash '%ModBuilderZipSha256%' + exit /B 222 + ) + ) else ( + echo File '%ModBuilderZip%' failed to download + exit /B 222 + ) +) + +if %WasInstalled% NEQ 0 ( + if not exist "%ModBuilderExe%" ( + echo File '%ModBuilderExe%' failed to install + exit /B 222 + ) +) + +endlocal diff --git a/Patch104pZH/Scripts/Windows/RequestAdmin.bat b/Patch104pZH/Scripts/Windows/RequestAdmin.bat new file mode 100644 index 000000000..982cddfe7 --- /dev/null +++ b/Patch104pZH/Scripts/Windows/RequestAdmin.bat @@ -0,0 +1,25 @@ +@echo off +:------------------------------------- +>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" + +if %errorlevel% NEQ 0 ( + echo Requesting administrative privileges... + goto UACPrompt +) else ( + goto gotAdmin +) + +:UACPrompt + set args=%* + set params=%args:"=""% + echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" + echo UAC.ShellExecute "cmd.exe", "/c %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" + + "%temp%\getadmin.vbs" + del "%temp%\getadmin.vbs" + exit /B 111 + +:gotAdmin + pushd "%CD%" + CD /D "%~dp0" +:-------------------------------------- diff --git a/Patch104pZH/Scripts/Windows/Setup.bat b/Patch104pZH/Scripts/Windows/Setup.bat new file mode 100644 index 000000000..de173db7f --- /dev/null +++ b/Patch104pZH/Scripts/Windows/Setup.bat @@ -0,0 +1,33 @@ +@echo off + +set SetupDir=%~dp0. + +set ModBuilderVer=1.1 +set ModBuilderDir=%SetupDir%\.GeneralsModBuilder\v%ModBuilderVer% +set ModBuilderExe=%ModBuilderDir%\generalsmodbuilder.exe +set ModBuilderZip=%ModBuilderDir%\generalsmodbuilder.zip +set ModBuilderZipUrl=https://github.com/TheSuperHackers/GeneralsTools/raw/main/Tools/generalsmodbuilder/v%ModBuilderVer%/generalsmodbuilder_v%ModBuilderVer%.zip +set ModBuilderZipSha256=4381dc52af1d03ac239da01368be0e976527caffd5d2261b56eb80100e5cd9d1 +set ModBuilderZipSize=7884988 + +set ConfigDir=%SetupDir%\..\.. +set ConfigFiles=^ + "%ConfigDir%\ModBundleItems.json" ^ + "%ConfigDir%\ModBundlePacks.json" ^ + "%ConfigDir%\ModFolders.json" ^ + "%ConfigDir%\ModRunner.json" + +if [%~1]==[print] ( + echo SETUP. Using Generals Mod Builder: + echo ver... %ModBuilderVer% + echo dir... %ModBuilderDir% + echo exe... %ModBuilderExe% + echo zip... %ModBuilderZip% + echo zipurl %ModBuilderZipUrl% + echo zipsha %ModBuilderZipSha256% + echo zipsiz %ModBuilderZipSize% + for %%f in (%ConfigFiles%) do ( + echo config %%f + ) + echo SETUP END. +) diff --git a/Tools/GeneralsBigCreator/GeneralsBigCreator.exe b/Tools/GeneralsBigCreator/GeneralsBigCreator.exe deleted file mode 100644 index d8443e9fe..000000000 Binary files a/Tools/GeneralsBigCreator/GeneralsBigCreator.exe and /dev/null differ diff --git a/Tools/gametextcompiler/gametextcompiler.exe b/Tools/gametextcompiler/gametextcompiler.exe deleted file mode 100644 index a81950f1a..000000000 Binary files a/Tools/gametextcompiler/gametextcompiler.exe and /dev/null differ