diff --git a/.github/workflows/gen_emu_config-build-win.yml b/.github/workflows/gen_emu_config-build-win.yml index 833b37bd..2ac03377 100644 --- a/.github/workflows/gen_emu_config-build-win.yml +++ b/.github/workflows/gen_emu_config-build-win.yml @@ -44,6 +44,21 @@ jobs: with: ref: "third-party/build/win" path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win" + + ## clone this for 7za.exe + - name: "Clone third-party deps (deps/win)" + uses: actions/checkout@v4 + with: + ref: "third-party/deps/win" + path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win" + + # download artifacts + - name: "Download emu build artifacts (Win)" + uses: actions/download-artifact@v4 + with: + path: "build/win" + pattern: "emu-win-*" + merge-multiple: true # env - name: "Install env" diff --git a/.github/workflows/migrate_gse-build-win.yml b/.github/workflows/migrate_gse-build-win.yml index 34913db8..163791ff 100644 --- a/.github/workflows/migrate_gse-build-win.yml +++ b/.github/workflows/migrate_gse-build-win.yml @@ -44,6 +44,21 @@ jobs: with: ref: "third-party/build/win" path: "${{env.THIRD_PARTY_BASE_DIR}}/build/win" + + ## clone this for 7za.exe + - name: "Clone third-party deps (deps/win)" + uses: actions/checkout@v4 + with: + ref: "third-party/deps/win" + path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win" + + # download artifacts + - name: "Download emu build artifacts (Win)" + uses: actions/download-artifact@v4 + with: + path: "build/win" + pattern: "emu-win-*" + merge-multiple: true # env - name: "Install env" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 82a8ba3f..fbdf2df4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -187,6 +187,7 @@ jobs: retention-days: 7 gen_emu_script-win: + needs: ["emu-win-all"] # add emu-win-all to wait for emu build to complete, so that we include the latest dlls and tools in generate_emu_config name: "Gen emu config win" if: ${{ !cancelled() }} uses: "./.github/workflows/gen_emu_config-build-win.yml" @@ -247,6 +248,7 @@ jobs: retention-days: 7 gen_emu_script-linux: + needs: ["emu-linux-all"] # add emu-linux-all to wait for emu build to complete (not really needed but included for better build matrix visualization) name: "Gen emu config linux" if: ${{ !cancelled() }} uses: "./.github/workflows/gen_emu_config-build-linux.yml" @@ -299,6 +301,7 @@ jobs: retention-days: 7 migrate_gse_script-win: + needs: ["emu-win-all"] # add emu-win-all to wait for emu build to complete, so that we include the latest dlls and tools in migrate_gse name: "Migrate GSE win" if: ${{ !cancelled() }} uses: "./.github/workflows/migrate_gse-build-win.yml" @@ -359,6 +362,7 @@ jobs: retention-days: 7 migrate_gse_script-linux: + needs: ["emu-linux-all"] # add emu-linux-all to wait for emu build to complete (not really needed but included for better build matrix visualization) name: Migrate GSE linux if: ${{ !cancelled() }} uses: "./.github/workflows/migrate_gse-build-linux.yml" diff --git a/.gitignore b/.gitignore index f9e98206..a70e5cbf 100644 --- a/.gitignore +++ b/.gitignore @@ -20,13 +20,48 @@ /tools/generate_emu_config/.env*/ /tools/generate_emu_config/bin -/tools/generate_emu_config/backup/ +/tools/generate_emu_config/_DEFAULT/0/steam_api.dll +/tools/generate_emu_config/_DEFAULT/0/steam_api.7z +/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll +/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z + +/tools/generate_emu_config/_DEFAULT/0/steam_api.7z +/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll +/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z + +/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.7z +/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.exe +/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces64.exe + +/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.7z +/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.exe +/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect64.exe + +/tools/generate_emu_config/_OUTPUT/ + /tools/generate_emu_config/login_temp/ -/tools/generate_emu_config/output/ /tools/generate_emu_config/**/my_login.txt -/tools/generate_emu_config/top_owners_ids.txt # migrate_gse /tools/migrate_gse/.py*/ /tools/migrate_gse/.env*/ /tools/migrate_gse/bin + +/tools/migrate_gse/_DEFAULT/0/steam_api.dll +/tools/migrate_gse/_DEFAULT/0/steam_api.7z +/tools/migrate_gse/_DEFAULT/0/steam_api64.dll +/tools/migrate_gse/_DEFAULT/0/steam_api64.7z + +/tools/migrate_gse/_DEFAULT/0/steam_api.7z +/tools/migrate_gse/_DEFAULT/0/steam_api64.dll +/tools/migrate_gse/_DEFAULT/0/steam_api64.7z + +/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.7z +/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces.exe +/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/generate_interfaces/generate_interfaces64.exe + +/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.7z +/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect.exe +/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/lobby_connect/lobby_connect64.exe + +/tools/migrate_gse/_OUTPUT/ diff --git a/build_win_premake_gemu.bat b/build_win_premake_gemu.bat new file mode 100644 index 00000000..2f7cd518 --- /dev/null +++ b/build_win_premake_gemu.bat @@ -0,0 +1,3 @@ +@echo off + +call "build_win_premake.bat" diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.cfg b/tools/generate_emu_config/_DEFAULT/0/gse_acw_helper.cfg similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.cfg rename to tools/generate_emu_config/_DEFAULT/0/gse_acw_helper.cfg diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.exe b/tools/generate_emu_config/_DEFAULT/0/gse_acw_helper.exe similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.exe rename to tools/generate_emu_config/_DEFAULT/0/gse_acw_helper.exe diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.cfg b/tools/generate_emu_config/_DEFAULT/0/gse_debug_switch.cfg similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.cfg rename to tools/generate_emu_config/_DEFAULT/0/gse_debug_switch.cfg diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.exe b/tools/generate_emu_config/_DEFAULT/0/gse_debug_switch.exe similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.exe rename to tools/generate_emu_config/_DEFAULT/0/gse_debug_switch.exe diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.cfg b/tools/generate_emu_config/_DEFAULT/0/gse_generate_interfaces.cfg similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.cfg rename to tools/generate_emu_config/_DEFAULT/0/gse_generate_interfaces.cfg diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.exe b/tools/generate_emu_config/_DEFAULT/0/gse_generate_interfaces.exe similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.exe rename to tools/generate_emu_config/_DEFAULT/0/gse_generate_interfaces.exe diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.cfg b/tools/generate_emu_config/_DEFAULT/0/gse_lobby_connect.cfg similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.cfg rename to tools/generate_emu_config/_DEFAULT/0/gse_lobby_connect.cfg diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.exe b/tools/generate_emu_config/_DEFAULT/0/gse_lobby_connect.exe similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.exe rename to tools/generate_emu_config/_DEFAULT/0/gse_lobby_connect.exe diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api.7z b/tools/generate_emu_config/_DEFAULT/0/steam_api.7z deleted file mode 100644 index a9c68615..00000000 Binary files a/tools/generate_emu_config/_DEFAULT/0/steam_api.7z and /dev/null differ diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api.dll b/tools/generate_emu_config/_DEFAULT/0/steam_api.dll deleted file mode 100644 index 5f3fb1d9..00000000 Binary files a/tools/generate_emu_config/_DEFAULT/0/steam_api.dll and /dev/null differ diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z b/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z deleted file mode 100644 index cd3abcd0..00000000 Binary files a/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z and /dev/null differ diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll b/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll deleted file mode 100644 index 39f7a970..00000000 Binary files a/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll and /dev/null differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/7za/7za-license.txt similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/7za/7za-license.txt diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za.exe b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/7za/7za.exe similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za.exe rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/7za/7za.exe diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/au3-license.txt similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/au3-license.txt diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3.exe b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/au3.exe similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3.exe rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/au3.exe diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.a3x similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.a3x diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.au3 similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.au3 diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.ini similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.ini diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.a3x similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.a3x diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.au3 similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.au3 diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.ini similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.ini diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.a3x similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.a3x diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.au3 similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.au3 diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.ini similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.ini diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.a3x similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.a3x diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.au3 similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.au3 diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.ini similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.ini diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/acw_helper.bat similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/acw_helper.bat diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/debug_switch.bat similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/debug_switch.bat diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/generate_interfaces.bat similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/generate_interfaces.bat diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat b/tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/lobby_connect.bat similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat rename to tools/generate_emu_config/_DEFAULT/0/steam_misc/tools/bat/lobby_connect.bat diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/emu_version.txt b/tools/generate_emu_config/_DEFAULT/0/steam_settings/emu_version.txt similarity index 100% rename from tools/generate_emu_config/_DEFAULT/1/steam_settings/emu_version.txt rename to tools/generate_emu_config/_DEFAULT/0/steam_settings/emu_version.txt diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z deleted file mode 100644 index 0703509c..00000000 Binary files a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z and /dev/null differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z deleted file mode 100644 index 6b875ed6..00000000 Binary files a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z and /dev/null differ diff --git a/tools/generate_emu_config/bat/_pack_api.bat b/tools/generate_emu_config/bat/_pack_api.bat new file mode 100644 index 00000000..00b90537 --- /dev/null +++ b/tools/generate_emu_config/bat/_pack_api.bat @@ -0,0 +1,103 @@ +@echo off +setlocal EnableDelayedExpansion +cd /d "%~dp0" + +set /a "MAX_THREADS=2" +if defined NUMBER_OF_PROCESSORS ( + :: use 70% + set /a "MAX_THREADS=%NUMBER_OF_PROCESSORS% * 70 / 100" + if %MAX_THREADS% lss 1 ( + set /a "MAX_THREADS=1" + ) +) + +set "ROOT=%cd%" +set "BUILD_DIR=..\..\..\build\win\vs2022" +set "OUT_DIR=..\build\package\win" + +if not exist "%BUILD_DIR%\release\" ( + 1>&2 echo:release build target folder wasn't found + goto :end_script_with_err +) +if not exist "%BUILD_DIR%\debug\" ( + 1>&2 echo:debug build target folder wasn't found + goto :end_script_with_err +) + +set /a "PKG_EXE_MEM_PERCENT=90" +set /a "PKG_EXE_DICT_SIZE_MB=384" +set "PKG_EXE=..\..\..\third-party\deps\win\7za\7za.exe" +if not exist "%PKG_EXE%" ( + 1>&2 echo:packager wasn't found + goto :end_script_with_err +) + +:::::::::::::::::::::::::::::::::::::::::: + +echo:// packing latest steam_api.dll for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_api" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_api\release" +mkdir "..\_DEFAULT\0\steam_api\debug" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api\release\steam_api.dll"* +xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api.dll"* +set "TARGET_DIR=%BUILD_DIR%\debug" +xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api\debug\steam_api.dll"* +rem xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api.dll"* rem do not overwrite dll with debug version + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_api.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +echo:// packing latest steam_api64.dll for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_api64" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_api64\release" +mkdir "..\_DEFAULT\0\steam_api64\debug" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64\release\steam_api64.dll"* +xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64.dll"* +set "TARGET_DIR=%BUILD_DIR%\debug" +xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64\debug\steam_api64.dll"* +rem xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64.dll"* rem do not overwrite dll with debug version + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_api64.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +:::::::::::::::::::::::::::::::::::::::::: + +goto :end_script + +:end_script + endlocal + exit /b 0 + +:end_script_with_err + endlocal + exit /b 1 diff --git a/tools/generate_emu_config/bat/_pack_exe.bat b/tools/generate_emu_config/bat/_pack_exe.bat new file mode 100644 index 00000000..7ec6bf65 --- /dev/null +++ b/tools/generate_emu_config/bat/_pack_exe.bat @@ -0,0 +1,95 @@ +@echo off +setlocal EnableDelayedExpansion +cd /d "%~dp0" + +set /a "MAX_THREADS=2" +if defined NUMBER_OF_PROCESSORS ( + :: use 70% + set /a "MAX_THREADS=%NUMBER_OF_PROCESSORS% * 70 / 100" + if %MAX_THREADS% lss 1 ( + set /a "MAX_THREADS=1" + ) +) + +set "ROOT=%cd%" +set "BUILD_DIR=..\..\..\build\win\vs2022" +set "OUT_DIR=..\build\package\win" + +if not exist "%BUILD_DIR%\release\" ( + 1>&2 echo:release build target folder wasn't found + goto :end_script_with_err +) +if not exist "%BUILD_DIR%\debug\" ( + 1>&2 echo:debug build target folder wasn't found + goto :end_script_with_err +) + +set /a "PKG_EXE_MEM_PERCENT=90" +set /a "PKG_EXE_DICT_SIZE_MB=384" +set "PKG_EXE=..\..\..\third-party\deps\win\7za\7za.exe" +if not exist "%PKG_EXE%" ( + 1>&2 echo:packager wasn't found + goto :end_script_with_err +) + +:::::::::::::::::::::::::::::::::::::::::: + +echo:// packing latest generate_interfaces.exe for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\tools\generate_interfaces\generate_interfaces_x32.exe" "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces\generate_interfaces.exe"* +xcopy /y "%TARGET_DIR%\tools\generate_interfaces\generate_interfaces_x64.exe" "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces\generate_interfaces64.exe"* + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +echo:// packing latest lobby_connect.exe for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\tools\lobby_connect\lobby_connect_x32.exe" "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect\lobby_connect.exe"* +xcopy /y "%TARGET_DIR%\tools\lobby_connect\lobby_connect_x64.exe" "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect\lobby_connect64.exe"* + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +:::::::::::::::::::::::::::::::::::::::::: + +goto :end_script + +:end_script + endlocal + exit /b 0 + +:end_script_with_err + endlocal + exit /b 1 diff --git a/tools/generate_emu_config/rebuild_win.bat b/tools/generate_emu_config/rebuild_win.bat index e7062e60..87feac60 100644 --- a/tools/generate_emu_config/rebuild_win.bat +++ b/tools/generate_emu_config/rebuild_win.bat @@ -49,6 +49,9 @@ pyinstaller "stats_schema_achievement_gen\achievements_gen.py" --distpath "%OUT_ ) call "%SIGNER_TOOL%" "%OUT_DIR%\parse_achievements_schema\parse_achievements_schema.exe" +call ".\bat\_pack_api.bat" +call ".\bat\_pack_exe.bat" + xcopy /s /y /e "post_build" "%out_dir%\generate_emu_config\" xcopy /s /y /e "_DEFAULT" "%out_dir%\generate_emu_config\_DEFAULT\" diff --git a/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.cfg b/tools/migrate_gse/_DEFAULT/0/gse_acw_helper.cfg similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_acw_helper.cfg rename to tools/migrate_gse/_DEFAULT/0/gse_acw_helper.cfg diff --git a/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.exe b/tools/migrate_gse/_DEFAULT/0/gse_acw_helper.exe similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_acw_helper.exe rename to tools/migrate_gse/_DEFAULT/0/gse_acw_helper.exe diff --git a/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.cfg b/tools/migrate_gse/_DEFAULT/0/gse_debug_switch.cfg similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_debug_switch.cfg rename to tools/migrate_gse/_DEFAULT/0/gse_debug_switch.cfg diff --git a/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.exe b/tools/migrate_gse/_DEFAULT/0/gse_debug_switch.exe similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_debug_switch.exe rename to tools/migrate_gse/_DEFAULT/0/gse_debug_switch.exe diff --git a/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.cfg b/tools/migrate_gse/_DEFAULT/0/gse_generate_interfaces.cfg similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.cfg rename to tools/migrate_gse/_DEFAULT/0/gse_generate_interfaces.cfg diff --git a/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.exe b/tools/migrate_gse/_DEFAULT/0/gse_generate_interfaces.exe similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.exe rename to tools/migrate_gse/_DEFAULT/0/gse_generate_interfaces.exe diff --git a/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.cfg b/tools/migrate_gse/_DEFAULT/0/gse_lobby_connect.cfg similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.cfg rename to tools/migrate_gse/_DEFAULT/0/gse_lobby_connect.cfg diff --git a/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.exe b/tools/migrate_gse/_DEFAULT/0/gse_lobby_connect.exe similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.exe rename to tools/migrate_gse/_DEFAULT/0/gse_lobby_connect.exe diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api.7z b/tools/migrate_gse/_DEFAULT/0/steam_api.7z deleted file mode 100644 index a1b35a78..00000000 Binary files a/tools/migrate_gse/_DEFAULT/0/steam_api.7z and /dev/null differ diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api.dll b/tools/migrate_gse/_DEFAULT/0/steam_api.dll deleted file mode 100644 index a90054e6..00000000 Binary files a/tools/migrate_gse/_DEFAULT/0/steam_api.dll and /dev/null differ diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api64.7z b/tools/migrate_gse/_DEFAULT/0/steam_api64.7z deleted file mode 100644 index 1e741114..00000000 Binary files a/tools/migrate_gse/_DEFAULT/0/steam_api64.7z and /dev/null differ diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api64.dll b/tools/migrate_gse/_DEFAULT/0/steam_api64.dll deleted file mode 100644 index 1d72bd5b..00000000 Binary files a/tools/migrate_gse/_DEFAULT/0/steam_api64.dll and /dev/null differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/7za/7za-license.txt similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/7za/7za-license.txt diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za.exe b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/7za/7za.exe similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za.exe rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/7za/7za.exe diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/au3-license.txt similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/au3-license.txt diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3.exe b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/au3.exe similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3.exe rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/au3.exe diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.a3x similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.a3x diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.au3 similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.au3 diff --git a/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.ini b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.ini new file mode 100644 index 00000000..ff516360 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/acw_helper.ini @@ -0,0 +1,3 @@ +[ARC_NAME] + +extra_acw = extra_acw.zip diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.a3x similarity index 58% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.a3x index 25d8ead7..0702b6f9 100644 Binary files a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x and b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.a3x differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.au3 similarity index 55% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.au3 index d2e42dca..ae0f1a33 100644 --- a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 +++ b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.au3 @@ -27,7 +27,7 @@ $steamclient_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) $steamclient64_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steamclient64_debug", "debug\steamclient64.dll") If FileReadLine(@ScriptDir & "\steam_settings\emu_version.txt", 1) == "release" Then - If FileExists(@ScriptDir & "\" & $arc_steam_api) Then + If FileExists(@ScriptDir & "\" & $arc_steam_api) Then ; replace steam_api.dll if it exists $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steam_api & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 3) & '" -aoa', "", "", @SW_HIDE) $steam_api_dst = StringTrimLeft($steam_api_release, StringInStr($steam_api_release, "\", 0, -1)) $steam_api_debug_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 3) & "\" & $steam_api_debug, "\\", "\") @@ -39,7 +39,19 @@ If FileReadLine(@ScriptDir & "\steam_settings\emu_version.txt", 1) == "release" FileWrite($hFileOpen, "debug" & @CRLF & @CRLF & "you are currently using the 'debug' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'release' version") FileClose($hFileOpen) EndIf - If FileExists(@ScriptDir & "\" & $arc_steamclient) Then + If FileExists(@ScriptDir & "\" & $arc_steam_api64) Then ; replace steam_api64.dll if it exists + $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steam_api64 & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api64, 3) & '" -aoa', "", "", @SW_HIDE) + $steam_api64_dst = StringTrimLeft($steam_api64_release, StringInStr($steam_api64_release, "\", 0, -1)) + $steam_api64_debug_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api64, 3) & "\" & $steam_api64_debug, "\\", "\") + If FileExists($steam_api64_dst) Then + FileMove($steam_api64_debug_src, $steam_api64_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api64, 3), 1) + $hFileOpen = FileOpen(@ScriptDir & "\steam_settings\emu_version.txt", 2+8) + FileWrite($hFileOpen, "debug" & @CRLF & @CRLF & "you are currently using the 'debug' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'release' version") + FileClose($hFileOpen) + EndIf + If FileExists(@ScriptDir & "\" & $arc_steamclient) Then ; replace steamclient.dll if it exists $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steamclient & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 3) & '" -aoa', "", "", @SW_HIDE) $steamclient_dst = StringTrimLeft($steamclient_release, StringInStr($steamclient_release, "\", 0, -1)) $steamclient_debug_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 3) & "\" & $steamclient_debug, "\\", "\") @@ -51,8 +63,20 @@ If FileReadLine(@ScriptDir & "\steam_settings\emu_version.txt", 1) == "release" FileWrite($hFileOpen, "debug" & @CRLF & @CRLF & "you are currently using the 'debug' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'release' version") FileClose($hFileOpen) EndIf + If FileExists(@ScriptDir & "\" & $arc_steamclient64) Then ; replace steamclient64.dll if it exists + $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steamclient64 & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient64, 3) & '" -aoa', "", "", @SW_HIDE) + $steamclient64_dst = StringTrimLeft($steamclient64_release, StringInStr($steamclient64_release, "\", 0, -1)) + $steamclient64_debug_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient64, 3) & "\" & $steamclient64_debug, "\\", "\") + If FileExists($steamclient64_dst) Then + FileMove($steamclient64_debug_src, $steamclient64_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient64, 3), 1) + $hFileOpen = FileOpen(@ScriptDir & "\steam_settings\emu_version.txt", 2+8) + FileWrite($hFileOpen, "debug" & @CRLF & @CRLF & "you are currently using the 'debug' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'release' version") + FileClose($hFileOpen) + EndIf ElseIf FileReadLine(@ScriptDir & "\steam_settings\emu_version.txt", 1) == "debug" Then - If FileExists(@ScriptDir & "\" & $arc_steam_api) Then + If FileExists(@ScriptDir & "\" & $arc_steam_api) Then ; replace steam_api.dll if it exists $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steam_api & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 3) & '" -aoa', "", "", @SW_HIDE) $steam_api_dst = StringTrimLeft($steam_api_debug, StringInStr($steam_api_debug, "\", 0, -1)) $steam_api_release_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 3) & "\" & $steam_api_release, "\\", "\") @@ -64,7 +88,19 @@ ElseIf FileReadLine(@ScriptDir & "\steam_settings\emu_version.txt", 1) == "debug FileWrite($hFileOpen, "release" & @CRLF & @CRLF & "you are currently using the 'release' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'debug' version") FileClose($hFileOpen) EndIf - If FileExists(@ScriptDir & "\" & $arc_steamclient) Then + If FileExists(@ScriptDir & "\" & $arc_steam_api64) Then ; replace steam_api.dll if it exists + $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steam_api64 & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api64, 3) & '" -aoa', "", "", @SW_HIDE) + $steam_api64_dst = StringTrimLeft($steam_api64_debug, StringInStr($steam_api64_debug, "\", 0, -1)) + $steam_api64_release_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api64, 3) & "\" & $steam_api64_release, "\\", "\") + If FileExists($steam_api64_dst) Then + FileMove($steam_api64_release_src, $steam_api64_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api64, 3), 1) + $hFileOpen = FileOpen(@ScriptDir & "\steam_settings\emu_version.txt", 2+8) + FileWrite($hFileOpen, "release" & @CRLF & @CRLF & "you are currently using the 'release' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'debug' version") + FileClose($hFileOpen) + EndIf + If FileExists(@ScriptDir & "\" & $arc_steamclient) Then ; replace steamclient.dll if it exists $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steamclient & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 3) & '" -aoa', "", "", @SW_HIDE) $steamclient_dst = StringTrimLeft($steamclient_debug, StringInStr($steamclient_debug, "\", 0, -1)) $steamclient_release_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 3) & "\" & $steamclient_release, "\\", "\") @@ -76,6 +112,18 @@ ElseIf FileReadLine(@ScriptDir & "\steam_settings\emu_version.txt", 1) == "debug FileWrite($hFileOpen, "release" & @CRLF & @CRLF & "you are currently using the 'release' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'debug' version") FileClose($hFileOpen) EndIf + If FileExists(@ScriptDir & "\" & $arc_steamclient64) Then ; replace steamclient64.dll if it exists + $7za_exit = ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & @ScriptDir & "\" & $arc_steamclient64 & '" -o"' & @ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient64, 3) & '" -aoa', "", "", @SW_HIDE) + $steamclient64_dst = StringTrimLeft($steamclient64_debug, StringInStr($steamclient64_debug, "\", 0, -1)) + $steamclient64_release_src = StringReplace(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient64, 3) & "\" & $steamclient64_release, "\\", "\") + If FileExists($steamclient64_dst) Then + FileMove($steamclient64_release_src, $steamclient64_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient64, 3), 1) + $hFileOpen = FileOpen(@ScriptDir & "\steam_settings\emu_version.txt", 2+8) + FileWrite($hFileOpen, "release" & @CRLF & @CRLF & "you are currently using the 'release' version of the emulator" & @CRLF & "run 'gse_debug_switch.exe' if you want to use the 'debug' version") + FileClose($hFileOpen) + EndIf EndIf diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.ini similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/debug_switch.ini diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.a3x similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.a3x diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.au3 similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.au3 diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.ini similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/generate_interfaces.ini diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.a3x similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.a3x diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.au3 similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.au3 diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.ini similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/au3/scripts/lobby_connect.ini diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/acw_helper.bat similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/acw_helper.bat diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/debug_switch.bat similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/debug_switch.bat diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/generate_interfaces.bat similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/generate_interfaces.bat diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat b/tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/lobby_connect.bat similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat rename to tools/migrate_gse/_DEFAULT/0/steam_misc/tools/bat/lobby_connect.bat diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/emu_version.txt b/tools/migrate_gse/_DEFAULT/0/steam_settings/emu_version.txt similarity index 100% rename from tools/migrate_gse/_DEFAULT/1/steam_settings/emu_version.txt rename to tools/migrate_gse/_DEFAULT/0/steam_settings/emu_version.txt diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini deleted file mode 100644 index fbe73d68..00000000 --- a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini +++ /dev/null @@ -1,3 +0,0 @@ -[ARC_NAME] - -extra_acw = extra_acw.7z diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z deleted file mode 100644 index f22a8221..00000000 Binary files a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z and /dev/null differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z deleted file mode 100644 index b915ab27..00000000 Binary files a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z and /dev/null differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.app.ini b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.app.ini index 9b0a19b7..3a672775 100644 --- a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.app.ini +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.app.ini @@ -3,16 +3,21 @@ # ################################################################################ # [app::general] -# by default the emu will report a 'non-beta' branch when the game calls 'Steam_Apps::GetCurrentBetaName()' -# if 1, makes the game/app think we're playing on a beta branch +# by default the emu will report a 'non-beta' branch when the game calls `Steam_Apps::GetCurrentBetaName()` +# 1=make the game/app think we're playing on a beta branch +# default=0 is_beta_branch=0 -# the name of the current branch - this must also exist in 'branches.json' -# otherwise it'll be ignored and the default 'public' branch will be used +# the name of the current branch, this must also exist in 'branches.json' +# otherwise will be ignored by the emu and the default 'public' branch will be used +# default=public branch_name=public [app::dlcs] -# report all DLCs as unlocked; some games check for 'hidden' DLCs, hence this should be set to 1 in that case -# however, other games detect emus by querying for a fake/bad DLC, hence this should be set to 0 in that case +# 1=report all DLCs as unlocked +# 0=report only the DLCs mentioned +# some games check for 'hidden' DLCs, hence this should be set to 1 in that case +# but other games detect emus by querying for a fake/bad DLC, hence this should be set to 0 in that case +# default=1 unlock_all=0 # format: ID=name # 1234=DLCNAME diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.main.ini b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.main.ini index e92b7034..b822babe 100644 --- a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.main.ini +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.main.ini @@ -3,78 +3,136 @@ # ################################################################################ # [main::general] -# generate new app auth ticket +# 1=generate newer version of Auth ticket, used by some modern apps/games +# default=0 new_app_ticket=1 -# generate/embed GC token inside new app ticket +# 1=generate/embed Game Coordinator token inside the new Auth ticket +# default=0 gc_token=1 -# pretend the app is running on a steam deck +# 1=pretend the app is running on a Steam Deck +# default=0 steam_deck=0 -# enable avatar functionality -enable_account_avatar=0 -# prevent Steam_User_Stats::FindLeaderboard() from always succeeding and creating the unknown leaderboard -# default=0, not recommended to change it -disable_leaderboards_create_unknown=0 -# by default, the emu will only save/update stats defined in 'stats.txt', unknown stats requested or updated by the game will be rejected -# set this to 1 to allow unknown stats -allow_unknown_stats=0 -# if 0, whenever a game updates a stat which is tied to an achievement progress, the emu will save that stat progress immediately -# some games will update the stat very frequently (with lower & higher values) resulting in a spam of disk writes or overlay notifications -# set this to 1 to save stat progress only on higher progress value, thus avoiding spam of disk writes or overlay notifications -# this has no impact on the stat itself, only the achievement progress of a stat tied to an achievement progress -# also, this has no impact on the functions which directly change stats, achievements, or achievements progress -save_only_higher_stat_achievement_progress=1 -# synchronize user stats/achievements with game servers as soon as possible instead of caching them until the next call to `Steam_RunCallbacks()` -# default=0, not recommended to change it +# 1=enable avatar functionality +# default=0 +enable_account_avatar=1 +# 1=synchronize user stats/achievements with game servers as soon as possible instead of caching them until the next call to `Steam_RunCallbacks()` +# not recommended to enable this +# default=0 immediate_gameserver_stats=0 -# use the proper type of the server list (internet, friends, etc...) when requested by the game -# otherwise, the emu will always return the type 'LAN server' -# default=0, not recommended to change it +# 1=use the proper type of the server list (internet, friends, etc...) when requested by the game +# 0=always return the type of the server list as 'LAN server' +# not recommended to enable this +# default=0 matchmaking_server_list_actual_type=0 -# grab the server details for match making using an actual server query -# default=0, not recommended to change it +# 1=grab the server details for match making using an actual server query +# 0=use the info from the local network messages shared between client/server +# not recommended to enable this, currently breaks some games +# default=0 matchmaking_server_details_via_source_query=0 # very basic crash logger/printer # this is intended to debug some annoying scenarios, and best used with the debug build of the emu +# default= crash_printer_location=./EMU_CRASHES.txt +[main::stats] +# 1=prevent `Steam_User_Stats::FindLeaderboard()` from always succeeding and creating the unknown leaderboard +# not recommended to enable this +# default=0 +disable_leaderboards_create_unknown=0 +# the emu will only save/update stats defined by the user, unknown stats requested or updated by the game will be rejected +# 1=allow unknown stats to be saved/updated +# default=0 +allow_unknown_stats=0 +# the emu has an internal extra functionality which reports an achievement progress when a stat that's tied to an achievement is updated +# also the progress is saved to disk (usual local storage folder for the current appid) so that external applications can watch these updates +# 1=enable this functionality +# only used internally for a stat that's tied to an achievement, the normal achievement progress requests made by the game are not impacted +# some applications tie many stats to achievements, and update these stats very frequently, causing a spam of disk writes and overlay popups +# in that case you can disable this functionality (set the value to 0), but the stat progress won't be saved or displayed in the overlay +# default=1 +stat_achievement_progress_functionality=1 +# whenever a game updates a stat which is tied to an achievement progress, the emu will save that progress immediately +# but some games will update the stat very frequently (with lower & higher values) resulting in a spam of disk writes or overlay notifications +# 0=save any stat achievement progress value (higher or lower) +# 1=save stat achievement progress value only if it is higher than the current one +# this has no impact on the stat itself, only the achievement progress +# also has no impact on the functions which directly change stats, achievements, or achievements progress +# default=1 +save_only_higher_stat_achievement_progress=1 +# the emulator loads the achievements icons is memory, this is needed for APIs like `ISteamUserStats::GetAchievementIcon()` and the overlay +# the loaded icon size is controlled by [overlay::appearance] -> Icon_Size, in the file configs.overlay.ini +# this value controls how many icons to load each iteration when the periodic callback of the emu is triggered +# or when the app/game calls `SteamAPI_RunCallbacks()` +# each achievement has 2 icons, one when it's locked and another when it's unlocked, so a value of 10 means loading 20 icons +# increasing this value will cause a huge startup delay +# -1=disable this functionality (`ISteamUserStats::GetAchievementIcon()` and the overlay won't be able to use icons) +# 0=load the icon in memory only when it's requested +# default=10 +paginated_achievements_icons=10 + [main::connectivity] -# prevent hooking OS networking APIs and allow any external requests -# only used by the experimental builds on Windows +# 1=prevent hooking OS networking APIs and allow any external requests +# only used by the experimental builds on **Windows** +# default=0 disable_lan_only=1 -# disable all steam networking interface functionality - this won't prevent games/apps from making external requests +# 1=disable all Steam networking interface functionality +# this won't prevent games/apps from making external requests # networking related functionality like lobbies or those that launch a server in the background will not work +# default=0 disable_networking=0 # change the UDP/TCP port the emulator listens on, you should probably not change this because everyone needs to use the same port or you won't find yourselves on the network +# default=47584 listen_port=47584 -# pretend steam is running in offline mode; some games that connect to online servers might only work if the steam emu behaves like steam is in offline mode +# 1=pretend Steam is running in offline mode, mainly affects the function `ISteamUser::BLoggedOn()` +# Some games that connect to online servers might only work if the Steam emu behaves like Steam is in offline mode +# default=0 offline=0 -# prevent sharing stats and achievements with any game server, also disables the interface ISteamGameServerStats +# 1=prevent sharing stats and achievements with any game server, this also disables the interface `ISteamGameServerStats` +# default=0 disable_sharing_stats_with_gameserver=0 -# do not send server details to the server browser, only works for game servers +# 1=do not send server details to the server browser, only works for game servers +# default=0 disable_source_query=0 -# enable sharing leaderboards scores with people playing the same game on the same network +# 1=enable sharing leaderboards scores with people playing the same game on the same network +# not ideal and synchronization isn't perfect +# default=0 share_leaderboards_over_network=0 -# prevent lobby creation in steam matchmaking interface +# 1=prevent lobby creation in the Steam matchmaking interface +# default=0 disable_lobby_creation=0 -# attempt to download external HTTP(S) requests made via Steam_HTTP::SendHTTPRequest() inside "steam_settings/http/" +# 1=attempt to download external HTTP(S) requests made via `Steam_HTTP::SendHTTPRequest()` inside 'steam_settings/http/' folder # make sure to: # * set disable_lan_only=1 # * set disable_networking=0 # this will **not** work if the app is using native/OS web APIs -download_steamhttp_requests=1 +# default=0 +download_steamhttp_requests=0 ############################################ # mostly workarounds for specific problems # ############################################ [main::misc] -# force SetAchievement() to always return true +# 1=force `ISteamUserStats::SetAchievement()` to always return true +# this is a workaround for some games that otherwise won't work +# default=0 achievements_bypass=0 -# force the function Steam_HTTP::SendHTTPRequest() to always succeed +# force the function 'Steam_HTTP::SendHTTPRequest()' to always succeed +# default=0 force_steamhttp_success=0 -# env var SteamOverlayGameId breaks Steam Input when the game is added to Steam as a non-steam game +# env var `SteamOverlayGameId` breaks Steam Input when the game is added to Steam as a non-steam game +# 1=don't write this env var, allowing Steam Input to work +# default=1 disable_steamoverlaygameid_env_var=1 -# add many Steam apps to the list of owned DLCs and the emu's list of installed app IDs, useful for many Source-based games +# 1=add many Steam apps to the list of owned DLCs and the emu's list of installed app IDs +# useful for many Source-based games # https://developer.valvesoftware.com/wiki/Steam_Application_IDs # https://developer.valvesoftware.com/wiki/Dedicated_Servers_List +# default=0 enable_steam_preowned_ids=0 +# some Source-based games use the interface `ISteamGameStats` to report some stats +# you can make the emu save this data to a folder +# empty value = don't save anything (default) +# the emu will create the folders if they are missing but the path specified must be writable +# default= +steam_game_stats_reports_dir= diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.overlay.ini b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.overlay.ini index 8e282a59..95e0d7a4 100644 --- a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.overlay.ini +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.overlay.ini @@ -6,33 +6,49 @@ # ################################################################################ # [overlay::general] -# enable the experimental overlay, might cause crashes -enable_experimental_overlay=1 +# 1=enable the experimental overlay, might cause crashes +# default=1 +enable_experimental_overlay=0 # amount of time to wait before attempting to detect and hook the renderer (DirectX, OpenGL, Vulkan, etc...) # default=0 hook_delay_sec=0 # timeout for the renderer detector # default=15 renderer_detector_timeout_sec=15 -# disable the achievements notifications +# 1=disable the achievements notifications +# default=0 disable_achievement_notification=0 -# disable friends invitations and messages notifications +# 1=disable friends invitations and messages notifications +# default=0 disable_friend_notification=0 -# disable showing notifications for achievements progress +# 1=disable showing notifications for achievements progress +# default=0 disable_achievement_progress=0 -# disable any warning in the overlay +# 1=disable any warning in the overlay +# default=0 disable_warning_any=0 -# disable the bad app ID warning in the overlay +# 1=disable the bad app ID warning in the overlay +# default=0 disable_warning_bad_appid=0 -# disable the local_save warning in the overlay +# 1=disable the local_save warning in the overlay +# default=0 disable_warning_local_save=0 +# by default the overlay will attempt to upload the achievements icons to the GPU +# so that they are displayed, in rare cases this might keep failing and cause FPS drop +# 0=prevent the overlay from attempting to upload the icons periodically, +# in that case achievements icons won't be displayed +# default=1 +upload_achievements_icons_to_gpu=1 [overlay::appearance] -# load custom TrueType font from an absolute or relative path -# relative paths will be looked up inside the local folder 'steam_settings/fonts' first, -# if not found, it will be looked up inside the global folder 'GSE Settings/settings/fonts' -#Font_Override=Roboto-Medium.ttf -# global font size - for built-in font, multiple of 16 is recommended, e.g. 16, 32, etc +# load custom TrueType font from a path, it could be absolute, or relative +# relative paths will be looked up inside the local folder 'steam_settings/fonts/' first, +# if that wasn't found, it will be looked up inside the global folder 'GSE Saves/settings/fonts/' +# default= +Font_Override= +# global font size +# for built-in font, multiple of 16 is recommended, e.g. 16 32... +# default=16.0 Font_Size=16.0 # achievement icon size @@ -50,26 +66,26 @@ Notification_A=1.0 # notifications corners roundness Notification_Rounding=10.0 - # horizontal (x) and vertical (y) margins for the notifications Notification_Margin_x=5.0 Notification_Margin_y=5.0 -# duration of notification animation in seconds - set to 0 to disable +# duration/timing for various notification types (in seconds) +# duration of notification animation in seconds. Set to 0 to disable Notification_Animation=0.35 - # duration of achievement progress indication Notification_Duration_Progress=6.0 # duration of achievement unlocked -Notification_Duration_Achievement=6.0 +Notification_Duration_Achievement=7.0 # duration of friend invitation Notification_Duration_Invitation=8.0 # duration of chat message Notification_Duration_Chat=4.0 # format for the achievement unlock date/time, limited to 79 characters -# if the output formatted string exceeded this limit, the built-in format will be used +# if the output formatted string exceeded this limit, the builtin format will be used # look for the format here: https://en.cppreference.com/w/cpp/chrono/c/strftime +# default=%Y/%m/%d - %H:%M:%S Achievement_Unlock_Datetime_Format=%Y/%m/%d - %H:%M:%S # main background when you press shift+tab @@ -109,4 +125,3 @@ PosInvitation=top_right # position of chat messages PosChatMsg=top_center # ############################# # - diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.user.ini b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.user.ini index b22a1af7..b903c997 100644 --- a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.user.ini +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.user.ini @@ -4,10 +4,14 @@ [user::general] # user account name -account_name=goldberg -# Steam64 format +# default=gse_user +account_name=gse_user +# your account ID in Steam64 format +# if the specified ID is invalid, the emu will ignore it and generate a proper one +# default=randomly generated by the emu only once and saved in the global settings account_steamid=76561197960287930 # the language reported to the app/game +# this must exist in 'supported_languages.txt', otherwise it will be ignored by the emu # look for the column 'API language code' here: https://partner.steamgames.com/doc/store/localization/languages # default=english language=english @@ -18,9 +22,12 @@ ip_country=US [user::saves] # when this is set, it will force the emu to use the specified location instead of the default global location -# path could be absolute, or relative to the location of the .dll/.so, leading and trailing whitespaces are trimmed +# path could be absolute, or relative to the location of the .dll/.so +# leading and trailing whitespaces are trimmed # when this option is used, the global settings folder is completely ignored, allowing a full portable behavior -#local_save_path=GSE Saves -# name of the default global folder used to store save data, leading and trailing whitespaces are trimmed +# default= +local_save_path= +# name of the base folder used to store save data, leading and trailing whitespaces are trimmed +# only useful if 'local_save_path' isn't used # default=GSE Saves saves_folder_name=GSE Saves diff --git a/tools/migrate_gse/bat/_pack_api.bat b/tools/migrate_gse/bat/_pack_api.bat new file mode 100644 index 00000000..00b90537 --- /dev/null +++ b/tools/migrate_gse/bat/_pack_api.bat @@ -0,0 +1,103 @@ +@echo off +setlocal EnableDelayedExpansion +cd /d "%~dp0" + +set /a "MAX_THREADS=2" +if defined NUMBER_OF_PROCESSORS ( + :: use 70% + set /a "MAX_THREADS=%NUMBER_OF_PROCESSORS% * 70 / 100" + if %MAX_THREADS% lss 1 ( + set /a "MAX_THREADS=1" + ) +) + +set "ROOT=%cd%" +set "BUILD_DIR=..\..\..\build\win\vs2022" +set "OUT_DIR=..\build\package\win" + +if not exist "%BUILD_DIR%\release\" ( + 1>&2 echo:release build target folder wasn't found + goto :end_script_with_err +) +if not exist "%BUILD_DIR%\debug\" ( + 1>&2 echo:debug build target folder wasn't found + goto :end_script_with_err +) + +set /a "PKG_EXE_MEM_PERCENT=90" +set /a "PKG_EXE_DICT_SIZE_MB=384" +set "PKG_EXE=..\..\..\third-party\deps\win\7za\7za.exe" +if not exist "%PKG_EXE%" ( + 1>&2 echo:packager wasn't found + goto :end_script_with_err +) + +:::::::::::::::::::::::::::::::::::::::::: + +echo:// packing latest steam_api.dll for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_api" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_api\release" +mkdir "..\_DEFAULT\0\steam_api\debug" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api\release\steam_api.dll"* +xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api.dll"* +set "TARGET_DIR=%BUILD_DIR%\debug" +xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api\debug\steam_api.dll"* +rem xcopy /y "%TARGET_DIR%\experimental\x32\steam_api.dll" "..\_DEFAULT\0\steam_api.dll"* rem do not overwrite dll with debug version + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_api.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +echo:// packing latest steam_api64.dll for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_api64" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_api64\release" +mkdir "..\_DEFAULT\0\steam_api64\debug" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64\release\steam_api64.dll"* +xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64.dll"* +set "TARGET_DIR=%BUILD_DIR%\debug" +xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64\debug\steam_api64.dll"* +rem xcopy /y "%TARGET_DIR%\experimental\x64\steam_api64.dll" "..\_DEFAULT\0\steam_api64.dll"* rem do not overwrite dll with debug version + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_api64.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +:::::::::::::::::::::::::::::::::::::::::: + +goto :end_script + +:end_script + endlocal + exit /b 0 + +:end_script_with_err + endlocal + exit /b 1 diff --git a/tools/migrate_gse/bat/_pack_exe.bat b/tools/migrate_gse/bat/_pack_exe.bat new file mode 100644 index 00000000..7ec6bf65 --- /dev/null +++ b/tools/migrate_gse/bat/_pack_exe.bat @@ -0,0 +1,95 @@ +@echo off +setlocal EnableDelayedExpansion +cd /d "%~dp0" + +set /a "MAX_THREADS=2" +if defined NUMBER_OF_PROCESSORS ( + :: use 70% + set /a "MAX_THREADS=%NUMBER_OF_PROCESSORS% * 70 / 100" + if %MAX_THREADS% lss 1 ( + set /a "MAX_THREADS=1" + ) +) + +set "ROOT=%cd%" +set "BUILD_DIR=..\..\..\build\win\vs2022" +set "OUT_DIR=..\build\package\win" + +if not exist "%BUILD_DIR%\release\" ( + 1>&2 echo:release build target folder wasn't found + goto :end_script_with_err +) +if not exist "%BUILD_DIR%\debug\" ( + 1>&2 echo:debug build target folder wasn't found + goto :end_script_with_err +) + +set /a "PKG_EXE_MEM_PERCENT=90" +set /a "PKG_EXE_DICT_SIZE_MB=384" +set "PKG_EXE=..\..\..\third-party\deps\win\7za\7za.exe" +if not exist "%PKG_EXE%" ( + 1>&2 echo:packager wasn't found + goto :end_script_with_err +) + +:::::::::::::::::::::::::::::::::::::::::: + +echo:// packing latest generate_interfaces.exe for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\tools\generate_interfaces\generate_interfaces_x32.exe" "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces\generate_interfaces.exe"* +xcopy /y "%TARGET_DIR%\tools\generate_interfaces\generate_interfaces_x64.exe" "..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces\generate_interfaces64.exe"* + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_misc\tools\generate_interfaces\generate_interfaces.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +echo:// packing latest lobby_connect.exe for generate_emu_config + +set "ACHIVE_DIR=..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect" + +if exist "%ACHIVE_DIR%\" ( + rmdir /s /q "%ACHIVE_DIR%" +) +mkdir "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect" + +set "TARGET_DIR=%BUILD_DIR%\release" +xcopy /y "%TARGET_DIR%\tools\lobby_connect\lobby_connect_x32.exe" "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect\lobby_connect.exe"* +xcopy /y "%TARGET_DIR%\tools\lobby_connect\lobby_connect_x64.exe" "..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect\lobby_connect64.exe"* + +set "ACHIVE_FILE=..\_DEFAULT\0\steam_misc\tools\lobby_connect\lobby_connect.7z" +if exist "%ACHIVE_FILE%" ( + del /f /q "%ACHIVE_FILE%" +) + +call "%PKG_EXE%" a "%ACHIVE_FILE%" "%ACHIVE_DIR%\*" -t7z -xr^^!*.lib -xr^^!*.exp -slp -ssw -mx -myx -mmemuse=p%PKG_EXE_MEM_PERCENT% -ms=on -mqs=off -mf=on -mhc+ -mhe- -m0=LZMA2:d=%PKG_EXE_DICT_SIZE_MB%m -mmt=%MAX_THREADS% -mmtf+ -mtm- -mtc- -mta- -mtr+ || ( + goto :end_script_with_err +) + +rmdir /s /q "%ACHIVE_DIR%" + +:::::::::::::::::::::::::::::::::::::::::: + +goto :end_script + +:end_script + endlocal + exit /b 0 + +:end_script_with_err + endlocal + exit /b 1 diff --git a/tools/migrate_gse/rebuild_win.bat b/tools/migrate_gse/rebuild_win.bat index 57791f9b..996d5a9e 100644 --- a/tools/migrate_gse/rebuild_win.bat +++ b/tools/migrate_gse/rebuild_win.bat @@ -34,8 +34,11 @@ pyinstaller "main.py" --distpath "%OUT_DIR%" -y --clean --onedir --name "migrate ) call "%SIGNER_TOOL%" "%OUT_DIR%\migrate_gse\migrate_gse.exe" +call ".\bat\_pack_api.bat" +call ".\bat\_pack_exe.bat" + xcopy /s /y /e "post_build" "%out_dir%\migrate_gse\" -xcopy /s /y /e "_DEFAULT" "%out_dir%\migrate_gse\_DEFAULT" +xcopy /s /y /e "_DEFAULT" "%out_dir%\migrate_gse\_DEFAULT\" copy /y "README.md" "%out_dir%\migrate_gse\"