diff --git a/.github/workflows/migrate_gse-build-win.yml b/.github/workflows/migrate_gse-build-win.yml index 54b1b230..673d33eb 100644 --- a/.github/workflows/migrate_gse-build-win.yml +++ b/.github/workflows/migrate_gse-build-win.yml @@ -21,10 +21,10 @@ jobs: runs-on: windows-2022 steps: - - name: Set up Python 3.10 + - name: Set up Python 3.12 uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" ### on Windows Git will auto change line ending to CRLF, not preferable - name: Ensure LF line ending diff --git a/CHANGELOG.md b/CHANGELOG.md index ac7c46a3..acf823fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,57 @@ -* **[Detanup01]** Fix GetISteamGenericInterface when asking for Interface: STEAMTIMELINE_INTERFACE_V001 -* **[KGHTW]** Fixing Steam Datagram Error. + +## 2024/7/29 + + +* **[alex47exe]** major overhaul of **generate_emu_config** - custom configs, proper ini parsing, better logging and error handling, helper tools: + + * add `-def1` ... `-def5` arguments, which can be used to generate your preferred custom config + if no `-def` argument is provided, `-def1` will be used by default, to automatically copy from the following folders: + * `.\_DEFAULT\0` ............... essential emu files, like latest GSE dlls (*steam_api.dll* and *steam_api64.dll*) + * `.\_DEFAULT\1` ............... other GSE files and folders, including default ini files + * `.\_DEFAULT\` ... other GSE files and folders, but only for the current ``, if the folder exists + * (Windows only) add some useful helper tools, written in *AutoIt3*: + + * **gse_acw_helper.exe** - add the required achievements schema db files for *Achievement Watcher*, if .\steam_misc\extra_acw\extra_acw.zip file exists (if generated by `generate_emu_config.exe -acw `) + * **gse_debug_switch.exe** - automatically switch between release and debug versions of the emulator, if *steam_api.7z* / *steam_api64.7z* file exists (or *steamclient.7z* / *steamclient64.7z*, if you use the steamclient version) + paths to release and debug files inside 7z, can be customized in .\steam_misc\tools\au3\scripts\gse_debug_switch.ini + * **gse_generate_interfaces.exe** - simple x64-x86 launcher for *generate_interfaces.exe* + it also writes all found steam interfaces to CODEX *steam_emu.ini* (if generated by `generate_emu_config -cdx `) + make sure to name your original dll to one of these formats, so it can automatically find its interfaces: + * `valve_api.dll / valve_api64.dll` + * `steam_api.dll.bak / steam_api64.dll.bak` or `steam_api.dll.org / steam_api64.dll.org` + * `steam_api.bak / steam_api64.bak` or `steam_api.org / steam_api64.org` + * `steam_api_orig.dll / steam_api64_orig.dll` or `steam_api_legit.dll / steam_api64_legit.dll` + * **gse_lobby_connect.exe** - simple x64-x86 launcher for *lobby_connect.exe* + * new folder structure, compatible with current and future helper tools --- default arguments are `-acw -cdx -clr ` + NEVER delete `.\steam_misc\app_backup`, `.\steam_misc\app_info`, `.\steam_misc\tools` and `.\steam_settings` folders + MIGHT need `.\steam_misc\extra_acw` and `.\steam_misc\extra_cdx` for compatibility with Achievement Watcher and CODEX + * add `-scx` argument to automatically download images / videos for trading cards, backgrounds, badges, emoticons and other tradable items + unfortunately I couldn't find any direct steam api method to download the files, so I had to write a rudimentary web scrapper to extract the download links from a third-party website, hence the *scx_gen.py* script might need updating in the future if the website design changes + * download screenshots and videos: + + * download thumbnails for both screenshots and videos, and compress them to `.zip` files + * screenshots and videos are now numbered from first to last published, as in the Steam store page + * add `-vids_low` / `-vids_max` arguments to download all videos, in low and / or high quality + * create / update .\\*top_owners_ids.txt* when .\\*top_owners_ids.html* is present + * generate controller action sets txt files for all found controller vdf configs, and zip them inside .\steam_misc\app_backup\app_backup.zip + by default, the emu supports only `xboxone` and `xbox360` controller configs, though if the're are any issues with the default supported controller action sets inside .\steam_settings\controller folder, you could try to unpack and overwrite action sets for other unsupported controller configs + * (Windows only) add *AdvancedRun* launchers (cmd console + silent) for `.bat` files and `.py` scripts +* **[alex47exe]** major overhaul of **migrate_gse** - uses the same `.\_DEFAULT\0` and `.\_DEFAULT\1` folder structure for default configs + it can convert old `.txt` format to `.ini` format, minus *branches.json*, which would require using *top_owners_ids.txt* and some login code from **generate_emu_config**, which should actually be used to properly generate the config files, instead of converting from the old `.txt` format +* **[alex47exe]** *generate_interfaces.exe* - find all Steam Interfaces instead of only old ones +the emu will ignore the ones it doesn't require, while we'll have the complete list to write it to CODEX *steam_emu.ini* +* **[alex47exe]** *lobby_connect.exe* - improve cmd console text alignment +* **[alex47exe]** `mods_img` instead of `mod_images` (better folder consistency), better example for `mods_img`, minor tweaks to `.ini` and `.md` files + +--- + +## 2024/7/28 + +* **[Detanup01]** fix GetISteamGenericInterface() when asking for Interface `STEAMTIMELINE_INTERFACE_V001` +* **[KGHTW]** fix Steam Datagram Error + +--- ## 2024/7/7 @@ -11,8 +62,8 @@ * **[qingchunnh]** update Chinese translations for the overlay * update the tool `generate_emu_config` to generate a new file `steam_settings/branches.json` which contain all info about the branches of the game, needed by SDK v1.60 this json file could be put inside the global settings folder, but **not recommended**, it is meant to be generated per-game basis -* deprecate the setting `build_id` in `configs.app.ini`, the user selected branch (`branch_name`) is now used to grab the build id of that branch from `branches.json`. - if no `branch_name` is specified, the emu will use the default branch called `public`. +* deprecate the setting `build_id` in `configs.app.ini`, the user selected branch (`branch_name`) is now used to grab the build id of that branch from `branches.json` + if no `branch_name` is specified, the emu will use the default branch called `public` if `branches.json` is missing the `public` branch, the emu will force add it in memory with a default build id = 10 * add new properties to `mods.json`: - `min_game_branch` @@ -21,11 +72,10 @@ unclear how they're used for now, but they're introduced in SDK v1.60 * add a somewhat useless/stub implementation for the new interface `ISteamTimeline001` (introduced in SDK v1.60), could be extended later to interact with the built-in overlay or save the info to disk for external applications to listen to events -* add a new option `allow_unknown_stats` in `configs.main.ini` to allow games to change unknown stats. +* add a new option `allow_unknown_stats` in `configs.main.ini` to allow games to change unknown stats the emu by default rejects any changes to a stat not mentioned inside `steam_settings/stats.txt`, this option allows these changes -* add a new option `save_only_higher_stat_achievement_progress` in `configs.main.ini` and enable it by default. - this option will prevent the emu from updating the progress of any achievement due to a stat change/update, if the new value is less than or equal the current one. - this solves an overlay spam problem and avoids *some* useless disk write operations. +* add a new option `save_only_higher_stat_achievement_progress` in `configs.main.ini` and enable it by default + this option will prevent the emu from updating the progress of any achievement due to a stat change/update, if the new value is less than or equal the current one - this solves an overlay spam problem and avoids *some* useless disk write operations unfortunately some games abuse stats and update them a lot during gameplay with useless and disposable values, this will cause a lot of disk write operations and cannot be avoided unless you remove the definition of that stat from `steam_settings/stats.txt`, or avoiding that definition file altogether and forget about stats * fix conditions for app/DLCs ownership APIs: @@ -47,8 +97,8 @@ ## 2024/6/21 * fix the conditions for achievement progress indication when a game updates a stat which is tied to an achievement - now the user achievements will be updated and saved, and an overlay notification will be triggered. - works with **[Achievement Watcher by xan105](https://github.com/xan105/Achievement-Watcher)** and the built-in overlay. + now the user achievements will be updated and saved, and an overlay notification will be triggered + works with **[Achievement Watcher by xan105](https://github.com/xan105/Achievement-Watcher)** and the built-in overlay you need `stats.txt` and `achievements.json` inside your local `steam_settings` folder for this feature to work properly * fix an old problem where games would crash on exit if the overlay was enabled, more prominent in `DirectX 12` games, also set the overlay hook procedure to an empty function before cleaning up the overlay * remove an invalid condition when resetting stats, only write to disk and share values with any gameserver if the stat value isn't already the default @@ -63,12 +113,12 @@ # duration of achievement progress indication Notification_Duration_Progress=6.0 # duration of achievement unlocked - Notification_Duration_Achievement=7.0 + Notification_Duration_Achievement=6.0 # duration of friend invitation Notification_Duration_Invitation=8.0 # duration of chat message Notification_Duration_Chat=4.0 - ``` + ``` you can set these values in the global settings, just like all the other settings in all `.ini` files you can also override them per-game by modifying your local `steam_settings/configs.overlay.ini` * for Windows `ColdClientLoader`: if the file `load_order.txt` is used, then only load the files mentioned with their respective order, otherwise load all valid PE files as usual @@ -94,22 +144,21 @@ * **[Detanup01]** add `premake` build scripts, allowing the project to be built with different toolsets with ease on different platforms for example the project could be built with `Visual Studio` on Windows, or via the `make` tool on Linux -* **[schmurger]** add progress bar to the achievements in the overlay, only for achievements that are not earned yet. - also implement notifications for these progress indications (whenever the game indicates a new progress). +* **[schmurger]** add progress bar to the achievements in the overlay, only for achievements that are not earned yet + also implement notifications for these progress indications (whenever the game indicates a new progress) you can disable the achievement progress notifications via `disable_achievement_progress` inside `configs.overlay.ini` * **[schmurger]** implement the function `Steam_User_Stats::GetAchievementProgressLimits()` * **[Detanup01]** add missing interfaces `ISteamScreenshot` `v001` and `v002` also fix lots of build warnings in Visual Studio -* third-party dependencies could now be built with a `premake` script, offering more flexibility. +* third-party dependencies could now be built with a `premake` script, offering more flexibility for example you can choose to extract or build certain libraries only, you can also build 32-bit or 64-bit separately --- - **check the updated readme** - **and re-clone the repo recursively again!** + **check the updated readme and re-clone the repo recursively again!** --- - + * enable controller support by default for the regular API library * fix an old buffer overrun bug in `Steam_User_Stats::UpdateAvgRateStat()` * fix an old bug in the shutdown functions, now they will refuse incorrect requests like the original API library, solving a crash in some games @@ -131,9 +180,9 @@ * add new button to the overlay `toggle user info` to show/hide user info, also make user info hidden by default * make all overlay popups toggle-able, clicking its button another time will hide or show the popup, depending on its previous state * allow `Steam_User_Stats::ClearAchievement()` to reflect the status in the overlay -* initial support for building with `MSYS2` on Windows. - **this is still highly experimental and non-functional, this is more of tech demo at the moment** - the original SDK is created as `MSVC` library, and all games on Windows link with it. +* initial support for building with `MSYS2` on Windows + **This is still highly experimental and non-functional, this is more of tech demo at the moment** + The original SDK is created as `MSVC` library, and all games on Windows link with it MinGW toolchain has a completely different **ABI** and the output binary will **not work** * deprecated and removed the special Git branches `ci-build-*`, they were intended for automation but no longer maintained @@ -216,10 +265,10 @@ - `configs.overlay.ini`: configurations of the overlay they could be placed inside the local `steam_settings` folder, - or inside the new global settings folder `GSE Saves/settings`, located at `%appdata%\GSE Saves\settings\` on Windows for example. - you can create a global `.ini` file `GSE Saves/settings/config.xxx.ini` for the common options, and another local one `steam_settings/config.xxx.ini` for the game-specific options, and the emu will merge them. + or inside the new global settings folder `GSE Saves/settings`, located at `%appdata%\GSE Saves\settings\` on Windows for example + you can create a global `.ini` file `GSE Saves/settings/config.xxx.ini` for the common options, and another local one `steam_settings/config.xxx.ini` for the game-specific options, and the emu will merge them - To avoid confusion, the global saves folder is changed to be `GSE Saves` by default. + To avoid confusion, the global saves folder is changed to be `GSE Saves` by default * new tool `migrate_gse` to convert either your global `settings` folder, or your local `steam_settings` folder from the old format to the new one - run the tool without arguments to let it convert the global settings folder @@ -249,7 +298,7 @@ - `SteamEnv` - `SteamPath` - --- +--- ## 2024/4/11 (2) @@ -290,7 +339,7 @@ --- * **[breaking]** introduced a new config file `enable_experimental_overlay.txt`, which deprecates the config file `disable_overlay.txt` - in many occasions this feature was a source of crashes, so it's better to make it an opt-in option. + in many occasions this feature was a source of crashes, so it's better to make it an opt-in option otherwise, the `experimental` and `Cold Client` builds of the emu will crash by default on startup for some apps/games --- @@ -324,7 +373,7 @@ - allow loading a custom font whose location is defined in `overlay_appearance.txt` fonts with relative paths will be loaded from `steam_settings\fonts` * allow sharing leaderboards scores with connected players, adjust players ranks locally, and sort entries as needed by the game, suggested by **[M4RCK5]** - this will only work when people connected on the same network are playing the same game, once they disconnect their leaderboard entry will be lost (no data persistence for other players), also it doesn't work well with VPN clients. + this will only work when people connected on the same network are playing the same game, once they disconnect their leaderboard entry will be lost (no data persistence for other players), also it doesn't work well with VPN clients this behavior could be enabled via `share_leaderboards_over_network.txt` * implemented the missing interface `ISteamGameServerStats`, allowing game servers to exchange user stats & achievements with players could be disabled via `disable_sharing_stats_with_gameserver.txt`, @@ -332,7 +381,7 @@ * for windows: updated stub drm patterns and added a workaround for older variants, this increases the compatibility, but makes it easier to be detected * for windows: new stub/mock dll `GameOverlayRenderer(64).dll` for the experimental cold client setup, - some apps verify the existence of this dll, either on disk, or inside their memory space. + some apps verify the existence of this dll, either on disk, or inside their memory space **not recommended** to ignore it * separated the config file `disable_leaderboards_create_unknown.txt`, previously it was tied to `leaderboards.txt`, by default the emu will create any unknown leaderboards, you can disable this behavior with this file @@ -539,8 +588,8 @@ * **[Kola124]** enhanced the settings parser to detect primary and preview mod files sizes automatically + use the base Steam URL by default for workshop URL + auto calculate the mod `score` from up/down votes also thanks to **[BTFighter]** for providing logs -* **Breaking change** mod preview image file must exist in `steam_settings\mod_images\` -* an enhancement to the settings parser to attempt to auto detect mods when `mods.json` is not present, with the same behavior as when the json file was created. +* **Breaking change** mod preview image file must exist in `steam_settings\mods_img\` +* an enhancement to the settings parser to attempt to auto detect mods when `mods.json` is not present, with the same behavior as when the json file was created this works for mods with only 1 primary file and only 1 preview file * fixed the generated path of mod `preview_url`, previously it would contain back slashes `\` on Windows * use last week epoch as the default time for mods dates (created, added, etc...) @@ -576,9 +625,9 @@ ## 2024/1/3 -* added a new option to the Windows version of the client loader to aid in debugging. +* added a new option to the Windows version of the client loader to aid in debugging the option is called `ResumeByDebugger`, and setting it to `1` will prevent the loader from -auto resuming the main app thread, giving you a chance to attach your debugger. +auto resuming the main app thread, giving you a chance to attach your debugger * make the script `generate_emu_config` generate an empty `DLC.txt` if the app has no DLCs * windows build: sign each file after build with a self-signed generated certificate + note in the release readme regarding false-positives * windows build: note in readme about Windows SDK @@ -600,13 +649,13 @@ auto resuming the main app thread, giving you a chance to attach your debugger. * `Steam_User::GetAuthSessionTicket()` * `Steam_User::GetAuthTicketForWebApi()` - this allows the emu to generate new ticket data, and additionally the GC token. + this allows the emu to generate new ticket data, and additionally the GC token check the new config files `new_app_ticket.txt` and `gc_token.txt` in the `steam_settings` folder * **[Detanup01]** fixed print issues in some places * **[remelt]** use the `index` argument to grab the preview URL from UGC query result, fixed by: https://cs.rin.ru/forum/viewtopic.php?p=2964432#p2964432 * **[remelt]** allow overriding mod `path` & mod `preview_url` in the `mods.json` file, suggested by: https://cs.rin.ru/forum/viewtopic.php?p=2964432#p2964432 * allow setting the mod `score` in the `mods.json` -* when the mod `preview_url` is not overridden, don't set it automatically if `preview_filename` was empty, otherwise the `preview_url` will be pointing to the entire `mod_images` folder, like: `file://C:/my_game/steam_settings/mod_images/` +* when the mod `preview_url` is not overridden, don't set it automatically if `preview_filename` was empty, otherwise the `preview_url` will be pointing to the entire `mods_img` folder, like: `file://C:/my_game/steam_settings/mods_img/` instead set it to an empty string * updated `mods.EXAMPLE.json` * added 2 new config files `is_beta_branch.txt` and `force_branch_name.txt` @@ -631,8 +680,8 @@ auto resuming the main app thread, giving you a chance to attach your debugger. * added licenses & sources of all extrnal libraries + added a new cryptography library `Mbed TLS` you have to rebuilt the deps * deprecated the separate/dedicated cleanup script for Windows, it's now inlined in the main build script -* For Windows build script: deprecated `low perf` & `win xp` options -* For Linux build script: deprecated `low perf` option +* for Windows build script: deprecated `low perf` & `win xp` options +* for Linux build script: deprecated `low perf` option * restored all original but unused repo files into their separate folder * lots of refactoring and relocation in the source repo: - all build stuff will be inside `build` folder @@ -813,7 +862,7 @@ auto resuming the main app thread, giving you a chance to attach your debugger. - declare the new API: SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences() - (needs revise) update signature of the API: SteamAPI_ISteamUGC_SetItemTags() to add the new argument this will potentially break compatibility with older version of the flat API - //////////////////// + //////////////////// - declare new interface getter: SteamAPI_SteamRemotePlay_v002() - declare the new API: SteamAPI_ISteamRemotePlay_BStartRemotePlayTogether() //////////////////// @@ -829,7 +878,7 @@ auto resuming the main app thread, giving you a chance to attach your debugger. - implement the new API: SteamAPI_ISteamUGC_GetUserContentDescriptorPreferences() - (needs revise) update signature of the API: SteamAPI_ISteamUGC_SetItemTags() to use the new argument this will potentially break compatibility with older version of the flat API - //////////////////// + //////////////////// - implement new interface getter SteamAPI_SteamRemotePlay_v002() - implement the new API: SteamAPI_ISteamRemotePlay_BStartRemotePlayTogether() //////////////////// @@ -920,6 +969,8 @@ auto resuming the main app thread, giving you a chance to attach your debugger. - without admin, run `build_win_deps.bat`, this will do the following: + unpack the third party libraries (protobuf, zlib, etc...) from the folder `third-party` to `build-win-deps` + build the unpacked libraries from `build-win-deps` + + you only need this step once, additionally you can pass these arguments to the script: + `-verbose`: force cmake to display extra info @@ -947,7 +998,7 @@ auto resuming the main app thread, giving you a chance to attach your debugger. + `+lowperf`: (UNTESTED) for 32-bit build only, pass the argument `/arch:IA32` to the compiler + `-j `: force build operations to use `` parallel jobs - + * added all required third-party libraries inside the folder `third-party` * greatly enhanced the functionality of the `generate_emu_config` script + add a build script @@ -958,8 +1009,7 @@ auto resuming the main app thread, giving you a chance to attach your debugger. + inside the folder of the built executable + create a file called `my_login.txt`, then add your username in the first line, and your password in the second line + run the .exe file without any args to display all available options - - + * revert the changes to `SetProduct()` and `SetGameDescription()` * in `steam_overlay.cpp`, in `AddAchievementNotification()`: prefer original paths of achievements icons first, then fallback to `achievement_images/` diff --git a/CREDITS.md b/CREDITS.md index 041886a8..9b0285d2 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -441,12 +441,12 @@ terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. - + b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". - + c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 @@ -454,7 +454,7 @@ terms of section 4, provided that you also meet all of these conditions: regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - + d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your @@ -481,7 +481,7 @@ in one of these ways: (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. - + b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as @@ -493,13 +493,13 @@ in one of these ways: more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. - + c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. - + d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no @@ -512,7 +512,7 @@ in one of these ways: Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. - + e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no @@ -592,21 +592,21 @@ that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or - + b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or - + c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or - + d) Limiting the use for publicity purposes of names of licensors or authors of the material; or - + e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or - + f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for @@ -847,7 +847,7 @@ Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest @@ -861,17 +861,17 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . @@ -1234,12 +1234,12 @@ above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. - + b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. - + c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an @@ -1278,14 +1278,14 @@ Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - + b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, - + c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you @@ -1408,17 +1408,17 @@ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR + REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, + INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING + OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED + TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY + YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest @@ -1432,17 +1432,17 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -1679,33 +1679,34 @@ CMake was initially developed by Kitware with the following sponsorship: ~~~~~~~~~~~ License for use and distribution ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + Copyright (C) 1999-2023 Igor Pavlov. - + 7-Zip Extra files are under the GNU LGPL license. - - Notes: - You can use 7-Zip Extra on any computer, including a computer in a commercial - organization. You don't need to register or pay for 7-Zip. +​ +​ Notes: +​ You can use 7-Zip Extra on any computer, including a computer in a commercial +​ organization. You don't need to register or pay for 7-Zip. +​ It is allowed to digitally sign DLL files included into this package with arbitrary signatures of third parties." GNU LGPL information -------------------- - + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. - + This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You can receive a copy of the GNU Lesser General Public License from http://www.gnu.org/ @@ -1955,7 +1956,3 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Sean Middleditch Copyright (C) 2010 Sean Middleditch LICENSE: MIT/X - - -### Template License -License Here diff --git a/README.md b/README.md index 28a3f44d..dbbbd3ed 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ -## :large_orange_diamond: **This is a fork** +## :large_orange_diamond: **Goldberg Steam Emu** Fork of https://gitlab.com/Mr_Goldberg/goldberg_emulator -Fork originally make by wizark952. - -This is a latest version of his work. +Fork originally make by wizark952. This is a latest version of his work. ### Feel free to make a PR. @@ -41,10 +39,6 @@ You can find helper guides, scripts, and tools here in this wiki: https://github You can also find instructions here in [README.release.md](./post_build/README.release.md) --- ---- - -
- # **Compiling** ## One time setup ### **Cloning the repo** @@ -80,7 +74,7 @@ You can also find instructions here in [README.release.md](./post_build/README.r * Using `MSYS2` **this is currently experimental and will not work due to ABI differences**: https://www.msys2.org/
steps - + * To build 64-bit binaries use either the [environment](https://www.msys2.org/docs/environments/) `UCRT64` or `MINGW64` then install the GCC toolchain `UCRT64` ```shell @@ -93,8 +87,8 @@ You can also find instructions here in [README.release.md](./post_build/README.r * To build 32-bit binaries use the environment `MINGW32` then install the GCC toolchain ```shell pacman -S mingw-w64-i686-gcc - ``` - + ``` +
* Python 3.10 or above: https://www.python.org/downloads/windows/ After installation, make sure it works @@ -154,7 +148,7 @@ Open CMD in the repo folder, then run the following * To build using `MSYS2` **this is currently experimental and will not work due to ABI differences**
steps - + *(Optional)* In both cases below, you can use `Clang` compiler instead of `GCC` by running these 2 commands in the same terminal instance ```shell export CC="clang" @@ -170,7 +164,7 @@ Open CMD in the repo folder, then run the following export CMAKE_GENERATOR="MSYS Makefiles" ./third-party/common/win/premake/premake5.exe --file=premake5-deps.lua --32-build --all-ext --all-build --verbose --os=windows gmake2 ``` - +
This will: @@ -201,29 +195,29 @@ Open CMD in the repo folder, then run the following * For `Visual Studio 2022` ```batch third-party\common\win\premake\premake5.exe --file=premake5.lua --genproto --os=windows vs2022 - ``` + ``` You can then go to the folder `build\project\vs2022\win` and open the produced `.sln` file in Visual Studio. Or, if you prefer to do it from command line, open the `Developer Command Prompt for VS 2022` inside the above folder, then: ```batch msbuild /nologo /v:n /p:Configuration=release,Platform=Win32 gbe.sln - + msbuild /nologo /v:n /p:Configuration=release,Platform=x64 gbe.sln ``` * For `MSYS2` **this is currently experimental and will not work due to ABI differences**
steps - + ```shell ./third-party/common/win/premake/premake5.exe --file=premake5.lua --genproto --os=windows gmake2 - + cd ./build/project/gmake2/win ``` *(Optional)* You can use `Clang` compiler instead of `GCC` by running these 2 commands in the current terminal instance ```shell export CC="clang" export CXX="clang++" - ``` + ``` * 64-bit build (`UCRT64` or `MINGW64`) ```shell make config=release_x64 -j 8 all @@ -232,11 +226,11 @@ Open CMD in the repo folder, then run the following ```shell make config=release_x32 -j 8 all ``` - To see all possible build targets + To see all possible build targets ```shell make help ``` - +
This will build a release version of the emu in the folder `build\win\\release` @@ -249,22 +243,22 @@ Open a terminal in the repo folder, then run the following ```shell ./third-party/common/linux/premake/premake5 --file=premake5.lua --genproto --os=linux gmake2 cd ./build/project/gmake2/linux -``` +``` *(Optional)* You can use `Clang` compiler instead of `GCC` by running these 2 commands in the current terminal instance ```shell export CC="clang" export CXX="clang++" -``` +``` Then run the following ```shell make config=release_x32 -j 8 all make config=release_x64 -j 8 all -``` +``` To see all possible build targets ```shell make help -``` +``` This will build a release version of the emu in the folder `build/linux//release` An example script `build_linux_premake.sh` is available, check it out @@ -292,12 +286,12 @@ Open bash terminal then: 1. Create python virtual environemnt and install the required packages/dependencies ```shell sudo ./recreate_venv_linux.sh - ``` + ``` You might need to edit this script to use a different python version. Find this line and change it: ```shell python_package="python3.12" - ``` + ``` 2. Build the tool using `pyinstaller` ```shell ./rebuild_linux.sh diff --git a/dev.notes/README.md b/dev.notes/README.md index 50b05ecf..b03546d2 100644 --- a/dev.notes/README.md +++ b/dev.notes/README.md @@ -1 +1,2 @@ -Explanations for random thoughts and ideas. +Explanations for random thoughts and ideas. + diff --git a/dll/settings_parser.cpp b/dll/settings_parser.cpp index b8e70c4d..d2f8c57b 100644 --- a/dll/settings_parser.cpp +++ b/dll/settings_parser.cpp @@ -963,7 +963,7 @@ static std::string get_mod_preview_url(const std::string &previewFileName, const } else { auto settings_folder = std::string(Local_Storage::get_game_settings_path()); std::replace(settings_folder.begin(), settings_folder.end(), '\\', '/'); - return "file://" + settings_folder + "mod_images/" + mod_id + "/" + previewFileName; + return "file://" + settings_folder + "mods_img/" + mod_id + "/" + previewFileName; } } @@ -972,7 +972,7 @@ static void try_parse_mods_file(class Settings *settings_client, Settings *setti { for (auto mod = mod_items.begin(); mod != mod_items.end(); ++mod) { try { - std::string mod_images_fullpath = Local_Storage::get_game_settings_path() + "mod_images" + PATH_SEPARATOR + std::string(mod.key()); + std::string mod_images_fullpath = Local_Storage::get_game_settings_path() + "mods_img" + PATH_SEPARATOR + std::string(mod.key()); Mod_entry newMod; newMod.id = std::stoull(mod.key()); newMod.title = mod.value().value("title", std::string(mod.key())); @@ -1063,7 +1063,7 @@ static void try_detect_mods_folder(class Settings *settings_client, Settings *se { std::vector all_mods = Local_Storage::get_folders_path(mods_folder); for (auto & mod_folder: all_mods) { - std::string mod_images_fullpath = Local_Storage::get_game_settings_path() + "mod_images" + PATH_SEPARATOR + mod_folder; + std::string mod_images_fullpath = Local_Storage::get_game_settings_path() + "mods_img" + PATH_SEPARATOR + mod_folder; try { Mod_entry newMod; newMod.id = std::stoull(mod_folder); diff --git a/dll/steam_remote_storage.cpp b/dll/steam_remote_storage.cpp index c1684b48..dc48ca37 100644 --- a/dll/steam_remote_storage.cpp +++ b/dll/steam_remote_storage.cpp @@ -533,7 +533,7 @@ int32 Steam_Remote_Storage::UGCRead( UGCHandle_t hContent, void *pvData, int32 c if (dwf.source == Downloaded_File::DownloadSource::AfterSendQueryUGCRequest) { std::string mod_base_path = dwf.mod_query_info.is_primary_file ? mod.path - : Local_Storage::get_game_settings_path() + "mod_images" + PATH_SEPARATOR + std::to_string(mod.id); + : Local_Storage::get_game_settings_path() + "mods_img" + PATH_SEPARATOR + std::to_string(mod.id); mod_fullpath = common_helpers::to_absolute(mod_name, mod_base_path); } else { // Downloaded_File::DownloadSource::FromUGCDownloadToLocation @@ -1116,7 +1116,7 @@ SteamAPICall_t Steam_Remote_Storage::UGCDownloadToLocation( UGCHandle_t hContent : mod.previewFileName; std::string mod_base_path = query_res.value().is_primary_file ? mod.path - : Local_Storage::get_game_settings_path() + "mod_images" + PATH_SEPARATOR + std::to_string(mod.id); + : Local_Storage::get_game_settings_path() + "mods_img" + PATH_SEPARATOR + std::to_string(mod.id); int32 mod_size = query_res.value().is_primary_file ? mod.primaryFileSize : mod.previewFileSize; diff --git a/post_build/README.debug.md b/post_build/README.debug.md index 0e133b3b..e24d5bae 100644 --- a/post_build/README.debug.md +++ b/post_build/README.debug.md @@ -1,10 +1,8 @@ ## What is this ? -This is the debug build of the emu, while the game/app is running -the emu will write various events to a log file called `STEAM_LOG.txt`. +This is the debug build of the emu, while the game/app is running, the emu will write various events to a log file called `STEAM_LOG.txt` ## Where is this log file ? -Generally it should be beside the .dll/.so iteself, unless the environment variable `GseAppPath` -is defined, in which case this will be the path of this log file +It should be beside the `.dll/.so` itself, unless the environment variable `GseAppPath` is defined, in which case this will be the path of this log file ## Why ? -This is intended for debugging purposes, use it to check the behavior of the emu while running. +This is intended for debugging purposes, use it to check the behavior of the emu while running diff --git a/post_build/README.experimental.md b/post_build/README.experimental.md index dd9fb7e1..171fe6c4 100644 --- a/post_build/README.experimental.md +++ b/post_build/README.experimental.md @@ -1,23 +1,25 @@ ## What is this ? -This build of the emulator: -* Blocks all outgoing connections from the game to non **LAN** IPs -* Lets you use CPY cracks that use the `steam_api` dll to patch the exe in memory when the `SteamAPI_Init()` method is called +This experimental build of the emulator: +* Blocks all outgoing connections from the game to non-LAN IPs + +* Lets you use CPY style cracks that use the `steam_api` dll to patch the exe in memory when the `SteamAPI_Init()` method is called + * Can load extra dlls in memory via `LoadLibraryW()` -* Mr.Goldberg's note: - > In this folder is an experimental build of the emulator with code that hooks a few windows socket functions. It should block all connections from the game to non LAN ips. This means the game should work without any problems for LAN play (even with VPN LAN as long as you use standard LAN ips 10.x.x.x, 192.168.x.x, etc...) - - > It likely doesn't work for some games but it should work for most of them. - - > Since this blocks all non LAN connections doing things like hosting a cracked server for people on the internet will not work or connecting to a cracked server that's hosted on an internet ip will not work. +Mr.Goldberg's note: +> In this folder is an experimental build of the emulator with code that hooks a few windows socket functions. It should block all connections from the game to non-LAN IPs. This means the game should work without any problems for LAN play (even with VPN LAN as long as you use standard LAN IPs 10.x.x.x, 192.168.x.x, etc...) + +> It likely doesn't work for some games but it should work for most of them + +> Since this blocks all non LAN connections doing things like hosting a cracked server for people on the internet will not work or connecting to a cracked server that's hosted on an internet IP will not work ## Why ? Mr.Goldberg's note: -> Lots of games seem to connect to analytics services and other crap. -> Blocking the game from communicating with online ips without affecting the LAN functionality of this emu is a pain if you try to use a firewall. +> Lots of games seem to connect to analytics services and other crap +> Blocking the game from communicating with online IPs without affecting the LAN functionality of this emu is a pain if you try to use a firewall -## Which IPs are blocked ? -**All** IPs *except* these ranges: +## Which IPs are allowed ? +With `disable_lan_only=0` inside `.\steam_settings\configs.main.ini`, only **LAN-only IPs** are allowed: * 10.0.0.0 - 10.255.255.255 * 127.0.0.0 - 127.255.255.255 * 169.254.0.0 - 169.254.255.255 @@ -25,14 +27,12 @@ Mr.Goldberg's note: * 192.168.0.0 - 192.168.255.255 * 224.0.0.0 - 255.255.255.255 -## To disable the LAN only connections feature -Modify your `steam_settings\configs.main.ini` and set `disable_lan_only=1`. +To allow all IPs, including **non-LAN IPs**, modify your `.\steam_settings\configs.main.ini` and set `disable_lan_only=1` ## How to use a CPY style crack 1. Rename `steam_api.dll` crack to `cracksteam_api.dll`, or `steam_api64.dll` to `cracksteam_api64.dll` -2. Replace the `steamclient(64).dll` crack with the one in this folder. -3. Then use the emu like you normally would with all the configurations +2. Replace the `steamclient(64).dll` crack with the one in this folder ## How to load extra dlls in memory -Put the dll file inside the folder `steam_settings\load_dlls\` and it will be loaded automatically using the `LoadLibraryW()` function +Put the dll file inside the folder `.\steam_settings\load_dlls`, and it will be loaded automatically using the `LoadLibraryW()` function diff --git a/post_build/README.experimental_linux.md b/post_build/README.experimental_linux.md index 0226c1f8..e81040b5 100644 --- a/post_build/README.experimental_linux.md +++ b/post_build/README.experimental_linux.md @@ -1,2 +1,2 @@ ## What is this ? -This build of the emu has the overlay enabled, it works on very few games +This experimental build of the emu for Linux. The overlay is enabled, though it works on very few games. diff --git a/post_build/README.experimental_steamclient.md b/post_build/README.experimental_steamclient.md index 12b5014b..e752b771 100644 --- a/post_build/README.experimental_steamclient.md +++ b/post_build/README.experimental_steamclient.md @@ -1,27 +1,26 @@ ## What is this ? -This is a build of the `experimental` version of the emu in `steamclient` mode, with an included loader which was originally [written by Rat431](https://github.com/Rat431/ColdAPI_Steam/tree/master/src/ColdClientLoader) and later modified to suite the needs of this emu. +This is a build of the `experimental` version of the emu in `steamclient` mode, with an included loader which was originally [written by Rat431](https://github.com/Rat431/ColdAPI_Steam/tree/master/src/ColdClientLoader) and later modified to suit the needs of this emu. -The backend .dll/.so of Steam is a library called `steamclient`, this build will act as a `steamclient` allowing you to retain the original `steam_api(64).dll`. -See both the regular and experimental readmes for how to configure it. +The backend `.dll/.so` of Steam is a library called `steamclient`, this build will act as a `steamclient` allowing you to retain the original `steam_api(64).dll`. See both the regular and experimental readmes for how to configure it. --- -**Note** that all emu config files should be put beside the `steamclient(64).dll`. +**Note** that all emu config files should be put beside the `steamclient(64).dll` -You do not need to create a `steam_interfaces.txt` file for the `steamclient` version of the emu. +You do not need to create a `steam_interfaces.txt` file for the `steamclient` version of the emu --- -## How to ue it ? +## How to use it ? 1. Copy the following files to any folder: * `steamclient.dll` * `steamclient64.dll` * `ColdClientLoader.ini` * `steamclient_loader.exe` -2. While it is not mandatory, it is highly recommended to copy the relevant `GameOverlayRenderer` dll(s) - This is recommended because some apps check for the existence of this dll, either on disk, on inside their memory space, otherwise they'll trigger custom protection. - When in doubt, just copy both dlls. +2. While it is not mandatory, it is highly recommended to copy the relevant `GameOverlayRenderer` dll + This is recommended because some apps check for the existence of this dll, either on disk, on inside their memory space, otherwise they'll trigger custom protection + When in doubt, just copy both dlls: * `GameOverlayRenderer.dll`: for 32-bit apps * `GameOverlayRenderer64.dll`: for 64-bit apps @@ -48,37 +47,36 @@ You do not need to create a `steam_interfaces.txt` file for the `steamclient` ve * `Mode` (in `[Persistence]` section): - 0 = turned off - 1 = loader will spawn the exe and keep hanging in the background until you press "OK" - - 2 = loader will NOT spawn exe, it will just setup the required environemnt and keep hanging in the background + - 2 = loader will NOT spawn exe, it will just setup the required environment and keep hanging in the background you have to run the Exe manually, and finally press "OK" when you've finished playing you have to rename the loader to "steam.exe" it is advised to run the loader as admin in this mode - **Note** that any arguments passed to `steamclient_loader.exe` via command line will be passed to the target `.exe`. Example: `steamclient_loader.exe` `-dx11` -If the additional exe arguments were both: passed via command line and set in the `.ini` file, then both will be cocatenated and passed to the exe. +If the additional exe arguments were both: passed via command line and set in the `.ini` file, then both will be concatenated and passed to the exe. This allows the loader to be used/called from other external apps which set additional args. -### `DllsToInjectFolder` -The folder specified by this identifier should contain the .dll files you'd like to inject in the app earlier during its creation. -All the subfolders inside this folder will be traversed recursively, and the .dll files inside these subfolders will be loaded/injected. +## Using `DllsToInjectFolder` +The folder specified by this identifier should contain the dll files you'd like to inject in the app earlier during its creation. +All the subfolders inside this folder will be traversed recursively, and the dll files inside these subfolders will be loaded/injected. -Additionaly, you can create a file called `load_order.txt` inside your folder (root level, not inside any subdir), mentioning on each line the .dll files to inject. -The order of the lines will instruct the loader which .dll to inject first, the .dll mentioned on the first line will be injected first and so on. -Each line inside this file has to be the relative path of your target .dll, and it should be relative to your folder. Check the example. +Additionally, you can create a file called `load_order.txt` inside your folder (root level, not inside any subdir), mentioning on each line the dll files to inject. +The order of the lines will instruct the loader which dll to inject first, the dll mentioned on the first line will be injected first and so on. +Each line inside this file has to be the relative path of your target dll, and it should be relative to your folder. Check the example. -If this file is created then the loader will only inject the .dll files mentioned inside it, otherwise it will attempt to find all valid .dll files and inject them. +If this file is created then the loader will only inject the dll files mentioned inside it, otherwise it will attempt to find all valid dll files and inject them. --- -## `extra_dlls` -This folder contains an experimental dll which, when injected, will attempt to patch the Stub drm in memory, mainly for newer variants but it also works on some of the older ones. +## Using `extra_dlls` +This folder contains an experimental dll which, when injected, will attempt to patch the Stub DRM in memory, mainly for newer variants but it also works on some of the older ones. This isn't a complete solution, just a different method. -This dll is meant to be injected during **startup** only, it must **not** be placed inside `steam_settings/load_dlls`, otherwise it would cause a huge FPS drop. +This dll is meant to be injected during **start-up** only, it must **NOT** be placed inside `.\steam_settings\load_dlls`, otherwise it would cause a huge FPS drop. --- -## `GameOverlayRenderer` +## Using `GameOverlayRenderer` Some apps verify the existence of this dll, either on disk, or inside their memory space, that's why this dll exists. It is **NOT** recommended to ignore this dll. diff --git a/post_build/README.generate_interfaces.md b/post_build/README.generate_interfaces.md index 4b52cd21..f3c73249 100644 --- a/post_build/README.generate_interfaces.md +++ b/post_build/README.generate_interfaces.md @@ -3,19 +3,19 @@ This tool will generate the file `steam_interfaces.txt` which is **always** reco ## How to use it ? 1. * On Windows - * Drag `steam_api.dll` or `steam_api64.dll` on this exe + * Drag `steam_api.dll` or `steam_api64.dll` on this exe. * Or run the command line (example): ```batch - generate_interfaces_file.exe steam_api64.dll + generate_interfaces_x64.exe steam_api64.dll ``` * On Linux: * Run the command line (example): ```bash - chmod 777 generate_interfaces_file_x64 # make sure we can execute the binary - generate_interfaces_file_x64 libsteam_api.so + chmod 777 generate_interfaces_x64 # make sure we can execute the binary + generate_interfaces_x64 libsteam_api.so ``` -2. Copy the generated `steam_interfaces.txt` file inside the folder `steam_settings` +2. Copy the generated `steam_interfaces.txt` file inside the folder `steam_settings`. --- -In both cases, make sure the .dll/.so is **the original** one +In both cases, make sure the .dll / .so is **the original** one ! --- diff --git a/post_build/README.release.md b/post_build/README.release.md index 1bdd4dcb..3909289f 100644 --- a/post_build/README.release.md +++ b/post_build/README.release.md @@ -2,38 +2,37 @@ ====Goldberg Steam Emulator==== --- -An emulator that supports LAN multiplayer without steam. +An emulator that supports LAN multiplayer without Steam https://gitlab.com/Mr_Goldberg/goldberg_emulator --- ## How to use: -1. Replace the `steam_api(64).dll` (Windows) or `libsteam_api.so` (Linux) from the game with the emu. -2. Use the command line tool `generate_emu_config` to generate the `steam_settings` folder +1. Replace the `steam_api(64).dll` (Windows) or `libsteam_api.so` (Linux) from the game with the emu +2. Use the command line tool `generate_emu_config` to generate the `.\steam_settings` folder 3. Use the command line tool `generate_interfaces` to generate the file `steam_interfaces.txt`, - then move it inside the folder `steam_settings` -4. Move the entire folder `steam_settings` beside the emu .dll/.so. -5. Copy the the example files `steam_settings.EXAMPLE\configs.xxx.EXAMPLE.ini` and paste them inside your own `steam_settings` folder, then the postfix `.EXAMPLE`. -6. Make sure to keep the **only** options you need, do **NOT** sepecify everything inside these .ini files + then move it inside the folder `.\steam_settings` +4. Move the entire folder `.\steam_settings` beside the emu `.dll/.so` +5. Copy the the example files `.\steam_settings.EXAMPLE\configs.xxx.EXAMPLE.ini` and paste them inside your own `steam_settings` folder, then remove `.EXAMPLE` from their name Mr.Goldberg's note: -> If the game has DRM (other than steamworks) you need to remove it first. +> If the game has DRM (other than Steamworks) you need to remove it first --- ## Various configurations: Due to the various changes and additions, it became tedious to document everything, -so it is recommended to check each example file in the `steam_settings` folder, and the various options inside `configs.xxx.ini`. +so it is recommended to check each example file in the `.\steam_settings` folder, and the various options inside `configs.xxx.ini` --- -When you use the emu at least once, some default configurations are saved inside the global settings folder +When you use the emu at least once, some default configurations are saved inside the global settings folder: * `configs.main.ini`: configurations for the emu itself -* `configs.user.ini`: configurations specific to the user -* `configs.app.ini`: configurations specific to the game/app -* `configs.overlay.ini`: configurations of the overlay +* `configs.user.ini`: configurations for the user +* `configs.app.ini`: configurations for the game/app +* `configs.overlay.ini`: configurations for the overlay --- @@ -50,60 +49,58 @@ When you use the emu at least once, some default configurations are saved inside * Otherwise: `SAVE/GSE Saves/` (relative to the current directory, which might not be the same as app/game directory) -You can override the name of the base folder `GSE Saves` to whatever you want per game, to do this modify `configs.user.ini` inside your `steam_settings` folder and change the value of `saves_folder_name`. -Check the example file in `steam_settings.EXAMPLE\configs.EXAMPLE.ini`. +You can override the name of the base folder `GSE Saves` to whatever you want per game, to do this modify `configs.user.ini` inside your `.\steam_settings` folder and change the value of `saves_folder_name` +Check the example file in `.\steam_settings.EXAMPLE\configs.EXAMPLE.ini` -Any configurations inside your `steam_settings` folder will always override the global configurations. +Any configurations inside your `steam_settings` folder will always override the global configurations --- ## Portable saves: -If you want to use local/portable saves, specify the parameter `local_save_path` inside your local `steam_settings/configs.user.ini`, the emu will completely ignore the global settings folder, allowing a full portable behavior +If you want to use local/portable saves, specify the parameter `local_save_path` inside your local `.\steam_settings\configs.user.ini`, the emu will completely ignore the global settings folder, allowing a full portable behavior --- ## Languages: -You can include a `steam_settings\supported_languages.txt` file with a list of languages that the game supports. +You can include a `.\steam_settings\supported_languages.txt` file with a list of languages that the game supports +If the global emu language setting is not in this list of languages, the emu will default to the first language in the list -If the global emu language setting is not in this list of languages, the emu will default to the first language in the list. - -See the `steam_settings.EXAMPLE` folder for an example. +See the `.\steam_settings.EXAMPLE` folder for an example. --- ## Depots: -This is pretty rare but some games might use depot ids to see if dlcs are installed. -You can provide a list of installed depots to the game with a `steam_settings\depots.txt` file. +This is pretty rare but some games might use depot ids to see if dlcs are installed +You can provide a list of installed depots to the game with a `.\steam_settings\depots.txt` file -See the `steam_settings.EXAMPLE` folder for an example. +See the `.\steam_settings.EXAMPLE` folder for an example --- ## Subscribed Groups: -Some games like payday 2 check which groups you are subscribed in and unlock things based on that. -You can provide a list of subscribed groups to the game with a `steam_settings\subscribed_groups.txt` file. +Some games like payday 2 check which groups you are subscribed in and unlock things based on that +You can provide a list of subscribed groups to the game with a `.\steam_settings\subscribed_groups.txt` file -See `steam_settings.EXAMPLE\subscribed_groups.EXAMPLE.txt` for an example for payday 2. +See `.\steam_settings.EXAMPLE\subscribed_groups.EXAMPLE.txt` for an example for PayDay 2 --- ## Subscribed Groups (Clans): -Some games like counter-strike check which groups you are subscribed in and allow you to choose a group clan. -You can provide a list of subscribed group ids, names, and tags to the game with a `steam_settings\subscribed_groups_clans.txt` file. +Some games like Counter-Strike check which groups you are subscribed in and allow you to choose a group clan +You can provide a list of subscribed group ids, names, and tags to the game with a `.\steam_settings\subscribed_groups_clans.txt` file -Group ids must be valid and can be obtained by pasting '`/memberslistxml/?xml=1`' at the end of a Steam group page. +Group ids must be valid and can be obtained by pasting '`/memberslistxml/?xml=1`' at the end of a Steam group page -See `steam_settings.EXAMPLE\subscribed_groups_clans.EXAMPLE.txt` for an example. +See `.\steam_settings.EXAMPLE\subscribed_groups_clans.EXAMPLE.txt` for an example --- -## App paths: -Some rare games might need to be provided one or more paths to app ids. -For example the path to where a dlc is installed. -This sets the paths returned by the `Steam_Apps::GetAppInstallDir` function. +## App Paths: +Some rare games might need to be provided one or more paths to app ids, for example the path to where a dlc is installed +This sets the paths returned by the `Steam_Apps::GetAppInstallDir` function -See `[app::paths]` inside `steam_settings.EXAMPLE\configs.app.EXAMPLE.ini` for an example. +See `[app::paths]` inside `.\steam_settings.EXAMPLE\configs.app.EXAMPLE.ini` for an example Note that paths are treated as relative paths **from where the steam_api dll is located**. --- @@ -111,51 +108,51 @@ Note that paths are treated as relative paths **from where the steam_api dll is --- ## Mods: -* Put your mod in the `steam_settings\mods\\` folder -* Modify `mods.json` and specify `primary_filename` and `preview_filename`, other options in this json file are optional. -* Put the mod image/preview inside `steam_settings\mod_images\` +* Put your mod in the `.\steam_settings\mods\\` folder +* Modify `mods.json` and specify `primary_filename` and `preview_filename`, other options in this json file are optional +* Put the mod image/preview inside `.\steam_settings\mods_img\` -Mod data folder must be a number corresponding to the file id of the mod. +Mod data folder must be a number corresponding to the file id of the mod -See the `steam_settings.EXAMPLE` folder for an example. +See the `.\steam_settings.EXAMPLE` folder for an example --- ## Steam appid: -Put your `steam_appid.txt` in the `steam_settings` folder because this is where the emulator checks first. +Put your `steam_appid.txt` in the `.\steam_settings` folder because this is where the emulator checks first -If there is no `steam_appid.txt` in the `steam_settings` folder it will try opening it from the run path of the game. -If one isn't there it will try to load it from beside steam api dll. +If there is no `steam_appid.txt` in the `.\steam_settings` folder it will try opening it from the run path of the game +If one isn't there it will try to load it from beside steam api dll -The steam appid can also be set using the `SteamAppId` or `SteamGameId` env variables (this is how real steam tells games what their appid is). +The steam appid can also be set using the `SteamAppId` or `SteamGameId` env variables (this is how real steam tells games what their appid is) -But it is highly recommended to always create this file inside `steam_settings` folder +It is highly recommended to always create this file inside `.\steam_settings` folder ! --- --- ## Custom Broadcast IPs: -If you want to set custom ips (or domains) which the emulator will send broadcast packets to, make a list of them, one on each line in: `GSE Saves\settings\custom_broadcasts.txt` +If you want to set custom IPs (or domains) which the emulator will send broadcast packets to, make a list of them, one on each line in: `.\GSE Saves\settings\custom_broadcasts.txt` -If the custom IPs/domains are specific for one game only you can put the `custom_broadcasts.txt` in the `steam_settings` folder. +If the custom IPs (or domains) are specific for one game only you can put the `custom_broadcasts.txt` in the `.\steam_settings` folder -An example is provided in `steam_settings.EXAMPLE\custom_broadcasts.EXAMPLE.txt` +An example is provided in `.\steam_settings.EXAMPLE\custom_broadcasts.EXAMPLE.txt` --- ## Achievements, Items or Inventory: -Create a file named `items.json` and/or `achievements.json` inside the `steam_settings` folder which will contain every item/achievement you want to have in your game. +Create a file named `items.json` and/or `achievements.json` inside the `.\steam_settings` folder which will contain every item/achievement you want to have in your game. -An example can be found in `steam_settings.EXAMPLE` that works with Killing Floor 2. +An example can be found in `.\steam_settings.EXAMPLE` that works with Killing Floor 2. -The `items.json` syntax is simple, you **MUST** validate your `.json` file before trying to run your game or you won't have any item in your inventory. -Just look for "online json validator" on your web brower to valide your file. +The `items.json` syntax is simple, you **MUST** validate your `.json` file before trying to run your game or you won't have any item in your inventory +Just look for "online json validator" on your web browser to validate your file. -You can use https://steamdb.info/ to list items and attributes they have and put them into your .json, you can also use the command line tool `generate_emu_config`. +You can use https://steamdb.info/ to list items and attributes they have and put them into your `.json`, you can also use the command line tool `generate_emu_config` -Keep in mind that some item are not valid to have in your inventory. +Keep in mind that some item are not valid to have in your inventory ! --- -For example, in PayDay2 all items below `item_id` `50000` will make your game crash. +For example, in PayDay2 all items below `item_id` `50000` will make your game crash * `items.json` should contain all the item definitions for the game, * `default_items.json` is the quantity of each item that you want a user to have initially in their inventory. By default the user will have no items. @@ -164,13 +161,12 @@ It is recommended to use the command line tool `generate_emu_config` for that ma --- ## Leaderboards: -By default the emulator assumes all leaderboards queried by the game `FindLeaderboard()` exist and creates them with the most common options (sort method descending, display type numeric). -In some games this default behavior doesn't work and so you may need to tweak which leaderboards the game sees. +By default the emulator assumes all leaderboards queried by the game `FindLeaderboard()` exist and creates them with the most common options (sort method descending, display type numeric) +In some games this default behavior doesn't work and so you may need to tweak which leaderboards the game sees -To do that, you can put a `leaderboards.txt` file in the `steam_settings` folder. +To do that, you can put a `leaderboards.txt` file in the `.\steam_settings` folder -The format is: -`LEADERBOARD_NAME=sort method=display type` +The format is: `LEADERBOARD_NAME=sort_method=display_type` For the sort methods: * 0 = none @@ -183,14 +179,14 @@ For the display type * 2 = time seconds * 3 = milliseconds -An example can be found in `steam_settings.EXAMPLE` +An example can be found in `.\steam_settings.EXAMPLE` --- ## Stats: -By default this emulator assumes all stats do not exist unless the option `allow_unknown_stats` in `configs.main.ini` is set to 1. +By default this emulator assumes all stats do not exist unless the option `allow_unknown_stats` in `configs.main.ini` is set to 1 -To properly define the stats of a game, put a `stats.txt` file in the `steam_settings` folder. +To properly define the stats of a game, put a `stats.txt` file in the `.\steam_settings` folder The format is: `stat_name=type=default value` @@ -199,29 +195,29 @@ The type can be * float * avgrate -The default value is simply a number that represents the default value for the stat. +The default value is simply a number that represents the default value for the stat You can use the command line tool `generate_emu_config` to generate a stats config --- ## SteamHTTP: -Create a `steam_settings\http\` folder which should contain the domain name and path to the files that will be returned by steamHTTP like so \(For example this url: `https://en.wikipedia.org/wiki/Main_Page`\): +Create a `.\steam_settings\http\` folder which should contain the domain name and path to the files that will be returned by steamHTTP like so \(For example this url: `https://en.wikipedia.org/wiki/Main_Page`\): -* Create a folder `steam_settings\http\en.wikipedia.org\wiki\Main_Page` +* Create a folder `.\steam_settings\http\en.wikipedia.org\wiki\Main_Page` * The `Main_Page` **file** would contain the data returned by the steamHTTP api when it tries to access: `https://en.wikipedia.org/wiki/Main_Page` -An example that was made for payday 2 can be found in `steam_settings.EXAMPLE` +An example that was made for PayDay 2 can be found in `.\steam_settings.EXAMPLE` --- ## Avatar: -Copy a `png`, or a `jpg`, or a `jpeg` image file to your `GSE Settings/settings` folder and name it `account_avatar`. -You can also place this file inside the local `steam_settings` folder of the game. +Copy a `png`, or a `jpg`, or a `jpeg` image file to your `.\GSE Settings\settings` folder and name it `account_avatar` +You can also place this file inside the local `.\steam_settings` folder of the game Players avatars are shared over the local network -You can find an example in `steam_settings.EXAMPLE` +You can find an example in `.\steam_settings.EXAMPLE` --- @@ -232,53 +228,55 @@ See the build in the experimental folder. You must all be on the same LAN for it to work. **IMPORTANT:** -Do not run more than one steam game with the **same appid** at the same time on the same computer with this emu or there might be network issues (dedicated servers should be fine though). +Do not run more than one steam game with the **same appid** at the same time on the same computer with this emu, or there might be network issues (dedicated servers should be fine though) --- ## Overlay: **Note: at the moment this feature is only enabled in the experimental builds** -**It's a highly experimental feature, use at your own risk** + +**It's a highly experimental feature, use at your own risk !** + --- This is made possible using the amazing third-party library `Ingame Overlay project`: https://github.com/Nemirtingas/ingame_overlay -The overlay can be enabled by modifying `configs.overlay.ini` and setting `enable_experimental_overlay=1`. -Use `SHIFT-TAB` to open the overlay. +The overlay can be enabled by modifying `configs.overlay.ini` and setting `enable_experimental_overlay=1` +Use `SHIFT-TAB` to open the overlay -This feature is **highly experimental** and might cause crashes or other problems. +This feature is **highly experimental** and might cause crashes or other problems -Alternatively, you can use the dedicated tool `lobby_connect` to join a game lobby. +Alternatively, you can use the dedicated tool `lobby_connect` to join a game lobby --- ## Overlay notifications sounds: **Note: at the moment this feature is only enabled in the experimental builds for Windows only** + --- -You can place a `.wav` file called `overlay_achievement_notification.wav` inside either the local `steam_settings/sounds` folder of the game, or inside `GSE Settings/settings/sounds` folder, which will be played whenever an achievement is unlocked. +You can place a `.wav` file called `overlay_achievement_notification.wav` inside either the local `.\steam_settings\sounds` folder of the game, or inside `.\GSE Settings\settings\sounds` folder, which will be played whenever an achievement is unlocked -You can place a `.wav` file called `overlay_friend_notification.wav` inside either the local `steam_settings/sounds` folder of the game, or inside `GSE Settings/settings/sounds` folder, which will be played whenever a friend sends an invitation. +You can place a `.wav` file called `overlay_friend_notification.wav` inside either the local `.\steam_settings\sounds` folder of the game, or inside `.\GSE Settings\settings\sounds` folder, which will be played whenever a friend sends an invitation -You can find an example in `steam_settings.EXAMPLE` +You can find an example in `.\steam_settings.EXAMPLE` --- ## Controller: -**Note: at the moment this feature is only enabled in the Windows experimental builds and the linux builds** ---- +**Note: at the moment this feature is only enabled in the Windows experimental builds and the Linux builds** + +**SteamController/SteamInput support is limited to XInput controllers** -SteamController/SteamInput support is limited to **XInput** controllers. --- If your controller is not XInput, there are many tools (at least for windows) that you can use to make it emulate an XInput one. -Steam uses things called action sets for controller configuration. An action set is a group of action names. -Action names are bound to buttons, triggers or joysticks. -The emulator needs to know for each action set, which button is linked to which action name. +Steam uses things called action sets for controller configuration. An action set is a group of action names +Action names are bound to buttons, triggers or joysticks. The emulator needs to know for each action set, which button is linked to which action name -Create a `ACTION_SET_NAME.txt` file in the `steam_settings\controller\` folder for every action set the game uses. +Create a `ACTION_SET_NAME.txt` file in the `.\steam_settings\controller` folder for every action set the game uses -To see an example for the game Crystar see: `steam_settings.EXAMPLE\controller.EXAMPLE` +Example for the game Crystar: `.\steam_settings.EXAMPLE\controller.EXAMPLE` In the action set txt files the format is: * For digital actions (buttons, on or off): @@ -289,12 +287,12 @@ In the action set txt files the format is: Actions can be bound to more than one button by separating the buttons with, like this: `ACTION_NAME=A,B` -You can use the command line tool `generate_emu_config` to generate a config file. -Or if you want to configure a game yourself, find the `vdf` file for `xbox360` or `xbox one` controller of the game and use the tool `parse_controller_vdf`, you should be able to figure things out. +You can use the command line tool `generate_emu_config` to generate a config file +Or if you want to configure a game yourself, find the `vdf` file for `xbox360` or `xbox one` controller of the game and use the tool `parse_controller_vdf`, you should be able to figure things out For example to get the vdf file for the game Crystar: https://steamdb.info/app/981750/config/ If you look at: `steamcontrollerconfigdetails`, you will see something like: `1779660455/controller_type: controller_xbox360` -`1779660455` refers to a file id that you can dl using your favorite steam workshop downloader site. +`1779660455` refers to a file id that you can download using your favourite steam workshop downloader site The url would be: https://steamcommunity.com/sharedfiles/filedetails/?id=1779660455 The glyphs directory contains some glyphs for the controller buttons for the games that use the `GetGlyphForActionOrigin()` function. @@ -342,7 +340,7 @@ By default the emu will send the old token format for various APIs, like: * `Steam_User::GetAuthSessionTicket()` * `Steam_User::GetAuthTicketForWebApi()` -You can make the emu generate new ticket data, and additionally the GC token. +You can make the emu generate new ticket data, and additionally the GC token Modify `configs.main.ini` and set `new_app_ticket=1` and additionally `gc_token=1` --- @@ -350,10 +348,10 @@ Modify `configs.main.ini` and set `new_app_ticket=1` and additionally `gc_token= ## Fake Windows dll/exe certificate and antivirus software: The Windows build is signed with a fake self-signed certificate, this helps in bypassing some basic checks by apps, -but it also triggers some antivirus software. +but it also triggers some antivirus software -First of all, **never** install these certificates to your certificate store, they are randomly generated. -Second, the project is not a malware, if your antivirus software complains, be sure it's a false-positive. +First of all, **never** install these certificates to your certificate store, they are randomly generated +Second, the project is not a malware, if your antivirus software complains, be sure it's a false-positive --- @@ -395,26 +393,29 @@ Look for the column `API language code` ## Bypass overlay and auto accept game/lobby invites: **Note: at the moment this feature is only enabled in the experimental builds** + --- -When the overlay is enabled and working, you can bypass it and auto-accept invites (lobby or game) from a list of Steam IDs (SteamID64 format). +When the overlay is enabled and working, you can bypass it and auto-accept invites (lobby or game) from a list of Steam IDs (SteamID64 format) The configuration file `auto_accept_invite.txt` allows you to do that, it works like this: + * Adding an empty file: will accept invites from anyone (same behavior as if the overlay was disabled) * Adding a file with some friends IDs (each on a separate line): * If the friend ID is found in this file, the invitation will be accepted automatically * If the friend ID is not found, you'll get the regular overlay invitation -Check the example file in the `steam_settings` folder +Check the example file in the `.\steam_settings` folder --- ## Enable non-LAN behavior in `steam_matchmaking_servers`: -By default, match making servers (which handles browsing for matches) will always return LAN servers list whenever the game inquires about the available servers with a specific type (Internet, Friends, LAN, etc...). -You can make the emu return the proper/actual servers list for the given type, by modifying `configs.main.ini` and setting `matchmaking_server_list_actual_type-1`. -**This is currently broken**. +By default, match making servers (which handles browsing for matches) will always return LAN servers list whenever the game inquires about the available servers with a specific type (Internet, Friends, LAN, etc...) + +You can make the emu return the proper/actual servers list for the given type, by modifying `configs.main.ini` and setting `matchmaking_server_list_actual_type-1` +**This is currently broken** Also, match making servers will return the info of the server from the incoming local packets, you can make the emu retrieve the actual server info by performing a source server query, this is enabled by setting `matchmaking_server_details_via_source_query-1` inside `configs.main.ini`. -**This is currently broken**. +**This is currently broken** --- diff --git a/post_build/steam_settings.EXAMPLE/account_avatar_default.EXAMPLE.jpg b/post_build/steam_settings.EXAMPLE/account_avatar_default.EXAMPLE.jpg new file mode 100644 index 00000000..aa490cb4 Binary files /dev/null and b/post_build/steam_settings.EXAMPLE/account_avatar_default.EXAMPLE.jpg differ diff --git a/post_build/steam_settings.EXAMPLE/configs.app.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.app.EXAMPLE.ini index 3e82e8c3..9b0a19b7 100644 --- a/post_build/steam_settings.EXAMPLE/configs.app.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.app.EXAMPLE.ini @@ -1,27 +1,26 @@ -# ############################################################################## # -# you do not have to specify everything, pick and choose the options you need only -# ############################################################################## # +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # [app::general] -# by default the emu will report a `non-beta` branch when the game calls `Steam_Apps::GetCurrentBetaName()` -# make 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()' +# if 1, makes the game/app think we're playing on a beta branch is_beta_branch=0 -# 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 +# 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 branch_name=public [app::dlcs] -# should the emu report all DLCs as unlocked -# 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 +# 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 unlock_all=0 # format: ID=name -1234=DLCNAME -56789=This is another example DLC name +# 1234=DLCNAME +# 56789=This is another example DLC name [app::paths] -556760=../DLCRoot0 -1234=./folder_where_steam_api_is -3456=../folder_one_level_above_where_steam_api_is -5678=../../folder_two_levels_above_where_steam_api_is +# format: ID=path +# 556760=../DLCRoot0 +# 1234=./folder_where_steam_api_is +# 3456=../folder_one_level_above_where_steam_api_is +# 5678=../../folder_two_levels_above_where_steam_api_is diff --git a/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini index ff021287..e92b7034 100644 --- a/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.main.EXAMPLE.ini @@ -1,59 +1,54 @@ -# ############################################################################## # -# you do not have to specify everything, pick and choose the options you need only -# ############################################################################## # +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # [main::general] # generate new app auth ticket new_app_ticket=1 -# generate/embed GC token inside new App Ticket +# generate/embed GC token inside new app ticket gc_token=1 # pretend the app is running on a steam deck steam_deck=0 # enable avatar functionality enable_account_avatar=0 # prevent Steam_User_Stats::FindLeaderboard() from always succeeding and creating the unknown leaderboard -# not recommended to disable this +# default=0, not recommended to change it 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 +# 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 -# default=0 allow_unknown_stats=0 -# 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 -# set this to 0 to save any stat achievement progress value (higher or lower) -# this has no impact on the stat itself, only the achievement progress of a stat which is tied to an achievement -# also has no impact on the functions which directly change stats, achievements, or achievements progress -# default=1 +# 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()` -# not recommended +# default=0, not recommended to change it 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" -# not recommended +# otherwise, the emu will always return the type 'LAN server' +# default=0, not recommended to change it matchmaking_server_list_actual_type=0 # grab the server details for match making using an actual server query -# not recommended +# default=0, not recommended to change it 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 -crash_printer_location=./path/relative/to/dll/crashes.txt +crash_printer_location=./EMU_CRASHES.txt [main::connectivity] # prevent hooking OS networking APIs and allow any external requests # only used by the experimental builds on Windows -disable_lan_only=0 -# disable all steam networking interface functionality -# this won't prevent games/apps from making external requests +disable_lan_only=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 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 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 +# 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 offline=0 -# prevent sharing stats and achievements with any game server, -# this also disables the interface ISteamGameServerStats +# prevent sharing stats and achievements with any game server, also disables the interface ISteamGameServerStats disable_sharing_stats_with_gameserver=0 # do not send server details to the server browser, only works for game servers disable_source_query=0 @@ -66,19 +61,20 @@ disable_lobby_creation=0 # * 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=0 +download_steamhttp_requests=1 + +############################################ +# mostly workarounds for specific problems # +############################################ -# mostly workarounds for specific problems [main::misc] # force SetAchievement() to always return true achievements_bypass=0 # force the function Steam_HTTP::SendHTTPRequest() to always succeed force_steamhttp_success=0 # env var SteamOverlayGameId breaks Steam Input when the game is added to Steam as a non-steam game -disable_steamoverlaygameid_env_var=0 -# 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 +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 # https://developer.valvesoftware.com/wiki/Steam_Application_IDs # https://developer.valvesoftware.com/wiki/Dedicated_Servers_List -# default=0 enable_steam_preowned_ids=0 diff --git a/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini index ca7850d3..cd647136 100644 --- a/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.overlay.EXAMPLE.ini @@ -1,19 +1,14 @@ -# ---------------------------- -# XXXXXXXXXXXXXXXXXXXXXXXXXXXX -# XXX USE AT YOUR OWN RISK XXX -# XXXXXXXXXXXXXXXXXXXXXXXXXXXX -# ---------------------------- -# -# This feature might cause crashes or other problems -# -# ############################################################################## # -# you do not have to specify everything, pick and choose the options you need only -# ############################################################################## # +# # +# USE AT YOUR OWN RISK :: This feature might cause crashes or other problems # +# # +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # [overlay::general] # enable the experimental overlay, might cause crashes -enable_experimental_overlay=0 -# amount of time to wait before attempting to detect and hook the renderer (DirectX, OpenGL, etc...) +enable_experimental_overlay=1 +# 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 @@ -33,13 +28,12 @@ disable_warning_bad_appid=0 disable_warning_local_save=0 [overlay::appearance] -# 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 Settings/settings/fonts" -Font_Override=Roboto-Medium.ttf -# global font size -# for built-in font, multiple of 16 is recommended. e.g. 16 32... -Font_Size=20.0 +# 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 +Font_Size=16.0 # achievement icon size Icon_Size=64.0 @@ -56,24 +50,25 @@ 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/timing for various notification types (in seconds) -# duration of notification animation in seconds. Set to 0 to disable +# 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=7.0 +Notification_Duration_Achievement=6.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 builtin format will be used +# if the output formatted string exceeded this limit, the built-in format will be used # look for the format here: https://en.cppreference.com/w/cpp/chrono/c/strftime Achievement_Unlock_Datetime_Format=%Y/%m/%d - %H:%M:%S diff --git a/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini b/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini index 6c2e5a4d..81744662 100644 --- a/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini +++ b/post_build/steam_settings.EXAMPLE/configs.user.EXAMPLE.ini @@ -1,15 +1,14 @@ -# ############################################################################## # -# you do not have to specify everything, pick and choose the options you need only -# ############################################################################## # +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # [user::general] # user account name -account_name=gse orca +account_name=goldberg # Steam64 format account_steamid=76561197960287930 # the language reported to the app/game # look for the column 'API language code' here: https://partner.steamgames.com/doc/store/localization/languages -# this must also exist in 'supported_languages.txt', otherwise it will be ignored by the emu # default=english language=english # report a country IP if the game queries it @@ -19,11 +18,10 @@ 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=./path/relative/to/dll -# 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 +#local_save_path=GSE Saves +# name of the default global folder used to store save data, leading and trailing whitespaces are trimmed # default=GSE Saves saves_folder_name=GSE Saves + diff --git a/post_build/steam_settings.EXAMPLE/fonts.EXAMPLE/README.md b/post_build/steam_settings.EXAMPLE/fonts.EXAMPLE/README.md index d0e7fc61..1454569f 100644 --- a/post_build/steam_settings.EXAMPLE/fonts.EXAMPLE/README.md +++ b/post_build/steam_settings.EXAMPLE/fonts.EXAMPLE/README.md @@ -1 +1,2 @@ -Place your overlay fonts here, then modify `overlay_appearance` and point at the desired one. \ No newline at end of file +Place your overlay fonts here, then modify `Font_Override` in `configs.overlay.ini` and point at the desired one + diff --git a/post_build/steam_settings.EXAMPLE/mods.EXAMPLE.json b/post_build/steam_settings.EXAMPLE/mods.EXAMPLE.json index 2ffe5472..aefd5084 100644 --- a/post_build/steam_settings.EXAMPLE/mods.EXAMPLE.json +++ b/post_build/steam_settings.EXAMPLE/mods.EXAMPLE.json @@ -1,19 +1,19 @@ { - "9422": { + "12345": { "title": "Some Workshop Item", - "description": "This is the prefered way of specifying mod details, primary file must exist in steam_settings/mods/9422 (along with any other mod files), and preview file must exist in steam_settings/mod_images/9422", + "description": "This is the prefered way of specifying mod details, primary file must exist in steam_settings/mods/12345 (along with any other mod files), and preview file must exist in steam_settings/mods_img/12345", "primary_filename": "metadata.json", - "preview_filename": "thumbnail.png" + "preview_filename": "my_preview_image.jpg" }, "111111111": { "title": "Example Workshop Item", - "description": "Example Workshop Item with all Details", + "description": "Example Workshop Item with all details", "steam_id_owner": 11111111111111111, "time_created": 1554997000, "time_updated": 1554997000, "time_added": 1554997000, - "tags": "Maps, exampleTag, exampleTag2", + "tags": "Maps, exampleTag1, exampleTag2", "primary_filename": "test.sav", "primary_filesize": 1000000, "preview_filename": "test.png", @@ -25,14 +25,14 @@ "upvotes": 10, "downvotes": 1, "num_children": 0, - "path": "C:\\games\\my_game\\steam_settings\\mods_data\\mod_111111111_data_folder", - "preview_url": "file://C:/games/my_game/steam_settings/mod_images/my_preview.jpg", + "path": "C:\\games\\my_game\\steam_settings\\mods\\111111111", + "preview_url": "file://C:/games/my_game/steam_settings/mods_img/111111111/preview.jpg", "score": 0.7 }, "222222222": { "title": "Example Workshop Item", - "description": "Example Workshop Item with some Details", + "description": "Example Workshop Item with some details", "preview_url": "https://commons.wikimedia.org/wiki/File:Tree_in_Mississippi.jpg", "score": 1.0 }, diff --git a/post_build/steam_settings.EXAMPLE/mods_img.EXAMPLE/12345/README.md b/post_build/steam_settings.EXAMPLE/mods_img.EXAMPLE/12345/README.md new file mode 100644 index 00000000..2f4be0ba --- /dev/null +++ b/post_build/steam_settings.EXAMPLE/mods_img.EXAMPLE/12345/README.md @@ -0,0 +1,2 @@ +Put here the file whose name is specified by the JSON key `preview_filename` inside `mods.json` + diff --git a/post_build/steam_settings.EXAMPLE/mods_img.EXAMPLE/12345/my_preview_image.jpg b/post_build/steam_settings.EXAMPLE/mods_img.EXAMPLE/12345/my_preview_image.jpg new file mode 100644 index 00000000..aa490cb4 Binary files /dev/null and b/post_build/steam_settings.EXAMPLE/mods_img.EXAMPLE/12345/my_preview_image.jpg differ diff --git a/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/README.md b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/README.md index f0c6f604..f9c54001 100644 --- a/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/README.md +++ b/post_build/steam_settings.EXAMPLE/sounds.EXAMPLE/README.md @@ -1,5 +1,7 @@ **This is currently available for Windows only** -Place your overlay audio files here. +Place your overlay audio files here: * `overlay_achievement_notification.wav`: will be played when an achievement is unlocked -* `overlay_friend_notification.wav`: will be played when a friend sends an invitation \ No newline at end of file + +* `overlay_friend_notification.wav`: will be played when a friend sends an invitation + diff --git a/post_build/win/ColdClientLoader.EXAMPLE/README.md b/post_build/win/ColdClientLoader.EXAMPLE/README.md index 045648e0..8e9ddafa 100644 --- a/post_build/win/ColdClientLoader.EXAMPLE/README.md +++ b/post_build/win/ColdClientLoader.EXAMPLE/README.md @@ -1,2 +1,2 @@ Don't forget to modify the file `ColdClientLoader.ini` to point at the folder `extra_dlls`. -`load_order.txt` will force the order in which the dlls are injected into the app +The file`load_order.txt` will force the order in which the dlls are injected into the app. diff --git a/resources/README.md b/resources/README.md index 37cb613e..fa5533a8 100644 --- a/resources/README.md +++ b/resources/README.md @@ -1,18 +1,18 @@ This directory contains additional resources used during build. * The folder [win](./win/) contains the resources added to the .dll/.exe binaries, - these include version info and an immitation of any extra resources found in the original .dll/.exe. + these include version info and an imitation of any extra resources found in the original .dll/.exe. - These resources are built using Microsoft's resourec compiler `rc.exe` during the build process, + These resources are built using Microsoft's resource compiler `rc.exe` during the build process, and the output files are stored in `build\tmp\win\rsrc` as `*.res`. These resources are later passed to the compiler `cl.exe` as any normal `.cpp` or `.c` file: ```bash cl.exe myfile.cpp myres.res -o myout.exe ``` - * [api](./win/api/): contains an immitation of the resources found in `steam_api(64).dll` - * [client](./win/client/): contains an immitation of the resources found in `steamclient(64).dll` - * [launcher](./win/launcher/): contains an immitation of the resources found in `steam.exe` - * [game_overlay_renderer](./win/game_overlay_renderer/): contains an immitation of the resources found in `GameOverlayRenderer(64).dll` - * [file_dos_stub](./win/file_dos_stub/): contains an immitation of how the DOS stub is manipulated after build + * [api](./win/api/): contains an imitation of the resources found in `steam_api(64).dll` + * [client](./win/client/): contains an imitation of the resources found in `steamclient(64).dll` + * [launcher](./win/launcher/): contains an imitation of the resources found in `steam.exe` + * [game_overlay_renderer](./win/game_overlay_renderer/): contains an imitation of the resources found in `GameOverlayRenderer(64).dll` + * [file_dos_stub](./win/file_dos_stub/): contains an imitation of how the DOS stub is manipulated after build diff --git a/tools/generate_emu_config/README.md b/tools/generate_emu_config/README.md index 569d5959..ce9f9ab0 100644 --- a/tools/generate_emu_config/README.md +++ b/tools/generate_emu_config/README.md @@ -1,29 +1,24 @@ ## What is this ? -This is a command line tool to generate the `steam_settings` folder for the emu, -you need a Steam account to grab most info, but you can use an anonymous account with limited access to Steam data. - -
+This is a command line tool to generate complete custom configs, including the `steam_settings` folder for the emu. +You need a Steam account to grab most info, but you can use an anonymous account with limited access to Steam data. ## Usage ```bash generate_emu_config [options] [app id 2] [app id 3] ... -``` +``` ---- - -### Available **\[options\]** To get all available options, run the tool without any arguments. --- -### Login: +## Using *my_login.txt* You'll be asked each time to enter your username and password, but you can automate this prompt. * You can create a file called `my_login.txt` beside this tool with the following data: - Your **username** on the **first** line - Your **password** on the **second** line - **But beware though of accidentally distributing your login data when using this file**. + Beware of accidentally distributing your login data when using this file ! --- * You can define these environment variables, note that these environment variables will override the file `my_login.txt`: - `GSE_CFG_USERNAME` @@ -31,34 +26,37 @@ You'll be asked each time to enter your username and password, but you can autom When defining these environment variables in a script, take care of special characters. - Example for Windows: + ​ Example for Windows: ```shell set GSE_CFG_USERNAME=my_username - set GSE_CFG_PASSWORD=123 abc + set GSE_CFG_PASSWORD=123abc generate_emu_config.exe 480 ``` - Example for Linux: + ​ Example for Linux: ```shell export GSE_CFG_USERNAME=my_username - export GSE_CFG_PASSWORD=123 abc + export GSE_CFG_PASSWORD=123abc ./generate_emu_config 480 ``` --- -### Downloading data for new apps/games and defining extra account IDs: +## Using *top_owners_ids.txt* The script uses public Steam IDs (in Steam64 format) of apps/games owners in order to query the required info, such as achievement data. -By default, it has a built-in list of public users IDs, and you can extend this list by creating a file called `top_owners_ids.txt` beside the script, then add each new ID in Steam64 format on a separate line. +By default, it has a built-in list of public users IDs, which can be extended by creating a file called `top_owners_ids.txt` beside the script, then adding each new ID in Steam64 format on a separate line. When you login with a non-anonymous account, its ID will be added to the top of the list. -When you login with a non-anonymous account, its ID will be added to the top of the list. +Steam IDs with public profiles that own a lot of games --- https://steamladder.com/ladder/games/ +How to generate/update `top_owners_ids.txt` upon running generate_emu_config: -
+- copy and paste the above address in your web browser +- right click and save web page, html only with the name top_owners_ids.html +- copy and paste `top_owners_ids.html` next to generate_emu_config exe or py --- ## Attributions and credits * Windows icon by: [FroyoShark](https://www.iconarchive.com/artist/froyoshark.html) - license: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) - Source: [icon archive: Steam Icon](https://www.iconarchive.com/show/enkel-icons-by-froyoshark/Steam-icon.html) + License: [Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/) + Source: [icon archive: Steam Icon](https://www.iconarchive.com/show/enkel-icons-by-froyoshark/Steam-icon.html) diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api.7z b/tools/generate_emu_config/_DEFAULT/0/steam_api.7z new file mode 100644 index 00000000..a1b35a78 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/0/steam_api.7z differ diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api.dll b/tools/generate_emu_config/_DEFAULT/0/steam_api.dll new file mode 100644 index 00000000..a90054e6 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/0/steam_api.dll differ diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z b/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z new file mode 100644 index 00000000..1e741114 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/0/steam_api64.7z differ diff --git a/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll b/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll new file mode 100644 index 00000000..1d72bd5b Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/0/steam_api64.dll differ diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.cfg b/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.cfg new file mode 100644 index 00000000..3bcab4ed --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\acw_helper.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.exe b/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/gse_acw_helper.exe differ diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.cfg b/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.cfg new file mode 100644 index 00000000..63cd4ecb --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\debug_switch.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.exe b/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/gse_debug_switch.exe differ diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.cfg b/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.cfg new file mode 100644 index 00000000..7e8faf9a --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\generate_interfaces.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.exe b/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/gse_generate_interfaces.exe differ diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.cfg b/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.cfg new file mode 100644 index 00000000..dbf64ac5 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\lobby_connect.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.exe b/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/gse_lobby_connect.exe differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt new file mode 100644 index 00000000..5142f3f7 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt @@ -0,0 +1,125 @@ + 7-Zip Extra + ~~~~~~~~~~~ + License for use and distribution + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Copyright (C) 1999-2024 Igor Pavlov. + + 7-Zip Copyright (C) 1999-2024 Igor Pavlov. + + The licenses for files are: + + - 7za.exe: + - The "GNU LGPL" as main license for most of the code + - The "BSD 3-clause License" for some code + - The "BSD 2-clause License" for some code + - All other files: the "GNU LGPL". + + Redistributions in binary form must reproduce related license information from this file. + + Note: + You can use 7-Zip Extra on any computer, including a computer in a commercial + organization. You don't need to register or pay for 7-Zip. + + It is allowed to digitally sign DLL and EXE files included into this package + with arbitrary signatures of third parties. + + +GNU LGPL information +-------------------- + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You can receive a copy of the GNU Lesser General Public License from + http://www.gnu.org/ + + + +BSD 3-clause License in 7-Zip code +---------------------------------- + + The "BSD 3-clause License" is used for the following code in 7za.exe + - ZSTD data decompression. + that code was developed using original zstd decoder code as reference code. + The original zstd decoder code was developed by Facebook Inc, + that also uses the "BSD 3-clause License". + + Copyright (c) Facebook, Inc. All rights reserved. + Copyright (c) 2023-2024 Igor Pavlov. + +Text of the "BSD 3-clause License" +---------------------------------- + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + + + + +BSD 2-clause License in 7-Zip code +---------------------------------- + + The "BSD 2-clause License" is used for the XXH64 code in 7za.exe. + + XXH64 code in 7-Zip was derived from the original XXH64 code developed by Yann Collet. + + Copyright (c) 2012-2021 Yann Collet. + Copyright (c) 2023-2024 Igor Pavlov. + +Text of the "BSD 2-clause License" +---------------------------------- + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za.exe b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za.exe new file mode 100644 index 00000000..bb7216dd Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/7za/7za.exe differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt new file mode 100644 index 00000000..3be4eb06 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt @@ -0,0 +1,58 @@ +Software License + +AutoIt + +Author : Jonathan Bennett and the AutoIt Team +WWW : https://www.autoitscript.com/site/autoit/ +Email : support at autoitscript dot com +________________________________________________________ + +END-USER LICENSE AGREEMENT FOR THIS SOFTWARE + + +This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and the mentioned author of this Software for the software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("SOFTWARE PRODUCT"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT. + + + +SOFTWARE PRODUCT LICENSE + +The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold. + +The definition of SOFTWARE PRODUCT does not includes any files generated by the SOFTWARE PRODUCT, such as compiled script files in the form of standalone executables. + + +1. GRANT OF LICENSE + +This EULA grants you the following rights: + +Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT. + +Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of the SOFTWARE PRODUCT either in whole or in part; each copy should include all copyright and trademark notices, and shall be accompanied by a copy of this EULA. Copies of the SOFTWARE PRODUCT may be distributed as a standalone product or included with your own product. + +Commercial Use. You may use the SOFTWARE PRODUCT for commercial purposes. You may sell for profit and freely distribute scripts and/or compiled scripts that were created with the SOFTWARE PRODUCT. + +Reverse engineering. You may not reverse engineer or disassemble the SOFTWARE PRODUCT. + +2. COPYRIGHT + +All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by the Author of this Software. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material. + + + +MISCELLANEOUS + +If you acquired this product in the United Kingdom, this EULA is governed by the laws of the United Kingdom. If this product was acquired outside the United Kingdom, then local law may apply. + +Should you have any questions concerning this EULA, or if you desire to contact the author of this Software for any reason, please contact him/her at the email address mentioned at the top of this EULA. + + + +LIMITED WARRANTY + +1. NO WARRANTIES + +The Author of this Software expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you. + +2. NO LIABILITY FOR DAMAGES + +In no event shall the author of this Software be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if the Author of this Software has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you. diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3.exe b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3.exe new file mode 100644 index 00000000..d495de2a Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/au3.exe differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x new file mode 100644 index 00000000..c3b94af7 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 new file mode 100644 index 00000000..e8dfdffc --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 @@ -0,0 +1,184 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +#include +#include + +; ARC_NAME + +$arc_extra_acw = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "extra_acw", "extra_acw.zip") + +$ach_watcher_arc = @ScriptDir & "\steam_misc\extra_acw\" & $arc_extra_acw +$ach_watcher_dst = @AppDataDir & "\Achievement Watcher" + +If FileExists($ach_watcher_arc) Then + + $gse_saves = IniRead(@ScriptDir & "\steam_settings\configs.user.ini", "user::saves", "saves_folder_name", "GSE Saves") + $local_save = IniRead(@ScriptDir & "\steam_settings\configs.user.ini", "user::saves", "local_save_path", "") + $local_save = StringReplace($local_save, "./", "") + $local_save = StringReplace($local_save, ".\", "") + + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $ach_watcher_arc & '" -o"' & $ach_watcher_dst & '" -aoa', "", "", @SW_HIDE) + + If $local_save <> "" Then + + $userdir_line1 = ' {' + $userdir_line2 = ' "path": "' & StringReplace(@ScriptDir & "\" & $gse_saves, "\", "\\") & '",' + $userdir_line3 = ' "notify": true' + $userdir_line4 = ' }' + + $file = @AppDataDir & "\Achievement Watcher\cfg\userdir.db" + $temp = @AppDataDir & "\Achievement Watcher\cfg\userdir_temp.db" + + If Not FileExists($file) Then + ;FileCopy(@ScriptDir & "\steam_settings\ach\cfg\userdir.db", $file, 1) + FileWriteLine($file, "[") + FileWriteLine($file, "]") + If FileExists($temp) Then FileDelete($temp) + Local $aLines + _FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + Else + Local $aLines, $hMatch + _FileReadToArray($file, $aLines) + For $i = 1 To $aLines[0] + If StringInStr($aLines[$i], $userdir_line2) Then $hMatch = 1 + Next + If $hMatch == 1 Then + If FileExists($temp) Then FileDelete($temp) + Else + If FileExists($temp) Then FileDelete($temp) + ;Local $aLines + ;_FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + EndIf + EndIf + + _ReplaceStringInFile($file, " }" & @CRLF & " {", " }," & @CRLF & " {") + + ; --- + + $userdir_line1 = ' {' + $userdir_line2 = ' "path": "' & StringReplace(@ScriptDir & "\" & $local_save, "\", "\\") & '",' + $userdir_line3 = ' "notify": true' + $userdir_line4 = ' }' + + $file = @AppDataDir & "\Achievement Watcher\cfg\userdir.db" + $temp = @AppDataDir & "\Achievement Watcher\cfg\userdir_temp.db" + + If Not FileExists($file) Then + ;FileCopy(@ScriptDir & "\steam_settings\ach\cfg\userdir.db", $file, 1) + FileWriteLine($file, "[") + FileWriteLine($file, "]") + If FileExists($temp) Then FileDelete($temp) + Local $aLines + _FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + Else + Local $aLines, $hMatch + _FileReadToArray($file, $aLines) + For $i = 1 To $aLines[0] + If StringInStr($aLines[$i], $userdir_line2) Then $hMatch = 1 + Next + If $hMatch == 1 Then + If FileExists($temp) Then FileDelete($temp) + Else + If FileExists($temp) Then FileDelete($temp) + ;Local $aLines + ;_FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + EndIf + EndIf + + _ReplaceStringInFile($file, " }" & @CRLF & " {", " }," & @CRLF & " {") + + Else + + $userdir_line1 = ' {' + $userdir_line2 = ' "path": "' & StringReplace(@AppDataDir & "\" & $gse_saves, "\", "\\") & '",' + $userdir_line3 = ' "notify": true' + $userdir_line4 = ' }' + + $file = @AppDataDir & "\Achievement Watcher\cfg\userdir.db" + $temp = @AppDataDir & "\Achievement Watcher\cfg\userdir_temp.db" + + If Not FileExists($file) Then + ;FileCopy(@ScriptDir & "\steam_settings\ach\cfg\userdir.db", $file, 1) + FileWriteLine($file, "[") + FileWriteLine($file, "]") + If FileExists($temp) Then FileDelete($temp) + Local $aLines + _FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + Else + Local $aLines, $hMatch + _FileReadToArray($file, $aLines) + For $i = 1 To $aLines[0] + If StringInStr($aLines[$i], $userdir_line2) Then $hMatch = 1 + Next + If $hMatch == 1 Then + If FileExists($temp) Then FileDelete($temp) + Else + If FileExists($temp) Then FileDelete($temp) + ;Local $aLines + ;_FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + EndIf + EndIf + + _ReplaceStringInFile($file, " }" & @CRLF & " {", " }," & @CRLF & " {") + + EndIf + +EndIf \ No newline at end of file diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini new file mode 100644 index 00000000..fbe73d68 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini @@ -0,0 +1,3 @@ +[ARC_NAME] + +extra_acw = extra_acw.7z diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x new file mode 100644 index 00000000..25d8ead7 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 new file mode 100644 index 00000000..d2e42dca --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 @@ -0,0 +1,81 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +; ARC_NAME + +$arc_steam_api = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steam_api", "steam_api.7z") +$arc_steam_api64 = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steam_api64", "steam_api64.7z") + +$arc_steamclient = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steamclient", "steamclient.7z") +$arc_steamclient64 = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steamclient64", "steamclient64.7z") + +; DLL_PATH + +$steam_api_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api_release", "release\steam_api.dll") +$steam_api64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api64_release", "release\steam_api64.dll") + +$steam_api_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api_debug", "debug\steam_api.dll") +$steam_api64_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api64_debug", "debug\steam_api64.dll") + +$steamclient_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steamclient_release", "release\steamclient.dll") +$steamclient64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steamclient64_release", "release\steamclient64.dll") + +$steamclient_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steamclient_debug", "debug\steamclient.dll") +$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 + $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, "\\", "\") + If FileExists($steam_api_dst) Then + FileMove($steam_api_debug_src, $steam_api_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 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 + $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, "\\", "\") + If FileExists($steamclient_dst) Then + FileMove($steamclient_debug_src, $steamclient_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 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 + $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, "\\", "\") + If FileExists($steam_api_dst) Then + FileMove($steam_api_release_src, $steam_api_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 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 + $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, "\\", "\") + If FileExists($steamclient_dst) Then + FileMove($steamclient_release_src, $steamclient_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 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/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini new file mode 100644 index 00000000..4c32acbb --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini @@ -0,0 +1,22 @@ +[ARC_NAME] + +steam_api = steam_api.7z +steam_api64 = steam_api64.7z + +steamclient = steamclient.7z +steamclient64 = steamclient64.7z + + +[DLL_PATH] + +steam_api_release = release\steam_api.dll +steam_api64_release = release\steam_api64.dll + +steam_api_debug = debug\steam_api.dll +steam_api64_debug = debug\steam_api64.dll + +steamclient_release = release\steamclient.dll +steamclient64_release = release\steamclient64.dll + +steamclient_debug = debug\steamclient.dll +steamclient64_debug = debug\steamclient64.dll \ No newline at end of file diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x new file mode 100644 index 00000000..bd7ca33e Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 new file mode 100644 index 00000000..c76d8aac --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 @@ -0,0 +1,200 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +#include + +; ARC_NAME + +$arc_generate_interfaces = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "generate_interfaces", "generate_interfaces.7z") + +; EXE_PATH + +$generate_interfaces_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "generate_interfaces_release", "generate_interfaces.exe") +$generate_interfaces64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "generate_interfaces64_release", "generate_interfaces64.exe") + +$generate_interfaces_7z = @ScriptDir & '\steam_misc\tools\generate_interfaces\' & $arc_generate_interfaces +$generate_interfaces_dst = @ScriptDir & '\steam_misc\tools\generate_interfaces' +$generate_interfaces_exe = '' +Switch @OSArch + Case 'X64' + $generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) ; generate_interfaces64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case 'X86' + $generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)) ; generate_interfaces.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case Else + $generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) ; generate_interfaces64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE) + EndIf +EndSwitch + +If Not FileExists(@ScriptDir & '\steam_api.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) +If Not FileExists(@ScriptDir & '\steam_api64.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) + +Switch @OSArch + Case 'X64' + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + $generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)) + EndIf + Case 'X86' + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) Then + $generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) + EndIf + Case Else + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + $generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)) + EndIf +EndSwitch + +If FileExists(@ScriptDir & '\valve_api.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\valve_api.dll.bak' & '"', @ScriptDir, @SW_HIDE) +EndIf + +If FileExists(@ScriptDir & '\steam_api.dll.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api.dll.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api_orig.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api_orig.dll' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api_legit.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api_legit.dll' & '"', @ScriptDir, @SW_HIDE) +#ElseIf FileExists(@ScriptDir & '\steam_api.dll') Then + #RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll' & '"', @ScriptDir, @SW_HIDE) +EndIf + +If FileExists(@ScriptDir & '\valve_api64.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\valve_api64.dll.bak' & '"', @ScriptDir, @SW_HIDE) +EndIf + +If FileExists(@ScriptDir & '\steam_api64.dll.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64.dll.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64_orig.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe &' ' & '"' & @ScriptDir & '\steam_api64_orig.dll' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64_legit.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe &' ' & '"' & @ScriptDir & '\steam_api64_legit.dll' & '"', @ScriptDir, @SW_HIDE) +#ElseIf FileExists(@ScriptDir & '\steam_api64.dll') Then + #RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll' & '"', @ScriptDir, @SW_HIDE) +EndIf + +FileMove(@ScriptDir & '\steam_interfaces.txt', @ScriptDir & '\steam_settings\steam_interfaces.txt', 9) +FileCopy(@ScriptDir & '\steam_settings\steam_interfaces.txt', @ScriptDir & '\steam_settings\steam_interfaces.ini', 9) + +$hFile=FileOpen(@ScriptDir & '\steam_settings\steam_interfaces.ini',0) +$sOld=FileRead($hFile) +FileClose($hFile) +$hFile=FileOpen(@ScriptDir & '\steam_settings\steam_interfaces.ini',2) +$sNew='[steam_interfaces]' & @CRLF & $sOld +FileWrite($hFile,$sNew) +FileClose($hFile) + +$interfaces_ini = @ScriptDir & '\steam_settings\steam_interfaces.ini' +$codex_ini = @ScriptDir & '\steam_misc\extra_cdx\steam_emu.ini' + +If FileExists($codex_ini) Then + + _ReplaceStringInFile($interfaces_ini, 'STEAMAPPLIST_', 'SteamAppList=STEAMAPPLIST_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMAPPS_', 'SteamApps=STEAMAPPS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMAPPTICKET_', 'SteamAppTicket=STEAMAPPTICKET_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamClient', 'SteamClient=SteamClient', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamController', 'SteamController=SteamController', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamFriends', 'SteamFriends=SteamFriends', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameCoordinator', 'SteamGameCoordinator=SteamGameCoordinator', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameServerStats', 'Steam_Game_Server_Stats=Steam_Game_Server_Stats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameServer', 'SteamGameServer=SteamGameServer', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Game_Server_Stats', 'SteamGameServerStats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameStats', 'SteamGameStats=SteamGameStats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMHTMLSURFACE_', 'SteamHTMLSurface=STEAMHTMLSURFACE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMHTTP_', 'SteamHTTP=STEAMHTTP_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamInput', 'SteamInput=SteamInput', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMINVENTORY_', 'SteamInventory=STEAMINVENTORY_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMasterServerUpdater', 'SteamMasterServerUpdater=SteamMasterServerUpdater', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMatchGameSearch', 'SteamMatchGameSearch=SteamMatchGameSearch', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMatchMakingServers', 'Steam_Match_Making_Servers=Steam_Match_Making_Servers', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMatchMaking', 'SteamMatchMaking=SteamMatchMaking', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Match_Making_Servers', 'SteamMatchMakingServers', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMMUSIC_', 'SteamMusic=STEAMMUSIC_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMMUSICREMOTE_', 'SteamMusicRemote=STEAMMUSICREMOTE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingMessages', 'Steam_Networking_Messages=Steam_Networking_Messages', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingSocketsSerialized', 'Steam_Networking_Sockets_Serialized=Steam_Networking_Sockets_Serialized', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingSockets', 'Steam_Networking_Sockets=Steam_Networking_Sockets', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingUtils', 'Steam_Networking_Utils=Steam_Networking_Utils', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworking', 'SteamNetworking=SteamNetworking', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Messages', 'SteamNetworkingMessages', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Sockets_Serialized', 'SteamNetworkingSocketsSerialized', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Sockets', 'SteamNetworkingSockets', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Utils', 'SteamNetworkingUtils', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMPARENTALSETTINGS_', 'SteamParentalSettings=STEAMPARENTALSETTINGS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamParties', 'SteamParties=SteamParties', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMREMOTEPLAY_', 'SteamRemotePlay=STEAMREMOTEPLAY_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMREMOTESTORAGE_', 'SteamRemoteStorage=STEAMREMOTESTORAGE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMSCREENSHOTS_', 'SteamScreenshots=STEAMSCREENSHOTS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMTIMELINE_', 'SteamTimeline=STEAMTIMELINE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMTV_', 'SteamTV=STEAMTV_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMUGC_', 'SteamUGC=STEAMUGC_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMUNIFIEDMESSAGES_', 'SteamUnifiedMessages=STEAMUNIFIEDMESSAGES_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMUSERSTATS_', 'Steam_User_Stats=STEAMUSERSTATS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamUser', 'SteamUser=SteamUser', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_User_Stats', 'SteamUserStats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamUtils', 'SteamUtils=SteamUtils', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMVIDEO_', 'SteamVideo=STEAMVIDEO_', 1, 1) + + IniWrite($codex_ini, 'Interfaces', 'SteamAppList', IniRead($interfaces_ini, 'steam_interfaces', 'SteamAppList', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamApps', IniRead($interfaces_ini, 'steam_interfaces', 'SteamApps', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamAppTicket', IniRead($interfaces_ini, 'steam_interfaces', 'SteamAppTicket', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamClient', IniRead($interfaces_ini, 'steam_interfaces', 'SteamClient', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamController', IniRead($interfaces_ini, 'steam_interfaces', 'SteamController', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamFriends', IniRead($interfaces_ini, 'steam_interfaces', 'SteamFriends', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameCoordinator', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameCoordinator', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameServerStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameServerStats', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameServer', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameServer', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameStats', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamHTMLSurface', IniRead($interfaces_ini, 'steam_interfaces', 'SteamHTMLSurface', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamHTTP', IniRead($interfaces_ini, 'steam_interfaces', 'SteamHTTP', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamInput', IniRead($interfaces_ini, 'steam_interfaces', 'SteamInput', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamInventory', IniRead($interfaces_ini, 'steam_interfaces', 'SteamInventory', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMasterServerUpdater', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMasterServerUpdater', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMatchGameSearch', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchGameSearch', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMatchMakingServers', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchMakingServers', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMatchMaking', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchMaking', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMusic', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMusic', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMusicRemote', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMusicRemote', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingMessages', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingMessages', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingSocketsSerialized', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingSocketsSerialized', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingSockets', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingSockets', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingUtils', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingUtils', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworking', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworking', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamParentalSettings', IniRead($interfaces_ini, 'steam_interfaces', 'SteamParentalSettings', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamParties', IniRead($interfaces_ini, 'steam_interfaces', 'SteamParties', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamRemotePlay', IniRead($interfaces_ini, 'steam_interfaces', 'SteamRemotePlay', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamRemoteStorage', IniRead($interfaces_ini, 'steam_interfaces', 'SteamRemoteStorage', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamScreenshots', IniRead($interfaces_ini, 'steam_interfaces', 'SteamScreenshots', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamTimeline', IniRead($interfaces_ini, 'steam_interfaces', 'SteamTimeline', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamTV', IniRead($interfaces_ini, 'steam_interfaces', 'SteamTV', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUGC', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUGC', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUnifiedMessages', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUnifiedMessages', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUserStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUserStats', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUser', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUser', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUtils', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUtils', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamVideo', IniRead($interfaces_ini, 'steam_interfaces', 'SteamVideo', '')) + +EndIf + +FileDelete($interfaces_ini) diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini new file mode 100644 index 00000000..42f9f825 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini @@ -0,0 +1,9 @@ +[ARC_NAME] + +generate_interfaces = generate_interfaces.7z + + +[EXE_PATH] + +generate_interfaces_release = generate_interfaces.exe +generate_interfaces64_release = generate_interfaces64.exe diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x new file mode 100644 index 00000000..42592c3d Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 new file mode 100644 index 00000000..dade2dcd --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 @@ -0,0 +1,57 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +#include + +; ARC_NAME + +$arc_lobby_connect = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "lobby_connect", "lobby_connect.7z") + +; EXE_PATH + +$lobby_connect_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "lobby_connect_release", "lobby_connect.exe") +$lobby_connect64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "lobby_connect64_release", "lobby_connect64.exe") + +$lobby_connect_7z = @ScriptDir & '\steam_misc\tools\lobby_connect\' & $arc_lobby_connect +$lobby_connect_dst = @ScriptDir & '\steam_misc\tools\lobby_connect' +$lobby_connect_exe = '' +Switch @OSArch + Case 'X64' + $lobby_connect_exe = StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1)) ; lobby_connect64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $lobby_connect_7z & '" -o"' & $lobby_connect_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case 'X86' + $lobby_connect_exe = StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1)) ; lobby_connect.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $lobby_connect_7z & '" -o"' & $lobby_connect_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case Else + $lobby_connect_exe = StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1)) ; lobby_connect64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $lobby_connect_7z & '" -o"' & $lobby_connect_dst & '" -aoa', "", "", @SW_HIDE) + EndIf +EndSwitch + +If Not FileExists(@ScriptDir & '\steam_api.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1))) +If Not FileExists(@ScriptDir & '\steam_api64.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) + +Switch @OSArch + Case 'X64' + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + $lobby_connect_exe = StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1)) + EndIf + Case 'X86' + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1))) Then + $lobby_connect_exe = StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1)) + EndIf + Case Else + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + $lobby_connect_exe = StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1)) + EndIf +EndSwitch + +RunWait($lobby_connect_dst & '\' & $lobby_connect_exe, @ScriptDir, @SW_SHOW) \ No newline at end of file diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini new file mode 100644 index 00000000..de426c92 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini @@ -0,0 +1,9 @@ +[ARC_NAME] + +generate_interfaces = lobby_connect.7z + + +[EXE_PATH] + +lobby_connect_release = lobby_connect.exe +lobby_connect64_release = lobby_connect64.exe diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat new file mode 100644 index 00000000..150b973c --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\acw_helper.a3x .\ +copy .\steam_misc\tools\au3\scripts\acw_helper.ini .\ +ren .\acw_helper.a3x gse_acw_helper.a3x +ren .\acw_helper.ini gse_acw_helper.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript .\gse_acw_helper.a3x +del .\gse_acw_helper.a3x +del .\gse_acw_helper.ini \ No newline at end of file diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat new file mode 100644 index 00000000..47bd5cac --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\debug_switch.a3x .\ +copy .\steam_misc\tools\au3\scripts\debug_switch.ini .\ +ren .\debug_switch.a3x gse_debug_switch.a3x +ren .\debug_switch.ini gse_debug_switch.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript ".\gse_debug_switch.a3x" +del .\gse_debug_switch.a3x +del .\gse_debug_switch.ini \ No newline at end of file diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat new file mode 100644 index 00000000..de124a90 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\generate_interfaces.a3x .\ +copy .\steam_misc\tools\au3\scripts\generate_interfaces.ini .\ +ren .\generate_interfaces.a3x gse_generate_interfaces.a3x +ren .\generate_interfaces.ini gse_generate_interfaces.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript .\gse_generate_interfaces.a3x +del .\gse_generate_interfaces.a3x +del .\gse_generate_interfaces.ini \ No newline at end of file diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat new file mode 100644 index 00000000..44a2ac34 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\lobby_connect.a3x .\ +copy .\steam_misc\tools\au3\scripts\lobby_connect.ini .\ +ren .\lobby_connect.a3x gse_lobby_connect.a3x +ren .\lobby_connect.ini gse_lobby_connect.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript .\gse_lobby_connect.a3x +del .\gse_lobby_connect.a3x +del .\gse_lobby_connect.ini \ No newline at end of file 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 new file mode 100644 index 00000000..f22a8221 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z 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 new file mode 100644 index 00000000..b915ab27 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/account_avatar.jpg b/tools/generate_emu_config/_DEFAULT/1/steam_settings/account_avatar.jpg new file mode 100644 index 00000000..aa490cb4 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/account_avatar.jpg differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/account_avatar_default.jpg b/tools/generate_emu_config/_DEFAULT/1/steam_settings/account_avatar_default.jpg new file mode 100644 index 00000000..aa490cb4 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/account_avatar_default.jpg differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.app.ini b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.app.ini new file mode 100644 index 00000000..9b0a19b7 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.app.ini @@ -0,0 +1,26 @@ +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[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 +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 +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 +unlock_all=0 +# format: ID=name +# 1234=DLCNAME +# 56789=This is another example DLC name + +[app::paths] +# format: ID=path +# 556760=../DLCRoot0 +# 1234=./folder_where_steam_api_is +# 3456=../folder_one_level_above_where_steam_api_is +# 5678=../../folder_two_levels_above_where_steam_api_is diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.main.ini b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.main.ini new file mode 100644 index 00000000..e92b7034 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.main.ini @@ -0,0 +1,80 @@ +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[main::general] +# generate new app auth ticket +new_app_ticket=1 +# generate/embed GC token inside new app ticket +gc_token=1 +# pretend the app is running on a steam deck +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 +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 +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 +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 +crash_printer_location=./EMU_CRASHES.txt + +[main::connectivity] +# prevent hooking OS networking APIs and allow any external requests +# only used by the experimental builds on Windows +disable_lan_only=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 +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 +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 +offline=0 +# prevent sharing stats and achievements with any game server, also disables the interface ISteamGameServerStats +disable_sharing_stats_with_gameserver=0 +# do not send server details to the server browser, only works for game servers +disable_source_query=0 +# enable sharing leaderboards scores with people playing the same game on the same network +share_leaderboards_over_network=0 +# prevent lobby creation in steam matchmaking interface +disable_lobby_creation=0 +# attempt to download external HTTP(S) requests made via Steam_HTTP::SendHTTPRequest() inside "steam_settings/http/" +# 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 + +############################################ +# mostly workarounds for specific problems # +############################################ + +[main::misc] +# force SetAchievement() to always return true +achievements_bypass=0 +# force the function Steam_HTTP::SendHTTPRequest() to always succeed +force_steamhttp_success=0 +# env var SteamOverlayGameId breaks Steam Input when the game is added to Steam as a non-steam game +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 +# https://developer.valvesoftware.com/wiki/Steam_Application_IDs +# https://developer.valvesoftware.com/wiki/Dedicated_Servers_List +enable_steam_preowned_ids=0 diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.overlay.ini b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.overlay.ini new file mode 100644 index 00000000..8e282a59 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.overlay.ini @@ -0,0 +1,112 @@ +# # +# USE AT YOUR OWN RISK :: This feature might cause crashes or other problems # +# # +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[overlay::general] +# enable the experimental overlay, might cause crashes +enable_experimental_overlay=1 +# 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 +disable_achievement_notification=0 +# disable friends invitations and messages notifications +disable_friend_notification=0 +# disable showing notifications for achievements progress +disable_achievement_progress=0 +# disable any warning in the overlay +disable_warning_any=0 +# disable the bad app ID warning in the overlay +disable_warning_bad_appid=0 +# disable the local_save warning in the overlay +disable_warning_local_save=0 + +[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 +Font_Size=16.0 + +# achievement icon size +Icon_Size=64.0 + +# spacing between characters +Font_Glyph_Extra_Spacing_x=1.0 +Font_Glyph_Extra_Spacing_y=0.0 + +# background for all types of notifications +Notification_R=0.12 +Notification_G=0.14 +Notification_B=0.21 +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 +Notification_Animation=0.35 + +# duration of achievement progress indication +Notification_Duration_Progress=6.0 +# duration of achievement unlocked +Notification_Duration_Achievement=6.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 +# look for the format here: https://en.cppreference.com/w/cpp/chrono/c/strftime +Achievement_Unlock_Datetime_Format=%Y/%m/%d - %H:%M:%S + +# main background when you press shift+tab +Background_R=0.12 +Background_G=0.11 +Background_B=0.11 +Background_A=0.55 + +Element_R=0.30 +Element_G=0.32 +Element_B=0.40 +Element_A=1.0 + +ElementHovered_R=0.278 +ElementHovered_G=0.393 +ElementHovered_B=0.602 +ElementHovered_A=1.0 + +ElementActive_R=-1.0 +ElementActive_G=-1.0 +ElementActive_B=-1.0 +ElementActive_A=-1.0 + +# ############################# # +# available options: +# top_left +# top_center +# top_right +# bot_left +# bot_center +# bot_right + +# position of achievements +PosAchievement=bot_right +# position of invitations +PosInvitation=top_right +# position of chat messages +PosChatMsg=top_center +# ############################# # + diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.user.ini b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.user.ini new file mode 100644 index 00000000..b22a1af7 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_settings/configs.user.ini @@ -0,0 +1,26 @@ +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[user::general] +# user account name +account_name=goldberg +# Steam64 format +account_steamid=76561197960287930 +# the language reported to the app/game +# look for the column 'API language code' here: https://partner.steamgames.com/doc/store/localization/languages +# default=english +language=english +# report a country IP if the game queries it +# ISO 3166-1-alpha-2 format, use this link to get the 'Alpha-2' country code: https://www.iban.com/country-codes +# default=US +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 +# 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=GSE Saves +saves_folder_name=GSE Saves diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_a.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_a.png new file mode 100644 index 00000000..4b83560f Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_a.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_b.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_b.png new file mode 100644 index 00000000..339788fc Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_b.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_x.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_x.png new file mode 100644 index 00000000..ccac01ea Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_x.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_y.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_y.png new file mode 100644 index 00000000..caa8fd0e Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/button_y.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_l.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_l.png new file mode 100644 index 00000000..0bde85e0 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_l.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_r.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_r.png new file mode 100644 index 00000000..7f17f6d0 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_r.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_e.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_e.png new file mode 100644 index 00000000..6232a752 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_e.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_n.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_n.png new file mode 100644 index 00000000..a54222ca Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_n.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_s.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_s.png new file mode 100644 index 00000000..21974621 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_s.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_w.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_w.png new file mode 100644 index 00000000..dc07f43a Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_w.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_click.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_click.png new file mode 100644 index 00000000..237f1ed5 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_click.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_move.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_move.png new file mode 100644 index 00000000..34d2fe25 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_move.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_click.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_click.png new file mode 100644 index 00000000..2d76fdc7 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_click.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_move.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_move.png new file mode 100644 index 00000000..4f40b3df Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_move.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_click.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_click.png new file mode 100644 index 00000000..1ad596f0 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_click.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_pull.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_pull.png new file mode 100644 index 00000000..1ad596f0 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_pull.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_click.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_click.png new file mode 100644 index 00000000..5fc0f32a Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_click.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_pull.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_pull.png new file mode 100644 index 00000000..5fc0f32a Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_pull.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_e.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_e.png new file mode 100644 index 00000000..b2416cd9 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_e.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_move.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_move.png new file mode 100644 index 00000000..29817da3 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_move.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_n.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_n.png new file mode 100644 index 00000000..8dab7ac7 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_n.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_s.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_s.png new file mode 100644 index 00000000..654bdb69 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_s.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_w.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_w.png new file mode 100644 index 00000000..3885e638 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_w.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_select.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_select.png new file mode 100644 index 00000000..e3fabc18 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_select.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_start.png b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_start.png new file mode 100644 index 00000000..46814629 Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_start.png differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/emu_version.txt b/tools/generate_emu_config/_DEFAULT/1/steam_settings/emu_version.txt new file mode 100644 index 00000000..b09dd503 --- /dev/null +++ b/tools/generate_emu_config/_DEFAULT/1/steam_settings/emu_version.txt @@ -0,0 +1,4 @@ +release + +you are currently using the 'release' version of the emulator +use 'gse_debug_switch.exe' if you want to use the 'debug' version \ No newline at end of file diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/fonts/Roboto-Medium.ttf b/tools/generate_emu_config/_DEFAULT/1/steam_settings/fonts/Roboto-Medium.ttf new file mode 100644 index 00000000..ac0f908b Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/fonts/Roboto-Medium.ttf differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/sounds/overlay_achievement_notification.wav b/tools/generate_emu_config/_DEFAULT/1/steam_settings/sounds/overlay_achievement_notification.wav new file mode 100644 index 00000000..7fbc54cb Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/sounds/overlay_achievement_notification.wav differ diff --git a/tools/generate_emu_config/_DEFAULT/1/steam_settings/sounds/overlay_friend_notification.wav b/tools/generate_emu_config/_DEFAULT/1/steam_settings/sounds/overlay_friend_notification.wav new file mode 100644 index 00000000..7fbc54cb Binary files /dev/null and b/tools/generate_emu_config/_DEFAULT/1/steam_settings/sounds/overlay_friend_notification.wav differ diff --git a/tools/generate_emu_config/bat/generate_emu_config.py_ini.bat b/tools/generate_emu_config/bat/generate_emu_config.py_ini.bat new file mode 100644 index 00000000..a930df05 --- /dev/null +++ b/tools/generate_emu_config/bat/generate_emu_config.py_ini.bat @@ -0,0 +1,6 @@ +@echo off +pip install -U steam[client] +pip install pyinstaller +pip install requests +pip install certifi +pip install configobj \ No newline at end of file diff --git a/tools/generate_emu_config/bat/generate_emu_config.py_run_anon.bat b/tools/generate_emu_config/bat/generate_emu_config.py_run_anon.bat new file mode 100644 index 00000000..82ca6858 --- /dev/null +++ b/tools/generate_emu_config/bat/generate_emu_config.py_run_anon.bat @@ -0,0 +1,3 @@ +@echo off +set /p arg="Generate Emu Config for Steam AppId: " +python -W ignore::DeprecationWarning generate_emu_config.py -img -scr -vids_low -vids_max -scx -cdx -acw -clr -anon %arg% \ No newline at end of file diff --git a/tools/generate_emu_config/bat/generate_emu_config.py_run_test.bat b/tools/generate_emu_config/bat/generate_emu_config.py_run_test.bat new file mode 100644 index 00000000..8684c798 --- /dev/null +++ b/tools/generate_emu_config/bat/generate_emu_config.py_run_test.bat @@ -0,0 +1,3 @@ +@echo off +set /p arg="Generate Emu Config for Steam AppId: " +python -W ignore::DeprecationWarning generate_emu_config.py -img -scr -vids_low -vids_max -scx -cdx -acw -clr %arg% \ No newline at end of file diff --git a/tools/generate_emu_config/bat/generate_emu_config.py_run_user.bat b/tools/generate_emu_config/bat/generate_emu_config.py_run_user.bat new file mode 100644 index 00000000..6ba30e82 --- /dev/null +++ b/tools/generate_emu_config/bat/generate_emu_config.py_run_user.bat @@ -0,0 +1,3 @@ +@echo off +set /p arg="Generate Emu Config for Steam AppId: " +python -W ignore::DeprecationWarning generate_emu_config.py -cdx -acw -clr %arg% \ No newline at end of file diff --git a/tools/generate_emu_config/controller_config_generator/parse_controller_vdf.py b/tools/generate_emu_config/controller_config_generator/parse_controller_vdf.py index 3a19555c..ff7a0958 100644 --- a/tools/generate_emu_config/controller_config_generator/parse_controller_vdf.py +++ b/tools/generate_emu_config/controller_config_generator/parse_controller_vdf.py @@ -1,5 +1,6 @@ #controller vdf script by mr_goldberg #generates controller config from a vdf + import vdf import sys import os @@ -65,7 +66,7 @@ def add_input_bindings(group, bindings, force_binding=None, keymap=keymap_digita else: bindings[action_name] = [binding] else: - print(f"[X] missing keymap for {i}") + print(f"[X] ____ missing keymap for {i}") return bindings @@ -128,7 +129,7 @@ def generate_controller_config(controller_vdf, config_dir): bindings = add_input_bindings(group, bindings, binding) else: - print("unhandled trigger mode", group["mode"]) + print("[X] ____ unhandled trigger mode", group["mode"]) if s[0].lower() in ["joystick", "right_joystick", "dpad"]: group = groups_byid[number] @@ -144,7 +145,7 @@ def generate_controller_config(controller_vdf, config_dir): elif s[0].lower() == "dpad": binding = "DPAD" else: - print("could not handle", s[0]) + print("[X] ____ could not handle", s[0]) if action_name in bindings: if binding not in bindings[action_name] and (binding + "=joystick_move") not in bindings[action_name]: bindings[action_name].insert(0, binding) @@ -168,7 +169,7 @@ def generate_controller_config(controller_vdf, config_dir): if s[0].lower() != "dpad": print("no pad", s[0]) else: - print("unhandled joy mode", group["mode"]) + print("[X] ____ unhandled joy mode", group["mode"]) all_bindings[name] = bindings @@ -200,14 +201,14 @@ if __name__ == '__main__': for vdf_file in sys.argv[1:]: try: - print(f"parsing controller file '{vdf_file}'") + print(f"[ ] parsing controller file '{vdf_file}'") t = '' with open(vdf_file, 'rb') as f: t = f.read().decode('utf-8') if t: filename = os.path.basename(vdf_file) outdir = os.path.join(f"{filename}_config", "steam_settings", "controller") - print(f"output dir: '{outdir}'") + print(f"[ ] __ output dir: '{outdir}'") generate_controller_config(t, outdir) else: print("[X] couldn't load file", file=sys.stderr) diff --git a/tools/generate_emu_config/external_components/ach_watcher_gen.py b/tools/generate_emu_config/external_components/ach_watcher_gen.py index 7cea6adf..b376b07d 100644 --- a/tools/generate_emu_config/external_components/ach_watcher_gen.py +++ b/tools/generate_emu_config/external_components/ach_watcher_gen.py @@ -2,6 +2,7 @@ import copy import os import time import json +import shutil def __ClosestDictKey(targetKey : str, srcDict : dict[str, object] | set[str]) -> str | None: for k in srcDict: @@ -11,6 +12,7 @@ def __ClosestDictKey(targetKey : str, srcDict : dict[str, object] | set[str]) -> return None def __generate_ach_watcher_schema(lang: str, app_id: int, achs: list[dict]) -> list[dict]: + print(f"[ ] __ writing {lang} {app_id}.db to '.\\schema\\{lang}' folder") out_achs_list = [] for idx in range(len(achs)): ach = copy.deepcopy(achs[idx]) @@ -23,20 +25,20 @@ def __generate_ach_watcher_schema(lang: str, app_id: int, achs: list[dict]) -> l if type(ach_displayName) == dict: # this is a dictionary displayName : str = ach_displayName.get(lang, "") if not displayName and ach_displayName: # has some keys but language not found - #print(f'[?] Missing language "{lang}" in "displayName" of achievement {ach["name"]}') + print(f"[X] ____ Missing {lang} language in 'displayName' of achievement {ach['name']}") nearestLang = __ClosestDictKey(lang, ach_displayName) if nearestLang: - #print(f'[?] Best matching language "{nearestLang}"') + print(f"[ ] ____ Using 'displayName' from {nearestLang} language") displayName = ach_displayName[nearestLang] else: - print(f'[?] Missing language "{lang}", using displayName from the first language for achievement {ach["name"]}') + print(f"[ ] ____ Using 'displayName' from the first language") displayName : str = list(ach_displayName.values())[0] else: # single string (or anything else) displayName = ach_displayName del ach["displayName"] else: - print(f'[?] Missing "displayName" in achievement {ach["name"]}') + print(f"[X] ____ Missing 'displayName' in achievement {ach['name']}") out_ach_data["displayName"] = displayName @@ -46,20 +48,20 @@ def __generate_ach_watcher_schema(lang: str, app_id: int, achs: list[dict]) -> l if type(ach_desc) == dict: # this is a dictionary desc : str = ach_desc.get(lang, "") if not desc and ach_desc: # has some keys but language not found - #print(f'[?] Missing language "{lang}" in "description" of achievement {ach["name"]}') + print(f"[X] ____ Missing {lang} language in 'description' of achievement {ach['name']}") nearestLang = __ClosestDictKey(lang, ach_desc) if nearestLang: - #print(f'[?] Best matching language "{nearestLang}"') + print(f"[ ] ____ Using 'description' from {nearestLang} language") desc = ach_desc[nearestLang] else: - print(f'[?] Missing language "{lang}", using description from the first language for achievement {ach["name"]}') + print(f"[ ] ____ Using 'description' from the first language") desc : str = list(ach_desc.values())[0] else: # single string (or anything else) desc = ach_desc del ach["description"] else: - print(f'[?] Missing "description" in achievement {ach["name"]}') + print(f"[X] ____ Missing 'description' in achievement {ach['name']}") # adjust the description out_ach_data["description"] = desc @@ -106,17 +108,17 @@ def generate_all_ach_watcher_schemas( achs: list[dict], small_icon_hash : str) -> None: - ach_watcher_out_dir = os.path.join(base_out_dir, "Achievement Watcher", "steam_cache", "schema") - print(f"generating schemas for Achievement Watcher in: {ach_watcher_out_dir}") - - if app_exe: - print(f"detected app exe: '{app_exe}'") - else: - print(f"[X] couldn't detect app exe") + ach_watcher_out_dir = os.path.join(base_out_dir, "steam_misc", "extra_acw", "steam_cache", "schema") - # if not achs: - # print("[X] No achievements were found for Achievement Watcher") - # return + if not achs: + #print("[X] Couldn't generate Achievement Watcher schemas, no achievements found") # move notification to main script + return + else: + print(f"[ ] Generating Achievement Watcher schemas...") + #if app_exe: + # print(f"[ ] __ Detected app exe: '{app_exe}'") # move notification to main script + #else: + # print(f"[X] __ Cannot detect app exe") # move notification to main script small_icon_url = '' if small_icon_hash: @@ -157,8 +159,11 @@ def generate_all_ach_watcher_schemas( langs.remove(tokenKey) if not langs: - print("[X] Couldn't detect supported languages, assuming English is the only supported language for Achievement Watcher") + print(f"[X] __ Cannot detect supported languages") + print(f"[ ] __ Assuming english is the only supported language") langs = ["english"] + + print(f"[ ] __ schema = OUTPUT\\{appid}\\steam_misc\\achievement_watcher\\steam_cache\\schema") for lang in langs: out_schema_folder = os.path.join(ach_watcher_out_dir, lang) @@ -171,3 +176,8 @@ def generate_all_ach_watcher_schemas( out_schema_file = os.path.join(out_schema_folder, f'{appid}.db') with open(out_schema_file, "wt", encoding='utf-8') as f: json.dump(out_schema, f, ensure_ascii=False, indent=2) + + shutil.make_archive(os.path.join(base_out_dir, "steam_misc\\extra_acw"), 'zip', os.path.join(base_out_dir, "steam_misc\\extra_acw")) # first argument is the name of the zip file + shutil.rmtree(os.path.join(base_out_dir, "steam_misc\\extra_acw")) + os.makedirs(os.path.join(base_out_dir, "steam_misc\\extra_acw")) + shutil.move(os.path.join(base_out_dir, 'steam_misc\\extra_acw.zip'), os.path.join(base_out_dir, "steam_misc\\extra_acw\\extra_acw.zip")) diff --git a/tools/generate_emu_config/external_components/app_details.py b/tools/generate_emu_config/external_components/app_details.py index e8ee7b39..1367e3ee 100644 --- a/tools/generate_emu_config/external_components/app_details.py +++ b/tools/generate_emu_config/external_components/app_details.py @@ -1,10 +1,12 @@ import os +import re import sys import traceback import json import queue import threading import time +import shutil import requests import urllib.parse from external_components import ( @@ -29,11 +31,11 @@ def __downloader_thread(q : queue.Queue[tuple[str, str]]): break except Exception as e: - print(f"Error downloading from '{url}'", file=sys.stderr) + print(f"[X] __ Error downloading from '{url}'", file=sys.stderr) traceback.print_exception(e, file=sys.stderr) time.sleep(0.1) - + q.task_done() def __remove_url_query(url : str) -> str: @@ -42,33 +44,27 @@ def __remove_url_query(url : str) -> str: url_parts_list[3] = '' # remove query return str(urllib.parse.urlunsplit(url_parts_list)) -def __download_screenshots( - base_out_dir : str, - appid : int, - app_details : dict, - download_screenshots : bool, - download_thumbnails : bool): - if not download_screenshots and not download_thumbnails: - return - +def __download_screenshots(base_out_dir : str, appid : int, app_details : dict ): screenshots : list[dict[str, object]] = app_details.get(f'{appid}', {}).get('data', {}).get('screenshots', []) if not screenshots: - print(f'[?] no screenshots or thumbnails are available') + print(f'[?] No screenshots found - nothing downloaded') return - screenshots_out_dir = os.path.join(base_out_dir, "screenshots") - if download_screenshots: - print(f"downloading screenshots in: {screenshots_out_dir}") - if not os.path.exists(screenshots_out_dir): - os.makedirs(screenshots_out_dir) - time.sleep(0.025) + screenshot_number = len(screenshots) + if screenshot_number > 1: + print(f"[ ] Found {screenshot_number} app screenshots --- downloading...") + else: + print(f"[ ] Found {screenshot_number} app screenshot --- downloading...") + + screenshots_out_dir = os.path.join(base_out_dir, "steam_misc\\app_screens") + thumbnails_out_dir = os.path.join(screenshots_out_dir, "thumbs") - thumbnails_out_dir = os.path.join(screenshots_out_dir, "thumbnails") - if download_thumbnails: - print(f"downloading screenshots thumbnails in: {thumbnails_out_dir}") - if not os.path.exists(thumbnails_out_dir): - os.makedirs(thumbnails_out_dir) - time.sleep(0.025) + if not os.path.exists(screenshots_out_dir): + os.makedirs(screenshots_out_dir) + time.sleep(0.025) + if not os.path.exists(thumbnails_out_dir): + os.makedirs(thumbnails_out_dir) + time.sleep(0.025) q : queue.Queue[tuple[str, str]] = queue.Queue() @@ -77,26 +73,32 @@ def __download_screenshots( threading.Thread(target=__downloader_thread, args=(q,), daemon=True).start() for scrn in screenshots: - if download_screenshots: - full_image_url = scrn.get('path_full', None) - if full_image_url: - full_image_url_sanitized = __remove_url_query(full_image_url) - image_hash_name = f'{full_image_url_sanitized.rsplit("/", 1)[-1]}'.rstrip() - if image_hash_name: - q.put((full_image_url_sanitized, os.path.join(screenshots_out_dir, image_hash_name))) - else: - print(f'[X] cannot download screenshot from url: "{full_image_url}", failed to get image name') - - if download_thumbnails: - thumbnail_url = scrn.get('path_thumbnail', None) - if thumbnail_url: - thumbnail_url_sanitized = __remove_url_query(thumbnail_url) - image_hash_name = f'{thumbnail_url_sanitized.rsplit("/", 1)[-1]}'.rstrip() - if image_hash_name: - q.put((thumbnail_url_sanitized, os.path.join(thumbnails_out_dir, image_hash_name))) - else: - print(f'[X] cannot download screenshot thumbnail from url: "{thumbnail_url}", failed to get image name') - + if screenshot_number <= 9: + screenshot_number_str = str(0) + str(screenshot_number) + else: + screenshot_number_str = str(screenshot_number) + + full_image_url = scrn.get('path_full', None) + if full_image_url: + full_image_url_sanitized = __remove_url_query(full_image_url) + image_hash_name = f'{full_image_url_sanitized.rsplit("/", 1)[-1]}'.rstrip() + if image_hash_name: + q.put((full_image_url_sanitized, os.path.join(screenshots_out_dir, "screenshot " + screenshot_number_str + ".jpg"))) + else: + print(f'[X] __ url: "{full_image_url}"') + print(f'[X] ____ Cannot download screenshot from url - failed to get image name') + thumbnail_url = scrn.get('path_thumbnail', None) + if thumbnail_url: + thumbnail_url_sanitized = __remove_url_query(thumbnail_url) + image_hash_name = f'{thumbnail_url_sanitized.rsplit("/", 1)[-1]}'.rstrip() + if image_hash_name: + q.put((thumbnail_url_sanitized, os.path.join(thumbnails_out_dir, "screenshot " + screenshot_number_str + " _ small.jpg"))) + else: + print(f'[X] __ url: "{thumbnail_url}"') + print(f'[X] ____ Cannot download screenshot thumbnail from url - failed to get image name') + + screenshot_number = screenshot_number - 1 + q.join() for i in range(max_threads): @@ -104,102 +106,222 @@ def __download_screenshots( q.join() - print(f"finished downloading app screenshots") + #print(f"[ ] Finished downloading app screenshots") -PREFERED_VIDS = [ - 'trailer', 'gameplay', 'announcement' -] +PREFERED_VIDS = ['trailer', 'gameplay', 'announcement'] +PREFERED_VIDS_active = 0 -def __download_videos(base_out_dir : str, appid : int, app_details : dict): +def __download_videos(base_out_dir : str, appid : int, app_details : dict, download_low : bool, download_max : bool): videos : list[dict[str, object]] = app_details.get(f'{appid}', {}).get('data', {}).get('movies', []) if not videos: - print(f'[?] no videos were found') + print(f'[?] No app videos found - nothing downloaded') return - videos_out_dir = os.path.join(base_out_dir, "videos") - print(f"downloading app videos in: {videos_out_dir}") + videos_out_dir = os.path.join(base_out_dir, "steam_misc\\app_videos") + + video_number = len(videos) + if video_number > 1: + print(f"[ ] Found {video_number} app videos --- downloading...") + else: + print(f"[ ] Found {video_number} app video --- downloading...") + + video_number_low = video_number + video_number_max = video_number first_vid : tuple[str, str] = None prefered_vid : tuple[str, str] = None + for vid in videos: vid_name = f"{vid.get('name', '')}" - webm_url = vid.get('webm', {}).get("480", None) - mp4_url = vid.get('mp4', {}).get("480", None) + thumb_url = f"{vid.get('thumbnail', '')}" - ext : str = None - prefered_url : str = None - if mp4_url: - prefered_url = mp4_url - ext = 'mp4' - elif webm_url: - prefered_url = webm_url - ext = 'webm' - else: # no url is found - print(f'[X] no url is found for video "{vid_name}"') - continue - - vid_url_sanitized = __remove_url_query(prefered_url) - vid_name_in_url = f'{vid_url_sanitized.rsplit("/", 1)[-1]}'.rstrip() - vid_name = safe_name.create_safe_name(vid_name) - if vid_name: - vid_name = f'{vid_name}.{ext}' - else: - vid_name = vid_name_in_url + vid_name_low = vid_name + vid_name_max = vid_name - if vid_name: - if not first_vid: - first_vid = (vid_url_sanitized, vid_name) + if download_low == True: + webm_url = vid.get('webm', {}).get("480", None) + mp4_url = vid.get('mp4', {}).get("480", None) - if any(vid_name.lower().find(candidate) > -1 for candidate in PREFERED_VIDS): - prefered_vid = (vid_url_sanitized, vid_name) + ext : str = None + prefered_url : str = None + if mp4_url: + prefered_url = mp4_url + ext = 'mp4' + elif webm_url: + prefered_url = webm_url + ext = 'webm' + else: # no url found + print(f'[X] __ No url found for video "{vid_name}"') + continue - if prefered_vid: - break - else: - print(f'[X] cannot download video from url: "{prefered_url}", failed to get vido name') + if video_number_low <= 9: + video_number_low_str = str(0) + str(video_number_low) + else: + video_number_low_str = str(video_number_low) + + vid_url_sanitized = __remove_url_query(prefered_url) + vid_name_in_url = f'{vid_url_sanitized.rsplit("/", 1)[-1]}'.rstrip() + vid_name_low = safe_name.create_safe_name(vid_name_low) + if vid_name_low: + vid_name_orig = f'{vid_name}.{ext}' + vid_name_low = video_number_low_str + ". " + f'{vid_name_low} _low_res.{ext}' + else: + vid_name_orig = vid_name_in_url + vid_name_low = video_number_low_str + ". " + vid_name_in_url + + video_download = 0 + + if vid_name_low: + if not first_vid: + first_vid = (vid_url_sanitized, vid_name_low) + + if PREFERED_VIDS_active == 1: + if any(vid_name_low.lower().find(candidate) > -1 for candidate in PREFERED_VIDS): + prefered_vid = (vid_url_sanitized, vid_name_low) + video_number_low = video_number_low - 1 + video_download = 1 + else: + prefered_vid = (vid_url_sanitized, vid_name_low) + video_number_low = video_number_low - 1 + video_download = 1 + + if video_download == 1: + + if not os.path.exists(videos_out_dir): + os.makedirs(videos_out_dir) + time.sleep(0.05) + + q : queue.Queue[tuple[str, str]] = queue.Queue() + + max_threads = 1 + for i in range(max_threads): + threading.Thread(target=__downloader_thread, args=(q,), daemon=True).start() + + # download all videos + #print(f'[ ] __ downloading video: "{vid_name_orig}"') + print(f'[ ] __ downloading low_res video: "{vid_name_orig}"') + q.put((prefered_vid[0], os.path.join(videos_out_dir, prefered_vid[1]))) + q.join() + + for i in range(max_threads): + q.put((None, None)) + + q.join() + + else: + print(f'[X] __ url: "{prefered_url}"') + print(f'[X] ____ Cannot download video from url - failed to get video name') + + if download_max == True: + webm_url = vid.get('webm', {}).get("max", None) + mp4_url = vid.get('mp4', {}).get("max", None) + + ext : str = None + prefered_url : str = None + if mp4_url: + prefered_url = mp4_url + ext = 'mp4' + elif webm_url: + prefered_url = webm_url + ext = 'webm' + else: # no url found + print(f'[X] __ No url found for video "{vid_name}"') + continue + + if video_number_max <= 9: + video_number_max_str = str(0) + str(video_number_max) + else: + video_number_max_str = str(video_number_max) + + vid_url_sanitized = __remove_url_query(prefered_url) + vid_name_in_url = f'{vid_url_sanitized.rsplit("/", 1)[-1]}'.rstrip() + vid_name_max = safe_name.create_safe_name(vid_name_max) + if vid_name_max: + vid_name_orig = f'{vid_name}.{ext}' + vid_name_max = video_number_max_str + ". " + f'{vid_name_max} _max_res.{ext}' + else: + vid_name_orig = vid_name_in_url + vid_name_max = video_number_max_str + ". " + vid_name_in_url + + video_download = 0 + + if vid_name_max: + if not first_vid: + first_vid = (vid_url_sanitized, vid_name_max) + + if PREFERED_VIDS_active == 1: + if any(vid_name_max.lower().find(candidate) > -1 for candidate in PREFERED_VIDS): + prefered_vid = (vid_url_sanitized, vid_name_max) + video_number_max = video_number_max - 1 + video_download = 1 + else: + prefered_vid = (vid_url_sanitized, vid_name_max) + video_number_max = video_number_max - 1 + video_download = 1 + + if video_download == 1: + + if not os.path.exists(videos_out_dir): + os.makedirs(videos_out_dir) + time.sleep(0.05) + + q : queue.Queue[tuple[str, str]] = queue.Queue() + + max_threads = 1 + for i in range(max_threads): + threading.Thread(target=__downloader_thread, args=(q,), daemon=True).start() + + # download all videos + #print(f'[ ] __ downloading video: "{vid_name_orig}"') + print(f'[ ] __ downloading max_res video: "{vid_name_orig}"') + q.put((prefered_vid[0], os.path.join(videos_out_dir, prefered_vid[1]))) + q.join() + + for i in range(max_threads): + q.put((None, None)) + + q.join() + + else: + print(f'[X] __ url: "{prefered_url}"') + print(f'[X] ____ Cannot download video from url - failed to get video name') + + # NOTE some video thumbnails don't get numbered properly - no idea why that happens, as they should have the same number and name as the video... better to disable it now + # LOL, if I'm gonna duplicate code, at least make sure it's the same in both instances next time (I was using 'if video_number <= 9:' instead of 'if video_number_max <= 9:') + if not os.path.exists(os.path.join(videos_out_dir, "thumbs")): + os.makedirs(os.path.join(videos_out_dir, "thumbs")) + time.sleep(0.05) + + if thumb_url and prefered_vid: + response = requests.get(thumb_url, stream=True) + with open(os.path.join(videos_out_dir, "thumbs\\", prefered_vid[1].replace(' _low_res', '').replace(' _max_res', '').strip("." + ext) + " _ small.jpg"),'wb') as thumb_file: + thumb_file.write(response.content) + + ''' # NOTE if enabled, only first found video is downloaded + if prefered_vid: + break + ''' if not first_vid and not prefered_vid: - print(f'[X] no video url could be found') + print(f'[X] __ No video url found') return - elif not prefered_vid: - prefered_vid = first_vid - - if not os.path.exists(videos_out_dir): - os.makedirs(videos_out_dir) - time.sleep(0.05) - - q : queue.Queue[tuple[str, str]] = queue.Queue() - - max_threads = 1 - for i in range(max_threads): - threading.Thread(target=__downloader_thread, args=(q,), daemon=True).start() - - # TODO download all videos - print(f'donwloading video: "{prefered_vid[1]}"') - q.put((prefered_vid[0], os.path.join(videos_out_dir, prefered_vid[1]))) - q.join() - - for i in range(max_threads): - q.put((None, None)) - - q.join() - print(f"finished downloading app videos") - + #print(f"[ ] Finished downloading app videos") def download_app_details( base_out_dir : str, info_out_dir : str, appid : int, download_screenshots : bool, - download_thumbnails : bool, - download_vids : bool): + download_vids : bool, + downl_low : bool, + downl_max : bool): details_out_file = os.path.join(info_out_dir, "app_details.json") - print(f"downloading app details in: {details_out_file}") app_details : dict = None last_exception : Exception | str = None + # try 3 times for download_trial in range(3): try: @@ -218,17 +340,33 @@ def download_app_details( time.sleep(0.1) if not app_details: - err = "[X] failed to download app details" - if last_exception: - err += f', last error: "{last_exception}"' - - print(err) + print(f"[?] No app details found - skip creating 'app_details.json'") + #if last_exception: # skip showing last_exception + # print(f"[X] __ last error: {last_exception}") return with open(details_out_file, "wt", encoding='utf-8') as f: json.dump(app_details, f, ensure_ascii=False, indent=2) + print(f"[ ] Found app details --- writing to 'app_details.json'") # move it here to avoid showing both 'downloading' and 'cannot download' - __download_screenshots(base_out_dir, appid, app_details, download_screenshots, download_thumbnails) - + if download_screenshots: + __download_screenshots(base_out_dir, appid, app_details) + + if os.path.isdir(os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs')): + if os.listdir(os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs')): # zip 'thumbs' folder only if not empty + shutil.make_archive(os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs'), 'zip', os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs')) # first argument is the name of the zip file + shutil.rmtree(os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs')) + os.makedirs(os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs')) + shutil.move(os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs.zip'), os.path.join(base_out_dir, 'steam_misc\\app_screens\\thumbs\\thumbs.zip')) + if download_vids: - __download_videos(base_out_dir, appid, app_details) + __download_videos(base_out_dir, appid, app_details, downl_low, downl_max) + + # NOTE some video thumbnails don't get numbered properly - no idea why that happens, as they should have the same number and name as the video... better to disable it now + if os.path.isdir(os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs')): + if os.listdir(os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs')): # zip 'thumbs' folder only if not empty + shutil.make_archive(os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs'), 'zip', os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs')) # first argument is the name of the zip file + shutil.rmtree(os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs')) + os.makedirs(os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs')) + shutil.move(os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs.zip'), os.path.join(base_out_dir, 'steam_misc\\app_videos\\thumbs\\thumbs.zip')) + diff --git a/tools/generate_emu_config/external_components/app_images.py b/tools/generate_emu_config/external_components/app_images.py index 63139f16..adc79710 100644 --- a/tools/generate_emu_config/external_components/app_images.py +++ b/tools/generate_emu_config/external_components/app_images.py @@ -3,7 +3,6 @@ import threading import time import requests - def download_app_images( base_out_dir : str, appid : int, @@ -12,8 +11,7 @@ def download_app_images( logo : str, logo_small : str): - icons_out_dir = os.path.join(base_out_dir, "images") - print(f"downloading common app images in: {icons_out_dir}") + icons_out_dir = os.path.join(base_out_dir, "steam_misc", "app_images") def downloader_thread(image_name : str, image_url : str): # try 3 times @@ -23,7 +21,6 @@ def download_app_images( if r.status_code == requests.codes.ok: # if download was successfull with open(os.path.join(icons_out_dir, image_name), "wb") as f: f.write(r.content) - break except Exception as ex: pass @@ -31,25 +28,130 @@ def download_app_images( time.sleep(0.1) app_images_names = [ - r'capsule_184x69.jpg', - r'capsule_231x87.jpg', - r'capsule_231x87_alt_assets_0.jpg', - r'capsule_467x181.jpg', - r'capsule_616x353.jpg', - r'capsule_616x353_alt_assets_0.jpg', - r'library_600x900.jpg', - r'library_600x900_2x.jpg', - r'library_hero.jpg', r'broadcast_left_panel.jpg', r'broadcast_right_panel.jpg', - r'page.bg.jpg', - r'page_bg_raw.jpg', - r'page_bg_generated.jpg', - r'page_bg_generated_v6b.jpg', + r'capsule_231x87.jpg', + r'capsule_231x87_alt_assets_0.jpg', + r'capsule_231x87_alt_assets_1.jpg', + r'capsule_231x87_alt_assets_2.jpg', + r'capsule_231x87_alt_assets_3.jpg', + r'capsule_231x87_alt_assets_4.jpg', + r'capsule_231x87_alt_assets_5.jpg', + r'capsule_231x87_alt_assets_6.jpg', + r'capsule_231x87_alt_assets_7.jpg', + r'capsule_231x87_alt_assets_8.jpg', + r'capsule_231x87_alt_assets_9.jpg', + r'capsule_467x181.jpg', + r'capsule_467x181_alt_assets_0.jpg', + r'capsule_467x181_alt_assets_1.jpg', + r'capsule_467x181_alt_assets_2.jpg', + r'capsule_467x181_alt_assets_3.jpg', + r'capsule_467x181_alt_assets_4.jpg', + r'capsule_467x181_alt_assets_5.jpg', + r'capsule_467x181_alt_assets_6.jpg', + r'capsule_467x181_alt_assets_7.jpg', + r'capsule_467x181_alt_assets_8.jpg', + r'capsule_467x181_alt_assets_9.jpg', + r'capsule_616x353.jpg', + r'capsule_616x353_alt_assets_0.jpg', + r'capsule_616x353_alt_assets_1.jpg', + r'capsule_616x353_alt_assets_2.jpg', + r'capsule_616x353_alt_assets_3.jpg', + r'capsule_616x353_alt_assets_4.jpg', + r'capsule_616x353_alt_assets_5.jpg', + r'capsule_616x353_alt_assets_6.jpg', + r'capsule_616x353_alt_assets_7.jpg', + r'capsule_616x353_alt_assets_8.jpg', + r'capsule_616x353_alt_assets_9.jpg', r'header.jpg', r'header_alt_assets_0.jpg', + r'header_alt_assets_1.jpg', + r'header_alt_assets_2.jpg', + r'header_alt_assets_3.jpg', + r'header_alt_assets_4.jpg', + r'header_alt_assets_5.jpg', + r'header_alt_assets_6.jpg', + r'header_alt_assets_7.jpg', + r'header_alt_assets_8.jpg', + r'header_alt_assets_9.jpg', r'hero_capsule.jpg', - r'logo.png', + r'hero_capsule_alt_assets_0.jpg', + r'hero_capsule_alt_assets_1.jpg', + r'hero_capsule_alt_assets_2.jpg', + r'hero_capsule_alt_assets_3.jpg', + r'hero_capsule_alt_assets_4.jpg', + r'hero_capsule_alt_assets_5.jpg', + r'hero_capsule_alt_assets_6.jpg', + r'hero_capsule_alt_assets_7.jpg', + r'hero_capsule_alt_assets_8.jpg', + r'hero_capsule_alt_assets_9.jpg', + r'library_600x900.jpg', + r'library_600x900_alt_assets_0.jpg', + r'library_600x900_alt_assets_1.jpg', + r'library_600x900_alt_assets_2.jpg', + r'library_600x900_alt_assets_3.jpg', + r'library_600x900_alt_assets_4.jpg', + r'library_600x900_alt_assets_5.jpg', + r'library_600x900_alt_assets_6.jpg', + r'library_600x900_alt_assets_7.jpg', + r'library_600x900_alt_assets_8.jpg', + r'library_600x900_alt_assets_9.jpg', + r'library_600x900_2x.jpg', + r'library_600x900_2x_alt_assets_0.jpg', + r'library_600x900_2x_alt_assets_1.jpg', + r'library_600x900_2x_alt_assets_2.jpg', + r'library_600x900_2x_alt_assets_3.jpg', + r'library_600x900_2x_alt_assets_4.jpg', + r'library_600x900_2x_alt_assets_5.jpg', + r'library_600x900_2x_alt_assets_6.jpg', + r'library_600x900_2x_alt_assets_7.jpg', + r'library_600x900_2x_alt_assets_8.jpg', + r'library_600x900_2x_alt_assets_9.jpg', + r'library_hero.jpg', + r'library_hero_alt_assets_0.jpg', + r'library_hero_alt_assets_1.jpg', + r'library_hero_alt_assets_2.jpg', + r'library_hero_alt_assets_3.jpg', + r'library_hero_alt_assets_4.jpg', + r'library_hero_alt_assets_5.jpg', + r'library_hero_alt_assets_6.jpg', + r'library_hero_alt_assets_7.jpg', + r'library_hero_alt_assets_8.jpg', + r'library_hero_alt_assets_9.jpg', + r'page_bg_raw.jpg', + r'page_bg_raw_alt_assets_0.jpg', + r'page_bg_raw_alt_assets_1.jpg', + r'page_bg_raw_alt_assets_2.jpg', + r'page_bg_raw_alt_assets_3.jpg', + r'page_bg_raw_alt_assets_4.jpg', + r'page_bg_raw_alt_assets_5.jpg', + r'page_bg_raw_alt_assets_6.jpg', + r'page_bg_raw_alt_assets_7.jpg', + r'page_bg_raw_alt_assets_8.jpg', + r'page_bg_raw_alt_assets_9.jpg', + r'page_bg_generated.jpg', + r'page_bg_generated_alt_assets_0.jpg', + r'page_bg_generated_alt_assets_1.jpg', + r'page_bg_generated_alt_assets_2.jpg', + r'page_bg_generated_alt_assets_3.jpg', + r'page_bg_generated_alt_assets_4.jpg', + r'page_bg_generated_alt_assets_5.jpg', + r'page_bg_generated_alt_assets_6.jpg', + r'page_bg_generated_alt_assets_7.jpg', + r'page_bg_generated_alt_assets_8.jpg', + r'page_bg_generated_alt_assets_9.jpg', + r'page_bg_generated_v6b.jpg', + r'page_bg_generated_v6b_alt_assets_0.jpg', + r'page_bg_generated_v6b_alt_assets_1.jpg', + r'page_bg_generated_v6b_alt_assets_2.jpg', + r'page_bg_generated_v6b_alt_assets_3.jpg', + r'page_bg_generated_v6b_alt_assets_4.jpg', + r'page_bg_generated_v6b_alt_assets_5.jpg', + r'page_bg_generated_v6b_alt_assets_6.jpg', + r'page_bg_generated_v6b_alt_assets_7.jpg', + r'page_bg_generated_v6b_alt_assets_8.jpg', + r'page_bg_generated_v6b_alt_assets_9.jpg', + r'logo.png' ] if not os.path.exists(icons_out_dir): @@ -88,7 +190,7 @@ def download_app_images( threads_list.append(t) t.start() + print(f"[ ] Downloading app art images...") + for t in threads_list: t.join() - - print(f"finished downloading common app images") \ No newline at end of file diff --git a/tools/generate_emu_config/external_components/cdx_gen.py b/tools/generate_emu_config/external_components/cdx_gen.py index e3a06ae5..4ce1e76c 100644 --- a/tools/generate_emu_config/external_components/cdx_gen.py +++ b/tools/generate_emu_config/external_components/cdx_gen.py @@ -1,17 +1,17 @@ import os -__cdx_ini = ''' -### мллллл м -### Алллл плл лВ ппплллллллм пппппллВллм мВлллп -### Блллп Бллп ппллллА пллл Блллп -### Вллл п ллВ плллБ АллВллл -### Вллл млллллм ллл пллл мллллллм Бллллл -### лллА Аллллп плВ ллл лллВллВ Алл лллВллл -### Бллл ллллА лл ллл Алллллллллллп лллБ Бллл -### Алллм мллпВллм млл Влл лллБлллА млллА Алллм -### плллллп плллВп ллп АлллА плллллллВлп пВллм -### мллллллБ -### пппллВмммммлВлллВпп +__codex_ini = ''' +### ÜÛÛÛÛÛ Ü +### °ÛÛÛÛ ßÛÛ Û² ßßßÛÛÛÛÛÛÛÜ ßßßßßÛÛ²ÛÛÜ Ü²ÛÛÛß +### ±ÛÛÛß ±ÛÛß ßßÛÛÛÛ° ßÛÛÛ ±ÛÛÛß +### ²ÛÛÛ ß ÛÛ² ßÛÛÛ± °ÛÛ²ÛÛÛ +### ²ÛÛÛ ÜÛÛÛÛÛÜ ÛÛÛ ßÛÛÛ ÜÛÛÛÛÛÛÜ ±ÛÛÛÛÛ +### ÛÛÛ° °ÛÛÛÛß ßÛ² ÛÛÛ ÛÛÛ²ÛÛ² °ÛÛ ÛÛÛ²ÛÛÛ +### ±ÛÛÛ ÛÛÛÛ° ÛÛ ÛÛÛ °ÛÛÛÛÛÛÛÛÛÛÛß ÛÛÛ± ±ÛÛÛ +### °ÛÛÛÜ ÜÛÛß²ÛÛÜ ÜÛÛ ²ÛÛ ÛÛÛ±ÛÛÛ° ÜÛÛÛ° °ÛÛÛÜ +### ßÛÛÛÛÛß ßÛÛÛ²ß ÛÛß °ÛÛÛ° ßÛÛÛÛÛÛÛ²Ûß ß²ÛÛÜ +### ÜÛÛÛÛÛÛ± +### ßßßÛÛ²ÜÜÜÜÜÛ²ÛÛÛ²ßß ### ### ### Game data is stored at %SystemDrive%\\Users\\Public\\Documents\\Steam\\CODEX\\{cdx_id} @@ -25,15 +25,15 @@ AppId={cdx_id} ### ### Steam Account ID, set it to 0 to get a random Account ID ### -#AccountId=0 +AccountId={cdx_accountid} ### ### Name of the current player ### -UserName=Player2 +UserName={cdx_username} ### ### Language that will be used in the game ### -Language=english +Language={cdx_language} ### ### Enable lobby mode ### @@ -51,41 +51,51 @@ Overlays=1 ### Offline=0 ### +SelfProtect=0 +### [Interfaces] ### ### Steam Client API interface versions ### -SteamAppList=STEAMAPPLIST_INTERFACE_VERSION001 -SteamApps=STEAMAPPS_INTERFACE_VERSION008 -SteamClient=SteamClient017 -SteamController=SteamController008 -SteamFriends=SteamFriends017 -SteamGameServer=SteamGameServer013 -SteamGameServerStats=SteamGameServerStats001 -SteamHTMLSurface=STEAMHTMLSURFACE_INTERFACE_VERSION_005 -SteamHTTP=STEAMHTTP_INTERFACE_VERSION003 -SteamInput=SteamInput002 -SteamInventory=STEAMINVENTORY_INTERFACE_V003 -SteamMatchGameSearch=SteamMatchGameSearch001 -SteamMatchMaking=SteamMatchMaking009 -SteamMatchMakingServers=SteamMatchMakingServers002 -SteamMusic=STEAMMUSIC_INTERFACE_VERSION001 -SteamMusicRemote=STEAMMUSICREMOTE_INTERFACE_VERSION001 -SteamNetworking=SteamNetworking006 -SteamNetworkingSockets=SteamNetworkingSockets008 -SteamNetworkingUtils=SteamNetworkingUtils003 -SteamParentalSettings=STEAMPARENTALSETTINGS_INTERFACE_VERSION001 -SteamParties=SteamParties002 -SteamRemotePlay=STEAMREMOTEPLAY_INTERFACE_VERSION001 -SteamRemoteStorage=STEAMREMOTESTORAGE_INTERFACE_VERSION014 -SteamScreenshots=STEAMSCREENSHOTS_INTERFACE_VERSION003 -SteamTV=STEAMTV_INTERFACE_V001 -SteamUGC=STEAMUGC_INTERFACE_VERSION015 -SteamUser=SteamUser021 -SteamUserStats=STEAMUSERSTATS_INTERFACE_VERSION012 -SteamUtils=SteamUtils010 -SteamVideo=STEAMVIDEO_INTERFACE_V002 +SteamAppList= +SteamApps= +SteamAppTicket= +SteamClient= +SteamController= +SteamFriends= +SteamGameCoordinator= +SteamGameServerStats= +SteamGameServer= +SteamGameStats= +SteamHTMLSurface= +SteamHTTP= +SteamInput= +SteamInventory= +SteamMasterServerUpdater= +SteamMatchGameSearch= +SteamMatchMakingServers= +SteamMatchMaking= +SteamMusic= +SteamMusicRemote= +SteamNetworkingMessages= +SteamNetworkingSocketsSerialized= +SteamNetworkingSockets= +SteamNetworkingUtils= +SteamNetworking= +SteamParentalSettings= +SteamParties= +SteamRemotePlay= +SteamRemoteStorage= +SteamScreenshots= +SteamTimeline= +SteamTV= +SteamUGC= +SteamUnifiedMessages= +SteamUserStats= +SteamUser= +SteamUtils= +SteamVideo= ### [DLC] @@ -110,19 +120,25 @@ DLCUnlockall=0 ### [Crack] -00ec7837693245e3=b7d5bc716512b5d6 +c7a90c3ffa71981e=b7d5bc716512b5d6 ''' - def generate_cdx_ini( base_out_dir : str, appid: int, + accountid: int, + username: str, + language: str, dlc: list[tuple[int, str]], achs: list[dict]) -> None: - cdx_ini_path = os.path.join(base_out_dir, "steam_emu.ini") - print(f"generating steam_emu.ini for CODEX emulator in: {cdx_ini_path}") + if not os.path.exists(os.path.join(base_out_dir, "steam_misc\\extra_cdx")): + os.makedirs(os.path.join(base_out_dir, "steam_misc\\extra_cdx")) + + codex_ini_path = os.path.join(base_out_dir, "steam_misc\\extra_cdx\\steam_emu.ini") + print(f"[ ] Generating RUNE / CODEX / PLAZA config --- writing 'steam_emu.ini'") + print(f"[ ] __ if to be used, make sure it has the correct interface versions") dlc_list = [f"{d[0]}={d[1]}" for d in dlc] achs_list = [] @@ -146,12 +162,14 @@ def generate_cdx_ini( achs_list.append(f'{ach["name"]} Achieved={icon}') # unlocked achs_list.append(f'{ach["name"]} Unachieved={icon_gray}') # locked - formatted_ini = __cdx_ini.format( + formatted_ini = __codex_ini.format( cdx_id = appid, + cdx_username = username, + cdx_accountid = accountid, + cdx_language = language, cdx_dlc_list = "\n".join(dlc_list), cdx_ach_list = "\n".join(achs_list) ) - with open(cdx_ini_path, "wt", encoding='utf-8') as f: + with open(codex_ini_path, "wt", encoding='utf-8') as f: f.writelines(formatted_ini) - diff --git a/tools/generate_emu_config/external_components/safe_name.py b/tools/generate_emu_config/external_components/safe_name.py index e0cbb207..29fafa9b 100644 --- a/tools/generate_emu_config/external_components/safe_name.py +++ b/tools/generate_emu_config/external_components/safe_name.py @@ -1,7 +1,5 @@ - import re - ALLOWED_CHARS = set([ '`', '~', '!', '@', '#', '$', '%', '&', @@ -19,4 +17,3 @@ def create_safe_name(app_name : str): .replace('\t', ' ') safe_name = re.sub('\s\s+', ' ', safe_name) return safe_name - diff --git a/tools/generate_emu_config/external_components/scx_gen.py b/tools/generate_emu_config/external_components/scx_gen.py new file mode 100644 index 00000000..32e127a8 --- /dev/null +++ b/tools/generate_emu_config/external_components/scx_gen.py @@ -0,0 +1,860 @@ +import os, re, sys, requests, shutil, traceback +import urllib.request +from configobj import ConfigObj +from external_components import ( + safe_name +) + +# https://stackoverflow.com/a/48336994 # NOTE alternatively we could use 're.findall(str(re.escape(string1))+"(.*)"+str(re.escape(string2)),stringSubject)[0]' +def GetListOfSubstrings(stringSubject,string1,string2): + MyList = [] + intstart=0 + strlength=len(stringSubject) + continueloop = 1 + + while(intstart < strlength and continueloop == 1): + intindex1=stringSubject.find(string1,intstart) + if(intindex1 != -1): #The substring was found, lets proceed + intindex1 = intindex1+len(string1) + intindex2 = stringSubject.find(string2,intindex1) + if(intindex2 != -1): + subsequence=stringSubject[intindex1:intindex2] + MyList.append(subsequence) + intstart=intindex2+len(string2) + else: + continueloop=0 + else: + continueloop=0 + return MyList + +# https://stackoverflow.com/a/13641746 # NOTE using this fix a strange issue where first name value of some ini files had starting and trailing double quotes ( " ) +def ReplaceStringInFile(f_file, search_string, old_string, new_string): + with open(f_file, 'r') as file: + lines = file.readlines() + #matching_lines = [line.strip() for line in lines if ' = "' in line] + #return matching_lines + for line in lines: + if search_string in line: + # Read contents from file as a single string + f_handle = open(f_file, 'r') + f_string = f_handle.read() + f_handle.close() + + # Use RE package to allow for replacement, also allowing for multi-line REGEX + f_string = (re.sub(old_string, new_string, f_string)) + + # Write contents to file - using 'w' truncates the file + f_handle = open(f_file, 'w') + f_handle.write(f_string) + f_handle.close() + +def ParseNumber(number): + if int(number) <= 9: + number = str(0) + str(number) + else: + number = str(number) + return number + +def download_scx(base_out_dir : str, appid : int): + + market_link = f"https://www.steamcardexchange.net/index.php?gamepage-appid-{appid}" + + if not os.path.exists(os.path.join(base_out_dir, 'steam_misc\\app_scx')): + os.makedirs(os.path.join(base_out_dir, 'steam_misc\\app_scx')) + + with urllib.request.urlopen(market_link) as f: + html = f.read().decode('utf-8') + + file = os.path.join(base_out_dir, "steam_misc\\app_scx\\app_scx.txt") + with open(file, 'w', encoding='utf-8') as f: + f.write(html) + + if os.path.isfile(os.path.join(base_out_dir, 'steam_misc\\app_scx\\app_scx.txt')): + with open(os.path.join(base_out_dir, 'steam_misc\\app_scx\\app_scx.txt'), 'r', encoding='utf-8') as app_scx: + app_scx_line = app_scx.readlines() + + #line_number_prev = 0 # previous line number, unused + line_section = "" + line_series_hash = "" + line_series_name = "" + line_series_count = 0 + + _trading_cards = "" + _foil_trading_cards = "" + _booster_pack = "" + _badges = "" + _foil_badges = "" + _emoticons = "" + _backgrounds = "" + _animated_stickers = "" + _animated_backgrounds = "" + _animated_mini_backgrounds = "" + _avatar_frames = "" + _animated_avatars = "" + _profiles = "" + + _game_found=True + + for line in app_scx_line: + if 'Game not found' in line: + shutil.rmtree(os.path.join(base_out_dir, 'steam_misc\\app_scx')) + _game_found=False + break + + if ('class="tracking-wider font-league-gothic"' in line) and ('')[0] + series_name = GetListOfSubstrings(line, f'', '')[0] + + not_series = ['>Note<', '>Trading Cards<', '>Foil Trading Cards<', '>Booster Pack<', '>Badges<', '>Foil Badges<', '>Emoticons<', '>Backgrounds<', '>Animated Stickers<', '>Animated Backgrounds<', '>Animated Mini Backgrounds<', '>Avatar Frames<', '>Animated Avatars<', '>Startup Movie<', '>Profiles<'] + + if all(sub not in line for sub in not_series): + line_series_hash = str(series_hash) + line_series_name = str(series_name) + line_series_name = line_series_name.replace('&', '&').replace("'", "'").replace('"', '"').replace(' ', ' ') + line_series_name_safe = safe_name.create_safe_name(line_series_name) + + if not os.path.exists(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{line_series_name_safe}')): + os.makedirs(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{line_series_name_safe}')) + if not os.path.exists(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{appid}_s.txt')): + with open(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{appid}_s.txt'), 'w') as f_txt: + f_txt.close() + with open(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{appid}_s.txt'), 'a') as f_txt: + f_txt.write(f'{line_series_name_safe}\n') + f_txt.close() + + line_series_count = line_series_count + 1 + + if 'Last update:' in line: + last_update = GetListOfSubstrings(line, '>Last update: ', ' - ')[0] + if not os.path.exists(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{appid}_u.txt')): + with open(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{appid}_u.txt'), 'w') as f_txt: + f_txt.close() + with open(os.path.join(base_out_dir, f'steam_misc\\app_scx\\{appid}_u.txt'), 'a') as f_txt: + f_txt.write(f'{last_update}\n') + f_txt.close() + + if f'' in line: + line_section = "Trading Cards" + _trading_cards_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_trading_cards.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_trading_cards.ini"), 'w') as file: + file.write("[trading_cards]") + #ini_cards_blue = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_trading_cards.ini"), encoding='utf-8', create_empty=True) + trading_cards_blue_count = 99 + trading_card_blue_bg_count = 0 + elif f'' in line: + line_section = "Foil Trading Cards" + _foil_trading_cards_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_trading_cards_foil.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_trading_cards_foil.ini"), 'w') as file: + file.write("[trading_cards_foil]") + #ini_cards_foil = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_trading_cards_foil.ini"), encoding='utf-8', create_empty=True) + trading_cards_foil_count = 99 + trading_card_foil_bg_count = 0 + elif f'' in line: + line_section = "Booster Pack" + _booster_pack_series = line_series_count + elif f'' in line: + line_section = "Badges" + _badges_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges.ini"), 'w') as file: + file.write("[badges]") + #ini_badges = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_badges.ini"), encoding='utf-8', create_empty=True) + badge_number = 0 + elif f'' in line: + line_section = "Foil Badges" + _foil_badges_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges_foil.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges_foil.ini"), 'w') as file: + file.write("[badges_foil]") + #ini_badges_foil = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_badges_foil.ini"), encoding='utf-8', create_empty=True) + badge_foil_number = 0 + elif f'' in line: + line_section = "Emoticons" + _emoticons_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_emoticons.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_emoticons.ini"), 'w') as file: + file.write("[emoticons]") + #ini_emoticons = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_emoticons.ini"), encoding='utf-8', create_empty=True) + emoticon_number_small = 0 + emoticon_number_large = 0 + elif f'' in line: + line_section = "Backgrounds" + _backgrounds_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_backgrounds.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_backgrounds.ini"), 'w') as file: + file.write("[backgrounds]") + #ini_backgrounds = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_backgrounds.ini"), encoding='utf-8', create_empty=True) + elif f'' in line: + line_section = "Animated Stickers" + _animated_stickers_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_stickers.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_stickers.ini"), 'w') as file: + file.write("[animated_stickers]") + #ini_stickers = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_animated_stickers.ini"), encoding='utf-8', create_empty=True) + sticker_animated_number = 0 + sticker_static_number = 0 + elif f'' in line: + line_section = "Animated Backgrounds" + _animated_backgrounds_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_backgrounds.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_backgrounds.ini"), 'w') as file: + file.write("[animated_backgrounds]") + #ini_animated_bg = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_animated_backgrounds.ini"), encoding='utf-8', create_empty=True) + animated_bg_number = 0 + elif f'' in line: + line_section = "Animated Mini Backgrounds" + _animated_mini_backgrounds_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_mini_backgrounds.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_mini_backgrounds.ini"), 'w') as file: + file.write("[animated_mini_backgrounds]") + #ini_animated_minibg = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_animated_mini_backgrounds.ini"), encoding='utf-8', create_empty=True) + animated_minibg_number = 0 + elif f'' in line: + line_section = "Avatar Frames" + _avatar_frames_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_avatar_frames.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_avatar_frames.ini"), 'w') as file: + file.write("[avatar_frames]") + #ini_avatar_frames = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_avatar_frames.ini"), encoding='utf-8', create_empty=True) + avatar_frame_count = 0 + avatar_frame_static_count =0 + elif f'' in line: + line_section = "Animated Avatars" + _animated_avatars_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_avatars.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_avatars.ini"), 'w') as file: + file.write("[animated_avatars]") + #ini_animated_avatars = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_animated_avatars.ini"), encoding='utf-8', create_empty=True) + animated_avatar_count = 0 + animated_avatar_static_count = 0 + elif f'' in line: + line_section = "Profiles" + _profiles_series = line_series_count + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_profiles.ini")): + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_profiles.ini"), 'w') as file: + file.write("[profiles]") + #ini_profiles = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name}\\app_profiles.ini"), encoding='utf-8', create_empty=True) + profile_count = 0 + + if line_section == "Trading Cards": + + if _trading_cards != line_series_name_safe: + if _trading_cards_series == line_series_count: # this fixes duplicating message for last found 'section' in html source, after finding a new 'series' + print(f"[ ] __ {line_series_name_safe} --- downloading trading cards...") + _trading_cards = line_series_name_safe + + if 'data-gallery-type="cards"' in line: + trading_card_blue_link = GetListOfSubstrings(line, 'Wallpaper<' in line: + trading_card_blue_bg_count = trading_card_blue_bg_count + 1 + if trading_card_blue_bg_count <= trading_cards_blue_count: + trading_card_blue_bg_link = GetListOfSubstrings(line, 'Wallpaper<' in line: + trading_card_foil_bg_count = trading_card_foil_bg_count + 1 + if trading_card_foil_bg_count <= trading_cards_foil_count: + trading_card_foil_bg_link = GetListOfSubstrings(line, '')[0] + badge_name = badge_name.replace('&', '&').replace("'", "'").replace('"', '"').replace(' ', ' ') + badge_name_safe = safe_name.create_safe_name(badge_name) + + ini_badges = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges.ini"), encoding='utf-8', create_empty=True) + ini_badges['badges'][f'badge{ParseNumber(badge_number)}_name'] = badge_name.strip('"') + ini_badges['badges'][f'badge{ParseNumber(badge_number)}_png'] = badge_link + ini_badges.write() + + ReplaceStringInFile(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges.ini"), ' = "', '"', '') + + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Badges")): + os.makedirs(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Badges")) + + try: + response_png = requests.get(badge_link) + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Badges\\{ParseNumber(badge_number)}. {badge_name_safe} _.png"), "wb") as f: + f.write(response_png.content) + except Exception as e: + print(f"[X] __ Error downloading from '{badge_link}'", file=sys.stderr) + traceback.print_exception(e, file=sys.stderr) + + elif line_section == "Foil Badges": + + #if _foil_badges != line_series_name_safe: + #if _foil_badges_series == line_series_count: # this fixes duplicating message for last found 'section' in html source, after finding a new 'series' + #print(f"[ ] __ {line_series_name_safe} --- downloading foil badges...") + #_foil_badges = line_series_name_safe + + if 'class="sm:h-[80px]"' in line: + badge_foil_link = GetListOfSubstrings(line, '')[0] + badge_foil_name = badge_foil_name.replace('&', '&').replace("'", "'").replace('"', '"').replace(' ', ' ') + badge_foil_name_safe = safe_name.create_safe_name(badge_foil_name) + + ini_badges_foil = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges_foil.ini"), encoding='utf-8', create_empty=True) + ini_badges_foil['badges_foil'][f'badge{ParseNumber(badge_foil_number)}_foil_name'] = badge_foil_name.strip('"') + ini_badges_foil['badges_foil'][f'badge{ParseNumber(badge_foil_number)}_foil_png'] = badge_foil_link + ini_badges_foil.write() + + ReplaceStringInFile(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_badges_foil.ini"), ' = "', '"', '') + + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Badges\\foil")): + os.makedirs(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Badges\\foil")) + + try: + response_png = requests.get(badge_foil_link) + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Badges\\foil\\{ParseNumber(badge_foil_number)}. {badge_foil_name_safe} _foil.png"), "wb") as f: + f.write(response_png.content) + except Exception as e: + print(f"[X] __ Error downloading from '{badge_foil_link}'", file=sys.stderr) + traceback.print_exception(e, file=sys.stderr) + + elif line_section == "Emoticons": + + if _emoticons != line_series_name_safe: + if _emoticons_series == line_series_count: # this fixes duplicating message for last found 'section' in html source, after finding a new 'series' + print(f"[ ] __ {line_series_name_safe} --- downloading emoticons...") + _emoticons = line_series_name_safe + + if 'class="sm:h-[54px]"' in line: + emoticon_link = GetListOfSubstrings(line, 'Animation<' in line: + avatar_frame_count = avatar_frame_count + 1 + avatar_frame_png = GetListOfSubstrings(line, 'Static<' in line: + avatar_frame_static_count = avatar_frame_static_count + 1 + avatar_frame_static_png = GetListOfSubstrings(line, '', '<')[0] + avatar_frame_name = avatar_frame_name.replace('&', '&').replace("'", "'").replace('"', '"').replace(' ', ' ') + avatar_frame_name_safe = safe_name.create_safe_name(avatar_frame_name) + + ini_avatar_frames = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_avatar_frames.ini"), encoding='utf-8', create_empty=True) + ini_avatar_frames['avatar_frames'][f'frame{ParseNumber(avatar_frame_count)}_name'] = avatar_frame_name.strip('"') + ini_avatar_frames.write() + + ReplaceStringInFile(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_avatar_frames.ini"), ' = "', '"', '') + + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Avatar Frames")): + os.makedirs(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Avatar Frames")) + + try: + response_png = requests.get(avatar_frame_png) + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Avatar Frames\\{ParseNumber(avatar_frame_count)}. {avatar_frame_name_safe} _.png"), "wb") as f: + f.write(response_png.content) + except Exception as e: + print(f"[X] __ Error downloading from '{avatar_frame_png}'", file=sys.stderr) + traceback.print_exception(e, file=sys.stderr) + + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Avatar Frames\\static")): + os.makedirs(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Avatar Frames\\static")) + + try: + response_png = requests.get(avatar_frame_static_png) + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Avatar Frames\\static\\{ParseNumber(avatar_frame_count)}. {avatar_frame_name_safe} _static.png"), "wb") as f: + f.write(response_png.content) + except Exception as e: + print(f"[X] __ Error downloading from '{avatar_frame_static_png}'", file=sys.stderr) + traceback.print_exception(e, file=sys.stderr) + + elif line_section == "Animated Avatars": + + if _animated_avatars != line_series_name_safe: + if _animated_avatars_series == line_series_count: # this fixes duplicating message for last found 'section' in html source, after finding a new 'series' + print(f"[ ] __ {line_series_name_safe} --- downloading animated avatars...") + _animated_avatars = line_series_name_safe + + if '>Animation<' in line: + animated_avatar_count = animated_avatar_count + 1 + animated_avatar_gif = GetListOfSubstrings(line, 'Static<' in line: + animated_avatar_static_count = animated_avatar_static_count + 1 + animated_avatar_jpg = GetListOfSubstrings(line, '', '<')[0] + animated_avatar_name = animated_avatar_name.replace('&', '&').replace("'", "'").replace('"', '"').replace(' ', ' ') + animated_avatar_name_safe = safe_name.create_safe_name(animated_avatar_name) + + ini_animated_avatars = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_avatars.ini"), encoding='utf-8', create_empty=True) + ini_animated_avatars['animated_avatars'][f'avatar{ParseNumber(animated_avatar_count)}_name'] = animated_avatar_name.strip('"') + ini_animated_avatars.write() + + ReplaceStringInFile(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_animated_avatars.ini"), ' = "', '"', '') + + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Animated Avatars")): + os.makedirs(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Animated Avatars")) + + try: + response_gif = requests.get(animated_avatar_gif) + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Animated Avatars\\{ParseNumber(animated_avatar_count)}. {animated_avatar_name_safe} _.gif"), "wb") as f: + f.write(response_gif.content) + except Exception as e: + print(f"[X] __ Error downloading from '{animated_avatar_gif}'", file=sys.stderr) + traceback.print_exception(e, file=sys.stderr) + + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Animated Avatars\\static")): + os.makedirs(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Animated Avatars\\static")) + + try: + response_jpg = requests.get(animated_avatar_jpg) + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Animated Avatars\\static\\{ParseNumber(animated_avatar_count)}. {animated_avatar_name_safe} _static.jpg"), "wb") as f: + f.write(response_jpg.content) + except Exception as e: + print(f"[X] __ Error downloading from '{animated_avatar_jpg}'", file=sys.stderr) + traceback.print_exception(e, file=sys.stderr) + + elif line_section == "Profiles": + + if _profiles != line_series_name_safe: + if _profiles_series == line_series_count: # this fixes duplicating message for last found 'section' in html source, after finding a new 'series' + print(f"[ ] __ {line_series_name_safe} --- downloading profiles...") + _profiles = line_series_name_safe + + if 'class="sm:h-[166px] md:h-[146px] lg:h-[126px] xl:h-[138px] 2xl:h-[148px]"' in line: + profile_count = profile_count + 1 + profile_jpg = GetListOfSubstrings(line, 'src="', '"')[0] + profile_name = GetListOfSubstrings(line, 'alt="', '"')[0] + profile_name = profile_name.replace('&', '&').replace("'", "'").replace('"', '"').replace(' ', ' ') + profile_name_safe = safe_name.create_safe_name(profile_name) + + ini_profiles = ConfigObj(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_profiles.ini"), encoding='utf-8', create_empty=True) + ini_profiles['profiles'][f'profile{ParseNumber(profile_count)}_name'] = profile_name.strip('"') + ini_profiles['profiles'][f'profile{ParseNumber(profile_count)}_jpg'] = profile_jpg + ini_profiles.write() + + ReplaceStringInFile(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe}\\app_profiles.ini"), ' = "', '"', '') + + if not os.path.exists(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Profiles")): + os.makedirs(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Profiles")) + + try: + response_jpg = requests.get(profile_jpg) + with open(os.path.join(base_out_dir, f"steam_misc\\app_scx\\{line_series_name_safe} _Download\\Profiles\\{ParseNumber(profile_count)}. {profile_name_safe} _.jpg"), "wb") as f: + f.write(response_jpg.content) + except Exception as e: + print(f"[X] __ Error downloading from '{profile_jpg}'", file=sys.stderr) + traceback.print_exception(e, file=sys.stderr) + + elif '>Preview<' in line: + profile_preview = GetListOfSubstrings(line, ' s); -# const usr_id = usr_link[usr_link.length - 1] -# console.log(usr_id) -#} +# Steam ids with public profiles that own a lot of games --- https://steamladder.com/ladder/games/ +# How to generate/update top_owners_ids.txt upon running generate_emu_config: +# - copy and paste the above address in your web browser +# - right click and save web page, html only with the name top_owners_ids.html +# - copy and paste top_owners_ids.html next to generate_emu_config exe or py TOP_OWNER_IDS = list(dict.fromkeys([ - 76561198213148949, - 76561198108581917, 76561198028121353, 76561197979911851, - 76561198355625888, - 76561198237402290, - 76561197969050296, - 76561198152618007, - 76561198001237877, - 76561198037867621, - 76561198001678750, - 76561198217186687, - 76561198094227663, 76561197993544755, + 76561198355953202, + 76561198001237877, + 76561198237402290, + 76561198355625888, + 76561198152618007, + 76561198213148949, + 76561197969050296, + 76561198217186687, + 76561198037867621, + 76561198017975643, + 76561198094227663, + 76561198019712127, 76561197963550511, - 76561198095049646, + 76561198134044398, + 76561198001678750, 76561197973009892, + 76561197976597747, + 76561198044596404, 76561197969810632, - 76561198388522904, + 76561198085065107, 76561198864213876, - 76561198166734878, - # 76561198017975643, - # 76561198044596404, - # 76561197976597747, - # 76561197962473290, - # 76561197976968076, - # 76561198235911884, - # 76561198313790296, - # 76561198407953371, - # 76561198063574735, - # 76561198122859224, - # 76561198154462478, - # 76561197996432822, - # 76561197979667190, - # 76561198139084236, - # 76561198842864763, - # 76561198096081579, - # 76561198019712127, - # 76561198033715344, - # 76561198121398682, - # 76561198027233260, - # 76561198104323854, - # 76561197995070100, - # 76561198001221571, - # 76561198005337430, - # 76561198085065107, - # 76561198027214426, - # 76561198062901118, - # 76561198008181611, - # 76561198124872187, - # 76561198048373585, - # 76561197974742349, - # 76561198040421250, - # 76561198017902347, - # 76561198010615256, - # 76561197970825215, - # 76561198077213101, - # 76561197971011821, - # 76561197992133229, - # 76561197963534359, - # 76561198077248235, - # 76561198152760885, - # 76561198256917957, - # 76561198326510209, - # 76561198019009765, - # 76561198047438206, - # 76561198128158703, - # 76561198037809069, - # 76561198121336040, - # 76561198102767019, - # 76561198063728345, - # 76561198082995144, - # 76561197981111953, - # 76561197995008105, - # 76561198109083829, - # 76561197968410781, - # 76561198808371265, - # 76561198025858988, - # 76561198252374474, - # 76561198382166453, - # 76561198396723427, - # 76561197992548975, - # 76561198134044398, - # 76561198029503957, - # 76561197990233857, - # 76561197971026489, - # 76561197965978376, - # 76561197976796589, - # 76561197994616562, - # 76561197984235967, - # 76561197992967892, - # 76561198097945516, - # 76561198251835488, - # 76561198281128349, - # 76561198044387084, - # 76561198015685843, - # 76561197993312863, - # 76561198020125851, - # 76561198006391846, - # 76561198158932704, - # 76561198039492467, - # 76561198035552258, - # 76561198031837797, - # 76561197982718230, - # 76561198025653291, - # 76561197972951657, - # 76561198269242105, - # 76561198004332929, - # 76561197972378106, - # 76561197962630138, - # 76561198192399786, - # 76561198119667710, - # 76561198120120943, - # 76561198015992850, - # 76561198096632451, - # 76561198008797636, - # 76561198118726910, - # 76561198018254158, - # 76561198061393233, - # 76561198086250077, - # 76561198025391492, - # 76561198050474710, - # 76561197997477460, - # 76561198105279930, - # 76561198026221141, - # 76561198443388781, - # 76561197981228012, - # 76561197986240493, - # 76561198003041763, - # 76561198056971296, - # 76561198072936438, - # 76561198264362271, - # 76561198101049562, - # 76561198831075066, - # 76561197991699268, - # 76561198042965266, - # 76561198019555404, - # 76561198111433283, - # 76561197984010356, - # 76561198427572372, - # 76561198071709714, - # 76561198034213886, - # 76561198846208086, - # 76561197991613008, - # 76561197978640923, - # 76561198009596142, - # 76561199173688191, - # 76561198294806446, - # 76561197992105918, - # 76561198155124847, - # 76561198032614383, - # 76561198051740093, - # 76561198051725954, - # 76561198048151962, - # 76561198172367910, - # 76561198043532513, - # 76561198029532782, - # 76561198106145311, - # 76561198020746864, - # 76561198122276418, - # 76561198844130640, - # 76561198890581618, - # 76561198021180815, - # 76561198046642155, - # 76561197985091630, - # 76561198119915053, - # 76561198318547224, - # 76561198426000196, - # 76561197988052802, - # 76561198008549198, - # 76561198054210948, - # 76561198028011423, - # 76561198026306582, - # 76561198079227501, - # 76561198070220549, - # 76561198034503074, - # 76561198172925593, - # 76561198286209051, - # 76561197998058239, - # 76561198057648189, - # 76561197982273259, - # 76561198093579202, - # 76561198035612474, - # 76561197970307937, - # 76561197996825541, - # 76561197981027062, - # 76561198019841907, - # 76561197970727958, - # 76561197967716198, - # 76561197970545939, - # 76561198315929726, - # 76561198093753361, - # 76561198413266831, - # 76561198045540632, - # 76561198015514779, - # 76561198004532679, - # 76561198080773680, - # 76561198079896896, - # 76561198005299723, - # 76561198337784749, - # 76561198150126284, - # 76561197988445370, - # 76561198258304011, - # 76561198321551799, - # 76561197973701057, - # 76561197973230221, - # 76561198002535276, - # 76561198100306249, - # 76561198116086535, - # 76561197970970678, - # 76561198085238363, - # 76561198007200913, - # 76561198025111129, - # 76561198068747739, - # 76561197970539274, - # 76561198148627568, - # 76561197970360549, - # 76561198098314980, - # 76561197972529138, - # 76561198007403855, - # 76561197977403803, - # 76561198124865933, - # 76561197981323238, - # 76561197960330700, - # 76561198217979953, - # 76561197960366517, - # 76561198044067612, - # 76561197967197052, - # 76561198027066612, - # 76561198072833066, - # 76561198033967307, - # 76561198104561325, - # 76561198272374716, - # 76561197970127197, - # 76561197970257188, - # 76561198026921217, - # 76561198027904347, - # 76561198062469228, - # 76561198026278913, - # 76561197970548935, - # 76561197966617426, - # 76561198356842617, - # 76561198034276722, - # 76561198355953202, - # 76561197986603983, - # 76561197967923946, - # 76561197961542845, - # 76561198121938079, - # 76561197992357639, - # 76561198002536379, - # 76561198017054389, - # 76561198031129658, - # 76561198020728639, + 76561198095049646, + 76561197962473290, + 76561198388522904, + 76561198063574735, + 76561198033715344, + 76561198313790296, + 76561197995070100, + 76561197996432822, + 76561197976968076, + 76561198281128349, + 76561198027233260, + 76561198154462478, + 76561198842864763, + 76561198235911884, + 76561198122859224, + 76561198027214426, + 76561197970825215, + 76561198035900006, + 76561197968410781, + 76561198407953371, + 76561198001221571, + 76561198104323854, + 76561197979667190, + 76561198256917957, + 76561198008181611, + 76561198062901118, + #76561198121398682, + #76561198077213101, + #76561197974742349, + #76561198096081579, + #76561198019009765, + #76561199130977924, + #76561198139084236, + #76561197990233857, + #76561198118726910, + #76561197971011821, + #76561198124872187, + #76561198063728345, + #76561198119667710, + #76561198808371265, + #76561197992133229, + #76561198077248235, + #76561198005337430, + #76561198082995144, + #76561198045455280, + #76561198048373585, + #76561198109083829, + #76561198326510209, + #76561198152760885, + #76561197981111953, + #76561198037809069, + #76561198093753361, + #76561199168919006, + #76561198396723427, + #76561198040421250, + #76561198017902347, + #76561198006391846, + #76561198121336040, + #76561198044387084, + #76561197994616562, + #76561199353305847, + #76561198172367910, + #76561198251835488, + #76561198021180815, + #76561198102767019, + #76561197976796589, + #76561197992548975, + #76561198890581618, + #76561197972951657, + #76561198128158703, + #76561197965978376, + #76561198047438206, + #76561197993312863, + #76561198015685843, + #76561197971026489, + #76561198252374474, + #76561197995008105, + #76561199173688191, + #76561197984235967, + #76561198031837797, + #76561198417144062, + #76561198008797636, + #76561198020125851, + #76561198039492467, + #76561198061393233, + #76561198028011423, + #76561198192399786, + #76561198996604130, + #76561198367471798, + #76561197969148931, + #76561198029503957, + #76561198155124847, + #76561198168877244, + #76561198035552258, + #76561198015992850, + #76561198026221141, + #76561198025653291, + #76561197982718230, + #76561198219343843, + #76561198034213886, + #76561197972378106, + #76561198318111105, + #76561198004332929, + #76561198018254158, + #76561197970246998, + #76561197997477460, + #76561198158932704, + #76561198269242105, + #76561198045540632, + #76561198294806446, + #76561197986240493, + #76561198105279930, + #76561198043532513, + #76561197973230221, + #76561198003041763, + #76561198020746864, + #76561198054210948, + #76561198096632451, + #76561197962630138, + #76561198029532782, + #76561198086250077, + #76561198120120943, + #76561198111433283, + #76561198046642155, + #76561198048151962, + #76561198072936438, + #76561198124865933, + #76561198019555404, + #76561198075477583, + #76561198042781427, + #76561198443388781, + #76561197984010356, + #76561198042965266, + #76561198031164839, + #76561198025391492, + #76561198122276418, + #76561197981228012, + #76561198019841907, + #76561198106206019, + #76561197981027062, + #76561197992105918, + #76561198104561325, + #76561198015856631, + #76561197991699268, + #76561198315929726, + #76561198051725954, + #76561198050474710, + #76561197985091630, + #76561198844130640, + #76561198264362271, + #76561198846208086, + #76561198032614383, + #76561198079227501, + #76561198026306582, + #76561198009596142, + #76561198056971296, + #76561197991613008, + #76561198028428529, + #76561198427572372, + #76561198071709714, + #76561198101049562, + #76561197969365800, + #76561198093579202, + #76561198171791210, + #76561198413266831, + #76561198165450871, + #76561198085238363, + #76561198106145311, + #76561197973701057, + #76561198811114019, + #76561198034906703, + #76561198119915053, + #76561198079896896, + #76561197988052802, + #76561198172925593, + #76561197970545939, + #76561198004532679, + #76561198008549198, + #76561198831075066, + #76561198002535276, + #76561197977920776, + #76561198015514779, + #76561198072361453, + #76561198070220549, + #76561197970307937, + #76561197982273259, + #76561197978640923, + #76561198090111762, + #76561198007200913, + #76561197970970678, + #76561197970360549, + #76561198051740093, + #76561197996825541, + #76561197967716198, + #76561198027066612, + #76561197962850521, + #76561197998058239, + #76561197966617426, + #76561198098314980, + #76561197984605215, + #76561198035612474, + #76561198025111129, + #76561198318547224, + #76561198034503074, + #76561198426000196, + #76561198356842617, + #76561198150467988, + #76561198080773680, + #76561198083977059, + #76561198286209051, + #76561198033967307, + #76561197988445370, + #76561198217979953, + #76561198026278913, + #76561198321551799, + #76561199080934614, + #76561197963735863, + #76561197970127197, + #76561197994153029, + #76561197992357639, + #76561198070585472, + #76561198026921217, + #76561197983517848, + #76561198027904347, + #76561198002536379, + #76561198027917594 ])) -# extra features/options to disable -EXTRA_FEATURES_DISABLE = { - 'configs.main.ini': { - 'main::connectivity': { - 'disable_networking': (1, 'disable all steam networking interface functionality'), - 'disable_source_query': (1, 'do not send server details to the server browser, only works for game servers'), - 'disable_sharing_stats_with_gameserver': (1, 'prevent sharing stats and achievements with any game server, this also disables the interface ISteamGameServerStats'), - }, - }, -} - -# extra convenient features/options to enable -EXTRA_FEATURES_CONVENIENT = { - 'configs.main.ini': { - 'main::general': { - 'new_app_ticket': (1, 'generate new app auth ticket'), - 'gc_token': (1, 'generate/embed GC token inside new App Ticket'), - 'enable_account_avatar': (1, 'enable avatar functionality'), - }, - 'main::connectivity': { - 'disable_lan_only': (1, 'prevent hooking OS networking APIs and allow any external requests'), - 'share_leaderboards_over_network': (1, 'enable sharing leaderboards scores with people playing the same game on the same network'), - 'download_steamhttp_requests': (1, 'attempt to download external HTTP(S) requests made via Steam_HTTP::SendHTTPRequest()'), - }, - }, - 'configs.overlay.ini': { - 'overlay::general': { - 'enable_experimental_overlay': (1, 'XXX USE AT YOUR OWN RISK XXX, enable the experimental overlay, might cause crashes or other problems'), - 'disable_warning_any': (1, 'disable any warning in the overlay'), - }, - } -} - - def get_exe_dir(relative = False): # https://pyinstaller.org/en/stable/runtime-information.html if relative: @@ -342,7 +300,8 @@ def get_stats_schema(client, game_id, owner_id): return client.wait_msg(EMsg.ClientGetUserStatsResponse, timeout=5) def download_achievement_images(game_id : int, image_names : set[str], output_folder : str): - print(f"downloading achievements images inside '{output_folder }', images count = {len(image_names)}") + print(f"[ ] Found {len(image_names)} achievements images --- downloading to '.\\steam_settings\\img' folder") + q : queue.Queue[str] = queue.Queue() def downloader_thread(): @@ -364,14 +323,15 @@ def download_achievement_images(game_id : int, image_names : set[str], output_fo succeeded = True break except Exception as e: - print("HTTPError downloading", url, file=sys.stderr) + print("____ HTTPError downloading", url, file=sys.stderr) traceback.print_exception(e, file=sys.stderr) if not succeeded: - print("error could not download", name) - + print("____ Error, could not download", name) + q.task_done() num_threads = 50 + for i in range(num_threads): threading.Thread(target=downloader_thread, daemon=True).start() @@ -382,21 +342,20 @@ def download_achievement_images(game_id : int, image_names : set[str], output_fo for i in range(num_threads): q.put(None) q.join() - print("finished downloading achievements images") def generate_achievement_stats(client, game_id : int, output_directory, backup_directory) -> list[dict]: stats_schema_found = None - print(f"finding achievements stats...") + #print(f"[ ] Finding achievements stats...") for id in TOP_OWNER_IDS: - #print(f"finding achievements stats using account ID {id}...") + #print(f"[ ] Finding achievements stats using account ID {id}...") out = get_stats_schema(client, game_id, id) if out is not None and len(out.body.schema) > 0: stats_schema_found = out - #print(f"found achievement stats using account ID {id}") + #print(f"[ ] Found achievement stats using account ID {id}") break - if stats_schema_found is None: # nothing found - print(f"[X] app id {game_id} has not achievements") + if stats_schema_found is None: # no achievement found + print(f"[?] No achievements found - skip creating 'achievements.json'") return [] achievement_images_dir = os.path.join(output_directory, "img") @@ -404,10 +363,18 @@ def generate_achievement_stats(client, game_id : int, output_directory, backup_d with open(os.path.join(backup_directory, f'UserGameStatsSchema_{game_id}.bin'), 'wb') as f: f.write(stats_schema_found.body.schema) + ( achievements, stats, copy_default_unlocked_img, copy_default_locked_img ) = achievements_gen.generate_stats_achievements(stats_schema_found.body.schema, output_directory) + + if len(achievements) != 1: + print(f"[ ] Found {len(achievements)} achievements --- writing to 'achievements.json'") + else: + print(f"[ ] Found {len(achievements)} achievement --- writing to 'achievements.json'") + + #print(f"[ ] Writing 'UserGameStatsSchema_{game_id}.bin'") for ach in achievements: icon = f"{ach.get('icon', '')}".strip() @@ -446,12 +413,12 @@ def download_published_file(client, published_file_id, backup_directory): ugc_info = get_ugc_info(client, published_file_id) if (ugc_info is None): - print("failed getting published file", published_file_id) + print("____ Failed getting published file", published_file_id) return None file_details = ugc_info.body.publishedfiledetails[0] if (file_details.result != EResult.OK): - print("failed getting published file", published_file_id, file_details.result) + print("____ Failed getting published file", published_file_id, file_details.result) return None if not os.path.exists(backup_directory): @@ -469,14 +436,14 @@ def download_published_file(client, published_file_id, backup_directory): f.write(data) return data except Exception as e: - print(f"Error downloading from '{file_details.file_url}'", file=sys.stderr) + print(f"____ Error downloading from '{file_details.file_url}'", file=sys.stderr) traceback.print_exception(e, file=sys.stderr) return None else: - print("Could not download file", published_file_id, "no url (you can ignore this if the game doesn't need a controller config)") + print("____ Could not download file", published_file_id, "no url") + print("____ You can ignore this if the game doesn't need a controller config") return None - def get_inventory_info(client, game_id): return client.send_um_and_wait('Inventory.GetItemDefMeta#1', { 'appid': game_id @@ -515,14 +482,12 @@ def parse_branches(branches: dict) -> list[dict]: branch_info["protected"] = protected == "true" or protected == "1" except Exception as e: pass - # build id try: buildid = int( f'{branch_data.get("buildid", 0)}' ) branch_info["build_id"] = buildid except Exception as e: pass - # time updated if 'timeupdated' in branch_data: try: @@ -530,13 +495,14 @@ def parse_branches(branches: dict) -> list[dict]: branch_info["time_updated"] = timeupdated except Exception as e: pass - + ret.append(branch_info) - + return ret # DLC, Depots, Branches -def get_depots_infos(raw_infos): +def get_depots_infos(raw_infos, appid): + #print(f"[ ] Finding DLC infos...") try: dlc_list = set() depot_app_list = set() @@ -545,6 +511,7 @@ def get_depots_infos(raw_infos): try: dlc_list = set(map(lambda a: int(f"{a}".strip()), raw_infos["extended"]["listofdlc"].split(","))) except Exception: + #print(f"[?] Could not get DLCs info. Is there any depot for {appid}?") pass if "depots" in raw_infos: @@ -555,41 +522,80 @@ def get_depots_infos(raw_infos): dlc_list.add(int(depot_info["dlcappid"])) if "depotfromapp" in depot_info: depot_app_list.add(int(depot_info["depotfromapp"])) - if dep.isnumeric(): all_depots.add(int(dep)) elif f'{dep}'.lower() == 'branches': all_branches.extend(parse_branches(depot_info)) + #else: + #print(f"[?] Could not get depots info. Is there any DLC for {appid}?") return (dlc_list, depot_app_list, all_depots, all_branches) except Exception: - print("could not get dlc infos, are there any dlcs ?") return (set(), set(), set()) +# https://stackoverflow.com/a/48336994 +def GetListOfSubstrings(stringSubject,string1,string2): + MyList = [] + intstart=0 + strlength=len(stringSubject) + continueloop = 1 + + while(intstart < strlength and continueloop == 1): + intindex1=stringSubject.find(string1,intstart) + if(intindex1 != -1): #The substring was found, lets proceed + intindex1 = intindex1+len(string1) + intindex2 = stringSubject.find(string2,intindex1) + if(intindex2 != -1): + subsequence=stringSubject[intindex1:intindex2] + MyList.append(subsequence) + intstart=intindex2+len(string2) + else: + continueloop=0 + else: + continueloop=0 + return MyList + +# https://stackoverflow.com/a/13641746 # NOTE using this fix a strange issue where some DLC names had starting and trailing double quotes ( " ) +def ReplaceStringInFile(f_file, search_string, old_string, new_string): + with open(f_file, 'r') as file: + lines = file.readlines() + #matching_lines = [line.strip() for line in lines if ' = "' in line] + #return matching_lines + for line in lines: + if search_string in line: + # Read contents from file as a single string + f_handle = open(f_file, 'r') + f_string = f_handle.read() + f_handle.close() + + # Use RE package to allow for replacement, also allowing for multi-line REGEX + f_string = (re.sub(old_string, new_string, f_string)) + + # Write contents to file - using 'w' truncates the file + f_handle = open(f_file, 'w') + f_handle.write(f_string) + f_handle.close() def help(): exe_name = os.path.basename(sys.argv[0]) print(f"\nUsage: {exe_name} [Switches] appid appid appid ... ") print(f" Example: {exe_name} 421050 420 480") - print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean -de 421050 480") - print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean -de -cve 421050") - print(f" Example: {exe_name} -shots -thumbs -vid -imgs -name -cdx -aw -clean -cve 421050") + print(f" Example: {exe_name} -img -scr -vids_max -scx -cdx -acw -clr 421050 480") print("\nSwitches:") - print(" -shots: download screenshots for each app if they're available") - print(" -thumbs: download screenshots thumbnails for each app if they're available") - print(" -vid: download the first video available for each app: trailer, gameplay, announcement, etc...") - print(" -imgs: download common images for each app: Steam generated background, icon, logo, etc...") - print(" -name: save the output of each app in a folder with the same name as the app, unsafe characters are discarded") + print(" -img: download art images for each app: Steam generated background, icon, logo, etc...") + print(" -scr: download screenshots for each app if they're available") + print(" -vids_low: download low quality videos for each app if they're available") + print(" -vids_max: download max quality videos for each app if they're available") + print(" -scx: download market images for each app: Steam trading cards, badges, backgrounds, etc...") print(" -cdx: generate .ini file for CODEX Steam emu for each app") - print(" -aw: generate schemas of all possible languages for Achievement Watcher") - print(" -clean: delete any folder/file with the same name as the output before generating any data") - print(" -anon: login as an anonymous account, these have very limited access and cannot get all app details") - print(" -de: disable some extra features by generating the corresponding config files in steam_settings folder") - print(" -cve: enable some convenient extra features by generating the corresponding config files in steam_settings folder") - print(" -reldir: generate temp files/folders, and expect input files, relative to the current working directory") + print(" -acw: generate schemas of all possible languages for Achievement Watcher") print(" -skip_ach: skip downloading & generating achievements and their images") print(" -skip_con: skip downloading & generating controller configuration files") print(" -skip_inv: skip downloading & generating inventory data (items.json & default_items.json)") + print(" -clr: delete any folder/file with the same name as the output before generating any data") + print(" -rel: generate temp files/folders, and expect input files, relative to the current working directory") + print(" -anon: login as an anonymous account, these have very limited access and cannot get all app details") + print(" -name: save the output of each app in a folder with the same name as the app, unsafe characters are discarded") print("\nAll switches are optional except app id, at least 1 app id must be provided") print("\nAutomate the login prompt:") print(" * You can create a file called 'my_login.txt' beside the script, then add your username on the first line") @@ -600,36 +606,17 @@ def help(): print("") -def merge_dict(dest: dict, src: dict): - # merge similar keys, but don't overwrite values - for kv in src.items(): - v_dest = dest.get(kv[0], None) - if isinstance(kv[1], dict) and isinstance(v_dest, dict): - merge_dict(v_dest, kv[1]) - elif kv[0] not in dest: - dest[kv[0]] = kv[1] - -def write_ini_file(base_path: str, out_ini: dict): - for file in out_ini.items(): - with open(os.path.join(base_path, file[0]), 'wt', encoding='utf-8') as f: - for item in file[1].items(): - f.write('[' + str(item[0]) + ']\n') # section - for kv in item[1].items(): - if kv[1][1]: # comment - f.write('# ' + str(kv[1][1]) + '\n') - f.write(str(kv[0]) + '=' + str(kv[1][0]) + '\n') # key/value pair - f.write('\n') - def main(): USERNAME = "" PASSWORD = "" - DISABLE_EXTRA = False - CONVENIENT_EXTRA = False - DOWNLOAD_SCREESHOTS = False - DOWNLOAD_THUMBNAILS = False + DOWNLOAD_SCREENSHOTS = False + DOWNLOAD_THUMBNAILS = True DOWNLOAD_VIDEOS = False + DOWNLOAD_LOW = False + DOWNLOAD_MAX = False DOWNLOAD_COMMON_IMAGES = False + DOWNLOAD_SCX = False SAVE_APP_NAME = False GENERATE_CODEX_INI = False GENERATE_ACHIEVEMENT_WATCHER_SCHEMAS = False @@ -639,6 +626,8 @@ def main(): SKIP_ACH = False SKIP_CONTROLLER = False SKIP_INVENTORY = False + DEFAULT_PRESET = True + DEFAULT_PRESET_NO = 1 prompt_for_unavailable = True @@ -650,29 +639,29 @@ def main(): for appid in sys.argv[1:]: if f'{appid}'.isnumeric(): appids.add(int(appid)) - elif f'{appid}'.lower() == '-shots': - DOWNLOAD_SCREESHOTS = True - elif f'{appid}'.lower() == '-thumbs': - DOWNLOAD_THUMBNAILS = True - elif f'{appid}'.lower() == '-vid': + elif f'{appid}'.lower() == '-scr': + DOWNLOAD_SCREENSHOTS = True + elif f'{appid}'.lower() == '-vids_low': DOWNLOAD_VIDEOS = True - elif f'{appid}'.lower() == '-imgs': + DOWNLOAD_LOW = True + elif f'{appid}'.lower() == '-vids_max': + DOWNLOAD_VIDEOS = True + DOWNLOAD_MAX = True + elif f'{appid}'.lower() == '-img': DOWNLOAD_COMMON_IMAGES = True elif f'{appid}'.lower() == '-name': SAVE_APP_NAME = True + elif f'{appid}'.lower() == '-scx': + DOWNLOAD_SCX = True elif f'{appid}'.lower() == '-cdx': GENERATE_CODEX_INI = True - elif f'{appid}'.lower() == '-aw': + elif f'{appid}'.lower() == '-acw': GENERATE_ACHIEVEMENT_WATCHER_SCHEMAS = True - elif f'{appid}'.lower() == '-clean': + elif f'{appid}'.lower() == '-clr': CLEANUP_BEFORE_GENERATING = True elif f'{appid}'.lower() == '-anon': ANON_LOGIN = True - elif f'{appid}'.lower() == '-de': - DISABLE_EXTRA = True - elif f'{appid}'.lower() == '-cve': - CONVENIENT_EXTRA = True - elif f'{appid}'.lower() == '-reldir': + elif f'{appid}'.lower() == '-rel': RELATIVE_DIR = True elif f'{appid}'.lower() == '-skip_ach': SKIP_ACH = True @@ -680,13 +669,28 @@ def main(): SKIP_CONTROLLER = True elif f'{appid}'.lower() == '-skip_inv': SKIP_INVENTORY = True + elif f'{appid}'.lower() == '-def1': + DEFAULT_PRESET = True + DEFAULT_PRESET_NO = 1 + elif f'{appid}'.lower() == '-def2': + DEFAULT_PRESET = True + DEFAULT_PRESET_NO = 2 + elif f'{appid}'.lower() == '-def3': + DEFAULT_PRESET = True + DEFAULT_PRESET_NO = 3 + elif f'{appid}'.lower() == '-def4': + DEFAULT_PRESET = True + DEFAULT_PRESET_NO = 4 + elif f'{appid}'.lower() == '-def5': + DEFAULT_PRESET = True + DEFAULT_PRESET_NO = 5 else: - print(f'[X] invalid switch: {appid}') + print(f'___ Invalid switch: {appid}') help() sys.exit(1) if not appids: - print(f'[X] no app id was provided') + print(f'___ No app id was provided') help() sys.exit(1) @@ -716,7 +720,6 @@ def main(): if env_password: PASSWORD = env_password - if ANON_LOGIN: result = client.anonymous_login() trials = 5 @@ -737,23 +740,23 @@ def main(): ): if result == EResult.InvalidPassword: - print("invalid password, the password you set is wrong.") + print("__ Invalid password. The password you set is wrong.") exit(1) elif result in (EResult.AccountLogonDenied, EResult.InvalidLoginAuthCode): - prompt = ("Enter email code: " if result == EResult.AccountLogonDenied else - "Incorrect code. Enter email code: ") + prompt = ("__ Enter email code: " if result == EResult.AccountLogonDenied else + "__ Incorrect code. Enter email code: ") auth_code, two_factor_code = input(prompt), None elif result in (EResult.AccountLoginDeniedNeedTwoFactor, EResult.TwoFactorCodeMismatch): - prompt = ("Enter 2FA code: " if result == EResult.AccountLoginDeniedNeedTwoFactor else - "Incorrect code. Enter 2FA code: ") + prompt = ("__ Enter 2FA code: " if result == EResult.AccountLoginDeniedNeedTwoFactor else + "__ Incorrect code. Enter 2FA code: ") auth_code, two_factor_code = None, input(prompt) elif result in (EResult.TryAnotherCM, EResult.ServiceUnavailable): if prompt_for_unavailable and result == EResult.ServiceUnavailable: while True: - answer = input("Steam is down. Keep retrying? [y/n]: ").lower() + answer = input("__ Steam is down. Keep retrying? [y/n]: ").lower() if answer in 'yn': break prompt_for_unavailable = False @@ -763,6 +766,9 @@ def main(): result = client.login(USERNAME, PASSWORD, None, auth_code, two_factor_code) + # generate 'top_owners_ids.txt' if 'top_owners_ids.html' exists + top_own.top_owners() + # read and prepend top_owners_ids.txt top_owners_file = os.path.join(get_exe_dir(RELATIVE_DIR), "top_owners_ids.txt") if os.path.isfile(top_owners_file): @@ -779,37 +785,52 @@ def main(): TOP_OWNER_IDS.insert(0, client.steam_id.as_64) for appid in appids: - out_config_app_ini = {} - print(f"********* generating info for app id {appid} *********") + print(" ") + print(f"*** STARTED config for app id {appid} ***") + print(" ") + raw = client.get_product_info(apps=[appid]) + if raw["apps"]: + print(f"[ ] Found app id on Steam store") + else: + print(f"[X] Cannot find app id on Steam store") + print(" ") + print(f"*** ABORTED config for app id {appid} ***") + print(" ") + break game_info : dict = raw["apps"][appid] + print(f"[ ] Found product info --- writing to 'app_product_info.json'") + game_info_common : dict = game_info.get("common", {}) app_name = game_info_common.get("name", "") app_name_on_disk = f"{appid}" if app_name: - print(f"App name on store: '{app_name}'") - if SAVE_APP_NAME: - sanitized_name = safe_name.create_safe_name(app_name) - if sanitized_name: - app_name_on_disk = f'{sanitized_name}-{appid}' + print(f"[ ] Found app name on Steam store") + print(f"[ ] __ orig name: '{app_name}'") + sanitized_name = safe_name.create_safe_name(app_name) + if sanitized_name: + print(f"[ ] __ safe name: '{sanitized_name}'") + if SAVE_APP_NAME: + app_name_on_disk = f'{sanitized_name} _ {appid}' else: app_name = f"Unknown_Steam_app_{appid}" # we need this for later use in the Achievement Watcher - print(f"[X] Couldn't find app name on store") + print(f"[X] Cannot find app name on Steam store") - root_backup_dir = os.path.join(get_exe_dir(RELATIVE_DIR), "backup") - backup_dir = os.path.join(root_backup_dir, f"{appid}") - if not os.path.exists(backup_dir): - os.makedirs(backup_dir) + #root_backup_dir = os.path.join(get_exe_dir(RELATIVE_DIR), "BACKUP") + #backup_dir = os.path.join(root_backup_dir, f"{appid}") + #if not os.path.exists(backup_dir): + # os.makedirs(backup_dir) - root_out_dir = "output" + root_def_dir = "_DEFAULT" + root_out_dir = "_OUTPUT" base_out_dir = os.path.join(root_out_dir, app_name_on_disk) emu_settings_dir = os.path.join(base_out_dir, "steam_settings") - info_out_dir = os.path.join(base_out_dir, "info") + info_out_dir = os.path.join(base_out_dir, "steam_misc\\app_info") if CLEANUP_BEFORE_GENERATING: - print("cleaning output folder before generating any data") + print(f"[ ] Cleaning '{base_out_dir}' folder...") base_dir_path = pathlib.Path(base_out_dir) if base_dir_path.is_file(): base_dir_path.unlink() @@ -821,23 +842,50 @@ def main(): while base_dir_path.exists(): time.sleep(0.05) + root_backup_dir = os.path.join(base_out_dir, "steam_misc\\app_backup") + #backup_dir = os.path.join(root_backup_dir, f"{appid}") + backup_dir = root_backup_dir #use different structure for 'backup' dir + if not os.path.exists(backup_dir): + os.makedirs(backup_dir) + if not os.path.exists(emu_settings_dir): os.makedirs(emu_settings_dir) if not os.path.exists(info_out_dir): os.makedirs(info_out_dir) - print(f"output dir: '{base_out_dir}'") + #with open(os.path.join(info_out_dir, "app_widget.url"), mode='w', newline='\r\n') as f: + #f.write(f"[InternetShortcut]\nURL=https://store.steampowered.com/widget/{appid}/") - with open(os.path.join(info_out_dir, "product_info.json"), "wt", encoding='utf-8') as f: + if DEFAULT_PRESET == True: + print(f"[ ] Copying preset emu configs to '{base_out_dir}' folder") + shutil.copytree(os.path.join(root_def_dir, str(0)), base_out_dir, dirs_exist_ok=True) # copy from default emu dir + print(f"[ ] __ default emu config from '{os.path.join(root_def_dir, str(0))}' folder") + shutil.copytree(os.path.join(root_def_dir, str(DEFAULT_PRESET_NO)), base_out_dir, dirs_exist_ok=True) # copy from preset emu dir + print(f"[ ] __ preset emu config from '{os.path.join(root_def_dir, str(DEFAULT_PRESET_NO))}' folder") + if os.path.exists(os.path.join(root_def_dir, str(appid))): + shutil.copytree(os.path.join(root_def_dir, str(appid)), base_out_dir, dirs_exist_ok=True) # copy from preset app dir + print(f"[ ] __ app emu config from '{os.path.join(root_def_dir, str(appid))}' folder") + + with open(os.path.join(emu_settings_dir, "steam_appid.txt"), 'w') as f: + f.write(str(appid)) + #print(f"[ ] Writing 'steam_appid.txt'") + + with open(os.path.join(info_out_dir, "app_product_info.json"), "wt", encoding='utf-8') as f: json.dump(game_info, f, ensure_ascii=False, indent=2) + #print(f"[ ] Writing 'app_product_info.json'") + + with open(os.path.join(backup_dir, "product_info.json"), "wt", encoding='utf-8') as f: + json.dump(game_info, f, ensure_ascii=False, indent=2) + #print(f"[ ] Writing 'app_product_info.json'") app_details.download_app_details( base_out_dir, info_out_dir, appid, - DOWNLOAD_SCREESHOTS, - DOWNLOAD_THUMBNAILS, - DOWNLOAD_VIDEOS) + DOWNLOAD_SCREENSHOTS, + DOWNLOAD_VIDEOS, + DOWNLOAD_LOW, + DOWNLOAD_MAX) clienticon : str = None icon : str = None @@ -859,7 +907,6 @@ def main(): if "logo_small" in game_info_common: logo_small = f"{game_info_common['logo_small']}" - #print(f"generating achievement stats") #if "community_visible_stats" in game_info_common: #NOTE: checking this seems to skip stats on a few games so it's commented out if not SKIP_ACH: achievements = generate_achievement_stats(client, appid, emu_settings_dir, backup_dir) @@ -875,12 +922,30 @@ def main(): with open(os.path.join(emu_settings_dir, "supported_languages.txt"), 'wt', encoding='utf-8') as f: for lang in languages: f.write(f'{lang}\n') - - with open(os.path.join(emu_settings_dir, "steam_appid.txt"), 'w') as f: - f.write(str(appid)) + #print(f"[ ] Writing 'supported_languages.txt'") + if len(languages) == 1: + print(f"[ ] Found {len(languages)} supported language --- writing to 'supported_languages.txt'") + else: + print(f"[ ] Found {len(languages)} supported languages --- writing to 'supported_languages.txt'") + else: + print(f"[?] No supported languages found - skip creating 'supported_languages.txt'") + ReplaceStringInFile(os.path.join(emu_settings_dir, "configs.app.ini"), 'This is another example DLC name', '# 56789=', '56789=') # make sure we write DLCs after '# 56789=This is another example DLC name' + + # use ConfigObj to correctly update existing 'configs.app.ini' copied from ./DEFAULT configuration --- START, read ini + configs_app = ConfigObj(os.path.join(emu_settings_dir, "configs.app.ini"), encoding='utf-8') + + ''' # NOTE no need to write build_id to ini anymore - it will be read from 'branches.json' + if "depots" in game_info: + if "branches" in game_info["depots"]: + if "public" in game_info["depots"]["branches"]: + if "buildid" in game_info["depots"]["branches"]["public"]: + buildid = game_info["depots"]["branches"]["public"]["buildid"] + configs_app['app::general']['build_id'] = str(buildid) #updated ini through ConfigObj # NOTE deprecated, build id is read from 'branches.json' + ''' + dlc_config_list : list[tuple[int, str]] = [] - dlc_list, depot_app_list, all_depots, all_branches = get_depots_infos(game_info) + dlc_list, depot_app_list, all_depots, all_branches = get_depots_infos(game_info, appid) dlc_raw = {} if dlc_list: dlc_raw = client.get_product_info(apps=dlc_list)["apps"] @@ -896,41 +961,128 @@ def main(): dlc_config_list.append((dlc, dlc_name)) + if len(dlc_list) == 1: + print(f"[ ] Found {len(dlc_config_list)} DLC --- writing to 'configs.app.ini'") + else: + print(f"[ ] Found {len(dlc_config_list)} DLCs --- writing to 'configs.app.ini'") + else: + print(f"[?] No DLCs found - skip writing to 'configs.app.ini'") + + if not dlc_raw == {}: + with open(os.path.join(info_out_dir, "dlc_product_info.json"), "wt", encoding='utf-8') as f: + json.dump(dlc_raw, f, ensure_ascii=False, indent=2) + #print(f"[ ] Writing 'dlc_product_info.json'") + # we set unlock_all=0 nonetheless, to make the emu lock DLCs, otherwise everything is allowed - # some games use that as a detection mechanism - merge_dict(out_config_app_ini, { - 'configs.app.ini': { - 'app::dlcs': { - 'unlock_all': (0, 'should the emu report all DLCs as unlocked, default=1'), - } - } - }) + # some games use that as a detection mechanism + #configs["app::dlcs"]["unlock_all"] = str(0) #updated ini through ConfigObj - disabled, keep the existing value from default 'configs.app.ini' + for x in dlc_config_list: - merge_dict(out_config_app_ini, { - 'configs.app.ini': { - 'app::dlcs': { - x[0]: (x[1], ''), - } - } - }) - # write the data as soon as possible in case a later step caused an exception - write_ini_file(emu_settings_dir, out_config_app_ini) + configs_app["app::dlcs"][str(x[0])] = str(x[1]) #updated ini through ConfigObj + # used x[1].encode('utf-8') instead of str(x[1]) to properly deal with DLC names containing special characters like (TM) sign, (C) sign, etc + + # use ConfigObj to correctly update existing 'configs.app.ini' copied from ./DEFAULT configuration --- END, write ini + configs_app.write() + #print(f"[ ] Writing 'configs.app.ini'") + + ReplaceStringInFile(os.path.join(emu_settings_dir, "configs.app.ini"), ' = "', '"', '') + + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(emu_settings_dir, "configs.app.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(emu_settings_dir, "configs.app.ini"), 'w') as file: + file.write(filedata) + + ReplaceStringInFile(os.path.join(emu_settings_dir, "configs.app.ini"), 'This is another example DLC name', '56789=', '# 56789=') # make sure we write DLCs after '# 56789=This is another example DLC name' + + # use ConfigObj to correctly update existing 'configs.main.ini' copied from ./DEFAULT configuration --- START, read ini + configs_main = ConfigObj(os.path.join(emu_settings_dir, "configs.main.ini"), encoding='utf-8') + + # use CongigObj to correctly update existing 'configs.main.ini' copied from ./DEFAULT configuration --- END, write ini + configs_main.write() + #print(f"[ ] Writing 'configs.main.ini'") + + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(emu_settings_dir, "configs.main.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(emu_settings_dir, "configs.main.ini"), 'w') as file: + file.write(filedata) + + # use ConfigObj to correctly update existing 'configs.overlay.ini' copied from ./DEFAULT configuration --- START, read ini + configs_overlay = ConfigObj(os.path.join(emu_settings_dir, "configs.overlay.ini"), encoding='utf-8') + + # use CongigObj to correctly update existing 'configs.overlay.ini' copied from ./DEFAULT configuration --- END, write ini + configs_overlay.write() + #print(f"[ ] Writing 'configs.overlay.ini'") + + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(emu_settings_dir, "configs.overlay.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(emu_settings_dir, "configs.overlay.ini"), 'w') as file: + file.write(filedata) + + # use ConfigObj to correctly update existing 'configs.user.ini' copied from ./DEFAULT configuration --- START, read ini + configs_user = ConfigObj(os.path.join(emu_settings_dir, "configs.user.ini"), encoding='utf-8') + + # use ConfigObj to correctly update existing 'configs.user.ini' copied from ./DEFAULT configuration --- END, write ini + configs_user.write() + #print(f"[ ] Writing 'configs.user.ini'") + + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(emu_settings_dir, "configs.user.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(emu_settings_dir, "configs.user.ini"), 'w') as file: + file.write(filedata) if all_depots: with open(os.path.join(emu_settings_dir, "depots.txt"), 'wt', encoding="utf-8") as f: for game_depot in all_depots: f.write(f"{game_depot}\n") - - if all_branches: + #print(f"[ ] Writing 'depots.txt'") + if len(all_depots) == 1: + print(f"[ ] Found {len(all_depots)} depot --- writing to 'depots.txt'") + else: + print(f"[ ] Found {len(all_depots)} depots --- writing to 'depots.txt'") + else: + print(f"[?] No depots found - skip creating 'depots.txt'") + + if len(all_branches) >= 1: with open(os.path.join(emu_settings_dir, "branches.json"), "wt", encoding='utf-8') as f: json.dump(all_branches, f, ensure_ascii=False, indent=2) + if len(all_branches) == 1: + print(f"[ ] Found {len(all_branches)} branch --- writing to 'branches.json'") + else: + print(f"[ ] Found {len(all_branches)} branches --- writing to 'branches.json'") + if "public" in game_info["depots"]["branches"]: + if "buildid" in game_info["depots"]["branches"]["public"]: + buildid = game_info["depots"]["branches"]["public"]["buildid"] + print(f"[ ] __ default branch name: public, latest build id: {buildid}") + else: + print(f"[?] No branches found - skip creating 'branches.json'") + # read some keys from 'configs.user.ini' + cfg_user = ConfigObj(os.path.join(emu_settings_dir, "configs.user.ini"), encoding='utf-8') + cfg_user_account_name = cfg_user["user::general"]["account_name"] + cfg_user_account_steamid = cfg_user["user::general"]["account_steamid"] + cfg_user_language = cfg_user["user::general"]["language"] - config_generated = False + config_found = 0 + config_generated = 0 # used to avoid overwriting supported config by unsupported one + config_generated_not_sup = 0 # used to avoid overwriting prefered unsupported config if no supported config present + downloading_ctrl_vdf = 0 # needed to remove possible duplicate 'Found controller configs...' if "config" in game_info: if not SKIP_CONTROLLER and "steamcontrollerconfigdetails" in game_info["config"]: controller_details = game_info["config"]["steamcontrollerconfigdetails"] - print('downloading controller vdf files') + print(f"[ ] Found controller configs --- generating action sets...") + downloading_ctrl_vdf=1 for id in controller_details: details = controller_details[id] controller_type = "" @@ -939,16 +1091,49 @@ def main(): controller_type = details["controller_type"] if "enabled_branches" in details: enabled_branches = details["enabled_branches"] - print(f'downloading controller data, file id = {id}, controller type = {controller_type}') + + if (("default" in enabled_branches) or ("public" in enabled_branches)): # download only 'default' and 'public' branches to avoid multiple configs for same controller type + print(f'[ ] __ downloading config, file id = {id}, controller type = {controller_type}') # first noticed for Elden Ring, two 'controller_ps4' vdf configs are downloaded, but only one of them is converted to action sets + out_vdf = download_published_file(client, int(id), os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}')) + + if out_vdf is not None: + if (controller_type in ["controller_xbox360", "controller_xboxone"] and (("default" in enabled_branches) or ("public" in enabled_branches))): + config_found = 1 + #print(f"[ ] __ controller type '{controller_type}' is supported ... converting .vdf to action sets") + if config_generated == 0: + print(f"[ ] __ parsing '{controller_type}' vdf - supported, can be used with emu") + parse_controller_vdf.generate_controller_config(out_vdf.decode('utf-8'), os.path.join(os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}'), "action_set")) + + # delete txt files in .\steam_settings\controller folder + for txt_file in os.listdir(os.path.join(emu_settings_dir, "controller")): + if not txt_file.endswith(".txt"): + continue + os.remove(os.path.join(os.path.join(emu_settings_dir, "controller"), txt_file)) + shutil.copytree(os.path.join(os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}'), "action_set"), os.path.join(emu_settings_dir, "controller"), dirs_exist_ok=True) + config_generated = 1 + else: + print(f"[ ] __ parsing '{controller_type}' vdf - supported, can be used with emu") + parse_controller_vdf.generate_controller_config(out_vdf.decode('utf-8'), os.path.join(os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}'), "action_set")) + + if controller_type in ["controller_xboxone"]: # always use xboxone config if present + # delete txt files in .\steam_settings\controller folder + for txt_file in os.listdir(os.path.join(emu_settings_dir, "controller")): + if not txt_file.endswith(".txt"): + continue + os.remove(os.path.join(os.path.join(emu_settings_dir, "controller"), txt_file)) + shutil.copytree(os.path.join(os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}'), "action_set"), os.path.join(emu_settings_dir, "controller"), dirs_exist_ok=True) + #config_generated = 1 + + elif (controller_type in ["controller_ps4", "controller_ps5", "controller_steamcontroller_gordon", "controller_neptune", "controller_switch_pro"] and (("default" in enabled_branches) or ("public" in enabled_branches))): + config_found=1 + #print(f"[X] __ controller type '{controller_type}' is not supported ... converting .vdf to action sets") + print(f"[X] __ parsing '{controller_type}' vdf - not supported, backup purposes only") + parse_controller_vdf.generate_controller_config(out_vdf.decode('utf-8'), os.path.join(os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}'), "action_set")) - out_vdf = download_published_file(client, int(id), os.path.join(backup_dir, f'{controller_type}-{str(id)}')) - if out_vdf is not None and not config_generated: - if (controller_type in ["controller_xbox360", "controller_xboxone", "controller_steamcontroller_gordon"] and (("default" in enabled_branches) or ("public" in enabled_branches))): - print(f'controller type is supported') - parse_controller_vdf.generate_controller_config(out_vdf.decode('utf-8'), os.path.join(emu_settings_dir, "controller")) - config_generated = True if not SKIP_CONTROLLER and "steamcontrollertouchconfigdetails" in game_info["config"]: controller_details = game_info["config"]["steamcontrollertouchconfigdetails"] + if downloading_ctrl_vdf == 0: + print(f"[ ] Found controller configs --- generating action sets...") for id in controller_details: details = controller_details[id] controller_type = "" @@ -957,67 +1142,111 @@ def main(): controller_type = details["controller_type"] if "enabled_branches" in details: enabled_branches = details["enabled_branches"] - print(id, controller_type) - out_vdf = download_published_file(client, int(id), os.path.join(backup_dir, controller_type + str(id))) + + if (("default" in enabled_branches) or ("public" in enabled_branches)): # download only 'default' and 'public' branches to avoid multiple configs for same controller type + print(f'[ ] __ downloading config, file id = {id}, controller type = {controller_type}') # first noticed for Elden Ring, two 'controller_ps4' vdf configs are downloaded, but only one of them is converted to action sets + out_vdf = download_published_file(client, int(id), os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}')) + + if out_vdf is not None: + if (controller_type in ["controller_mobile_touch"] and (("default" in enabled_branches) or ("public" in enabled_branches))): + config_found = 1 + #print(f"[X] __ controller type '{controller_type}' is not supported ... converting .vdf to action sets") + print(f"[X] __ parsing '{controller_type}' vdf - not supported, backup purposes only") + parse_controller_vdf.generate_controller_config(out_vdf.decode('utf-8'), os.path.join(os.path.join(backup_dir, 'controller\\' + f'{controller_type}' + '_' + f'{id}'), "action_set")) + + ''' # NOTE zip the parent 'app_backup' folder instead of only the child 'controller' folder + if config_found: + shutil.make_archive(os.path.join(backup_dir, 'controller'), 'zip', os.path.join(backup_dir, 'controller')) # first argument is the name of the zip file + shutil.rmtree(os.path.join(backup_dir, 'controller')) + os.makedirs(os.path.join(backup_dir, 'controller')) + shutil.move(os.path.join(backup_dir, 'controller.zip'), os.path.join(backup_dir, 'controller\\controller.zip')) + ''' + + if config_found == 0: + print(f"[?] No controller configs found - skip generating action sets") + + if "supported_languages" in game_info["common"]: + languages_config = game_info["common"]["supported_languages"] + with open(os.path.join(info_out_dir, "common_supported_languages.json"), "wt", encoding='utf-8') as f: + json.dump(languages_config, f, ensure_ascii=False, indent=2) + #print(f"[ ] Writing 'common_supported_languages.json'") + if "launch" in game_info["config"]: launch_configs = game_info["config"]["launch"] - with open(os.path.join(info_out_dir, "launch_config.json"), "wt", encoding='utf-8') as f: + with open(os.path.join(info_out_dir, "config_launch.json"), "wt", encoding='utf-8') as f: json.dump(launch_configs, f, ensure_ascii=False, indent=2) + #print(f"[ ] Writing 'config_launch.json'") + app_type : str = "" + app_mode_tmp : str = "" + app_mode_new : str = "" first_app_exe : str = None + default_app_exe : str = None prefered_app_exe : str = None - unwanted_app_exes = ["launch", "start", "play", "try", "demo", "_vr",] + unwanted_app_exe_launcher = ["launch", "start", "play", "settings"] + unwanted_app_exe_demo = ["demo"] + unwanted_app_exe_vr = ["_vr", "-vr", "vr_", "vr-"] + unwanted_app_exe_benchmark = ["benchmark"] for cfg in launch_configs.values(): if "executable" in cfg: app_exe = f'{cfg["executable"]}' - - if app_exe.lower().endswith(".exe"): app_exe = app_exe.replace("\\", "/").split('/')[-1] - if first_app_exe is None: - first_app_exe = app_exe - if all(app_exe.lower().find(unwanted_exe) < 0 for unwanted_exe in unwanted_app_exes): + + first_app_exe = app_exe + if "type" in cfg: + app_type = f'{cfg["type"]}' + if app_type == "default": + default_app_exe = app_exe + else: + prefered_app_exe = app_exe + else: prefered_app_exe = app_exe + + if all(app_exe.lower().find(unwanted_exe_l) < 0 for unwanted_exe_l in unwanted_app_exe_launcher): + app_mode_tmp = app_mode_tmp + " _no_launcher_ " + if all(app_exe.lower().find(unwanted_exe_d) < 0 for unwanted_exe_d in unwanted_app_exe_demo): + app_mode_tmp = app_mode_tmp + " _no_demo_ " + if all(app_exe.lower().find(unwanted_exe_v) < 0 for unwanted_exe_v in unwanted_app_exe_vr): + app_mode_tmp = app_mode_tmp + " _no_vr_ " + if all(app_exe.lower().find(unwanted_exe_b) < 0 for unwanted_exe_b in unwanted_app_exe_benchmark): + app_mode_tmp = app_mode_tmp + " _no_benchmark_ " + + if platform.system() == "Windows": # Windows + if app_exe.lower().endswith(".exe"): break - - if prefered_app_exe: + elif platform.system() == "Linux": # Linux + if app_exe.lower().endswith(".sh"): + break + elif platform.system() == "Darwin": # OSX + if app_exe.lower().endswith(".app"): + break + + if default_app_exe: + app_exe = default_app_exe + elif prefered_app_exe: app_exe = prefered_app_exe elif first_app_exe: app_exe = first_app_exe - if GENERATE_ACHIEVEMENT_WATCHER_SCHEMAS: - ach_watcher_gen.generate_all_ach_watcher_schemas( - base_out_dir, - appid, - app_name, - app_exe, - achievements, - icon) - - if GENERATE_CODEX_INI: - cdx_gen.generate_cdx_ini( - base_out_dir, - appid, - dlc_config_list, - achievements) + if not "_no_launcher_" in app_mode_tmp: + app_mode_new = app_mode_new + " launcher " + if not "_no_demo_" in app_mode_tmp: + app_mode_new = app_mode_new + " demo " + if not "_no_vr_" in app_mode_tmp: + app_mode_new = app_mode_new + " vr " + if not "_no_benchmark_" in app_mode_tmp: + app_mode_new = app_mode_new + " benchmark " - if DOWNLOAD_COMMON_IMAGES: - app_images.download_app_images( - base_out_dir, - appid, - clienticon, - icon, - logo, - logo_small) - - if DISABLE_EXTRA: - merge_dict(out_config_app_ini, EXTRA_FEATURES_DISABLE) - - if CONVENIENT_EXTRA: - merge_dict(out_config_app_ini, EXTRA_FEATURES_CONVENIENT) - - if out_config_app_ini: - write_ini_file(emu_settings_dir, out_config_app_ini) + app_mode_new = app_mode_new.lstrip(" ") + app_mode_new = app_mode_new.replace(" ", ", ") + app_mode_new = app_mode_new.rstrip(" ") + if "ufs" in game_info: + savegame_configs = game_info["ufs"] + with open(os.path.join(info_out_dir, "config_ufs.json"), "wt", encoding='utf-8') as f: + json.dump(savegame_configs, f, ensure_ascii=False, indent=2) + #print(f"[ ] Writing 'config_ufs.json'") + inventory_data = None if not SKIP_INVENTORY: inventory_data = generate_inventory(client, appid) @@ -1026,8 +1255,16 @@ def main(): default_items = {} inventory = json.loads(inventory_data.rstrip(b"\x00")) raw_inventory = json.dumps(inventory, indent=4) - with open(os.path.join(backup_dir, "inventory.json"), "w") as f: + + if len(inventory) != 1: + print(f"[ ] Found {len(inventory)} inventory items --- writing to 'items.json' and 'default_items.json'") + else: + print(f"[ ] Found {len(inventory)} inventory item --- writing to 'items.json' and 'default_items.json'") + + with open(os.path.join(backup_dir, f"InventoryItems_{appid}.json"), "w") as f: f.write(raw_inventory) + #print(f"[ ] Writing 'inventory.json'") + for i in inventory: index = str(i["itemdefid"]) x = {} @@ -1043,17 +1280,77 @@ def main(): with open(os.path.join(emu_settings_dir, "items.json"), "wt", encoding='utf-8') as f: json.dump(out_inventory, f, ensure_ascii=False, indent=2) + #print(f"[ ] __ writing 'items.json'") with open(os.path.join(emu_settings_dir, "default_items.json"), "wt", encoding='utf-8') as f: json.dump(default_items, f, ensure_ascii=False, indent=2) + #print(f"[ ] __ writing 'default_items.json'") - with open(os.path.join(backup_dir, "product_info.json"), "wt", encoding='utf-8') as f: - json.dump(game_info, f, ensure_ascii=False, indent=2) + else: + print(f"[?] No inventory items found - skip creating 'items.json' and 'default_items.json'") + + if app_exe: + if app_mode_new != "": + #print(f"[ ] Detected app exe: '{app_exe}', tags: {app_mode_new}") # use it to get some idea of what the exe might be + print(f"[ ] Detected app exe: '{app_exe}'") + else: + #print(f"[ ] Detected app exe: '{app_exe}', tags: app") # use it to get some idea of what the exe might be + print(f"[ ] Detected app exe: '{app_exe}'") + else: + print(f"[X] Cannot detect app exe") + + ''' # NOTE proof of concept code to get a string between two substrings in a file, e.g. get metacritic link for app from app_details.json + app_metacritic = [] + if os.path.isfile(os.path.join(base_out_dir, 'steam_misc\\app_info\\app_details.json')): + with open(os.path.join(base_out_dir, 'steam_misc\\app_info\\app_details.json'), 'r', encoding='utf-8') as app_det: + app_det_line = app_det.readlines() + for line in app_det_line: + if '"url": "https://www.metacritic' in line: + app_metacritic = GetListOfSubstrings(line,'"url": "https://www.metacritic', '"') + break + ''' + + if os.path.isdir(os.path.join(base_out_dir, 'steam_misc\\app_backup')): + if os.listdir(os.path.join(base_out_dir, 'steam_misc\\app_backup')): # zip 'app_backup' folder only if not empty + shutil.make_archive(os.path.join(base_out_dir, 'steam_misc\\app_backup'), 'zip', os.path.join(base_out_dir, 'steam_misc\\app_backup')) # first argument is the name of the zip file + shutil.rmtree(os.path.join(base_out_dir, 'steam_misc\\app_backup')) + os.makedirs(os.path.join(base_out_dir, 'steam_misc\\app_backup')) + shutil.move(os.path.join(base_out_dir, 'steam_misc\\app_backup.zip'), os.path.join(base_out_dir, 'steam_misc\\app_backup\\app_backup.zip')) + + if DOWNLOAD_COMMON_IMAGES: + app_images.download_app_images( + base_out_dir, + appid, + clienticon, + icon, + logo, + logo_small) + + if GENERATE_ACHIEVEMENT_WATCHER_SCHEMAS: + ach_watcher_gen.generate_all_ach_watcher_schemas( + base_out_dir, + appid, + app_name, + app_exe, + achievements, + icon) - with open(os.path.join(backup_dir, "dlc_product_info.json"), "wt", encoding='utf-8') as f: - json.dump(dlc_raw, f, ensure_ascii=False, indent=2) + if GENERATE_CODEX_INI: + cdx_gen.generate_cdx_ini( + base_out_dir, + appid, + cfg_user_account_steamid, + cfg_user_account_name, + cfg_user_language, + dlc_config_list, + achievements) + + if DOWNLOAD_SCX: + scx_gen.download_scx(base_out_dir, appid) - print(f"######### done for app id {appid} #########\n\n") + print(" ") + print(f"*** FINISHED config for app id {appid} ***") + print(" ") if __name__ == "__main__": try: diff --git a/tools/generate_emu_config/generate_emu_config.py_ini.cfg b/tools/generate_emu_config/generate_emu_config.py_ini.cfg new file mode 100644 index 00000000..ce1fa540 --- /dev/null +++ b/tools/generate_emu_config/generate_emu_config.py_ini.cfg @@ -0,0 +1,171 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1 - for RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, 4, 5, DO NOTE that if your .BAT/.CMD/.PS1 file ends with 'pause' and/or you have '& pause'(CMD)/'; pause'(PS) at the end of CommandLine, it is recommended you use CommandWindowMode 2, so that CMD/PS process will close after 'Press any key to continue' +# ... If you wish to run your .BAT/.CMD/.PS1 file or command silent and hidden (with CommandWindowMode 2 and WindowState 0), make sure to remove 'pause' from your .BAT/.CMD/.PS1 file and/or at the end of CommandLine, otherwise CMD/PS process will fail to close automatically +CommandLine=.\bat\generate_emu_config.py_ini.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Keep window opened after executing commands (same as 'CMD /K') - try to avoid this, instead use 'pause' at the end of script or CommandLine, otherwise CMD/PS process will close only with 'exit' command +# 2 - Close window after executing commands (same as 'CMD /C') - try to always use this, with 'pause' at the end of script or CommandLine, so that CMD/PS process will close after 'Press any key to continue', or close automatically if no 'pause' at the end +# DO NOTE that CommandWindowMode 1 is not the same as your .BAT/.CMD/.PS1 file ending with 'pause' and/or having '& pause'(CMD)/'; pause'(PS) at the end of CommandLine +# ... With CommandWindowMode 1 and no 'pause' at the end, CMD/PS window will show current directory and terminate only with 'exit' command +# ... With CommandWindowMode 2 and 'pause' at the end, CMD/PS window will show 'Press any key to continue' and terminate on any key press +CommandWindowMode=1 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/generate_emu_config.py_ini.exe b/tools/generate_emu_config/generate_emu_config.py_ini.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/generate_emu_config.py_ini.exe differ diff --git a/tools/generate_emu_config/generate_emu_config.py_run_anon.cfg b/tools/generate_emu_config/generate_emu_config.py_run_anon.cfg new file mode 100644 index 00000000..afbf2c41 --- /dev/null +++ b/tools/generate_emu_config/generate_emu_config.py_run_anon.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\bat\generate_emu_config.py_run_anon.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/generate_emu_config.py_run_anon.exe b/tools/generate_emu_config/generate_emu_config.py_run_anon.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/generate_emu_config.py_run_anon.exe differ diff --git a/tools/generate_emu_config/generate_emu_config.py_run_test.cfg b/tools/generate_emu_config/generate_emu_config.py_run_test.cfg new file mode 100644 index 00000000..359474e4 --- /dev/null +++ b/tools/generate_emu_config/generate_emu_config.py_run_test.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\bat\generate_emu_config.py_run_test.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/generate_emu_config.py_run_test.exe b/tools/generate_emu_config/generate_emu_config.py_run_test.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/generate_emu_config.py_run_test.exe differ diff --git a/tools/generate_emu_config/generate_emu_config.py_run_user.cfg b/tools/generate_emu_config/generate_emu_config.py_run_user.cfg new file mode 100644 index 00000000..0918982d --- /dev/null +++ b/tools/generate_emu_config/generate_emu_config.py_run_user.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\bat\generate_emu_config.py_run_user.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/generate_emu_config.py_run_user.exe b/tools/generate_emu_config/generate_emu_config.py_run_user.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/generate_emu_config.py_run_user.exe differ diff --git a/tools/generate_emu_config/post_build/bat/generate_emu_config.exe_anon.bat b/tools/generate_emu_config/post_build/bat/generate_emu_config.exe_anon.bat new file mode 100644 index 00000000..1a899929 --- /dev/null +++ b/tools/generate_emu_config/post_build/bat/generate_emu_config.exe_anon.bat @@ -0,0 +1,3 @@ +@echo off +set /p arg="Generate Emu Config for Steam AppId: " +generate_emu_config.exe -cdx -acw -clr -anon %arg% \ No newline at end of file diff --git a/tools/generate_emu_config/post_build/bat/generate_emu_config.exe_user.bat b/tools/generate_emu_config/post_build/bat/generate_emu_config.exe_user.bat new file mode 100644 index 00000000..4a7156e7 --- /dev/null +++ b/tools/generate_emu_config/post_build/bat/generate_emu_config.exe_user.bat @@ -0,0 +1,3 @@ +@echo off +set /p arg="Generate Emu Config for Steam AppId: " +generate_emu_config.exe -cdx -acw -clr %arg% \ No newline at end of file diff --git a/tools/generate_emu_config/post_build/generate_emu_config.exe_anon.cfg b/tools/generate_emu_config/post_build/generate_emu_config.exe_anon.cfg new file mode 100644 index 00000000..af69bf30 --- /dev/null +++ b/tools/generate_emu_config/post_build/generate_emu_config.exe_anon.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\bat\generate_emu_config.exe_anon.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/post_build/generate_emu_config.exe_anon.exe b/tools/generate_emu_config/post_build/generate_emu_config.exe_anon.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/post_build/generate_emu_config.exe_anon.exe differ diff --git a/tools/generate_emu_config/post_build/generate_emu_config.exe_user.cfg b/tools/generate_emu_config/post_build/generate_emu_config.exe_user.cfg new file mode 100644 index 00000000..14711a6c --- /dev/null +++ b/tools/generate_emu_config/post_build/generate_emu_config.exe_user.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\bat\generate_emu_config.exe_user.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/generate_emu_config/post_build/generate_emu_config.exe_user.exe b/tools/generate_emu_config/post_build/generate_emu_config.exe_user.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/generate_emu_config/post_build/generate_emu_config.exe_user.exe differ diff --git a/tools/generate_emu_config/rebuild_win.bat b/tools/generate_emu_config/rebuild_win.bat index 769c5e65..4cf40ed7 100644 --- a/tools/generate_emu_config/rebuild_win.bat +++ b/tools/generate_emu_config/rebuild_win.bat @@ -52,12 +52,15 @@ pyinstaller "stats_schema_achievement_gen\achievements_gen.py" --distpath "%out_ ) call "%signer_tool%" "%out_dir%\parse_achievements_schema\parse_achievements_schema.exe" +xcopy /s /y /e "post_build" "%out_dir%\generate_emu_config\" +xcopy /s /y /e "_DEFAULT" "%out_dir%\generate_emu_config\_DEFAULT\" + copy /y "steam_default_icon_locked.jpg" "%out_dir%\generate_emu_config\" copy /y "steam_default_icon_unlocked.jpg" "%out_dir%\generate_emu_config\" copy /y "README.md" "%out_dir%\generate_emu_config\" -1>"%out_dir%\generate_emu_config\my_login.EXAMPLE.txt" echo Check the README -1>"%out_dir%\generate_emu_config\top_owners_ids.EXAMPLE.txt" echo Check the README -1>>"%out_dir%\generate_emu_config\top_owners_ids.EXAMPLE.txt" echo You can use a website like: https://steamladder.com/games/ +if exist "top_owners_ids.txt" ( + copy /y "top_owners_ids.txt" "%out_dir%\generate_emu_config\" +) echo: echo ============= @@ -69,6 +72,6 @@ if exist "%build_temp_dir%" ( rmdir /s /q "%build_temp_dir%" ) popd -endlocal & ( +endlocal & (pause exit /b %last_code% ) diff --git a/tools/generate_emu_config/requirements.txt b/tools/generate_emu_config/requirements.txt index 8d87fb49..278911a3 100644 --- a/tools/generate_emu_config/requirements.txt +++ b/tools/generate_emu_config/requirements.txt @@ -2,3 +2,7 @@ steam[client] pyinstaller requests certifi +configobj + + + diff --git a/tools/generate_emu_config/stats_schema_achievement_gen/achievements_gen.py b/tools/generate_emu_config/stats_schema_achievement_gen/achievements_gen.py index a0fad7d2..37c500f4 100644 --- a/tools/generate_emu_config/stats_schema_achievement_gen/achievements_gen.py +++ b/tools/generate_emu_config/stats_schema_achievement_gen/achievements_gen.py @@ -5,7 +5,6 @@ import json import copy import traceback - STAT_TYPE_INT = '1' STAT_TYPE_FLOAT = '2' STAT_TYPE_AVGRATE = '3' @@ -65,7 +64,8 @@ def generate_stats_achievements( out['default'] = stat['default'] stats_out += [out] - #print(stat_info[s]) + + # print(stat_info[s]) copy_default_unlocked_img = False copy_default_locked_img = False @@ -122,6 +122,9 @@ def generate_stats_achievements( if output_stats: with open(os.path.join(config_directory, "stats.txt"), 'wt', encoding='utf-8') as f: f.writelines(output_stats) + print(f"[ ] Found {len(output_stats)} stats --- writing to 'stats.txt'") + else: + print(f"[?] No stats found - skip creating 'stats.txt'") return (achievements_out, stats_out, copy_default_unlocked_img, copy_default_locked_img) @@ -140,17 +143,17 @@ if __name__ == '__main__': for bin_file in sys.argv[1:]: try: - print(f"parsing schema file '{bin_file}'") + print(f"[ ] Parsing schema file '{bin_file}'") schema: bytes = b'' with open(bin_file, 'rb') as f: schema = f.read() if schema: filename = os.path.basename(bin_file) outdir = os.path.join(f"{filename}_output", "steam_settings") - print(f"output dir: '{outdir}'") + print(f"[ ] __ output dir: '{outdir}'") generate_stats_achievements(schema, outdir) else: - print("[X] couldn't load file", file=sys.stderr) + print("[X] Couldn't load file", file=sys.stderr) print('**********************************\n') except Exception as e: @@ -159,6 +162,6 @@ if __name__ == '__main__': print("-----------------------") for line in traceback.format_exception(e): print(line) - print('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n') + print("-----------------------") sys.exit(0) diff --git a/tools/generate_interfaces/generate_interfaces.cpp b/tools/generate_interfaces/generate_interfaces.cpp index b06e676b..cf02cb10 100644 --- a/tools/generate_interfaces/generate_interfaces.cpp +++ b/tools/generate_interfaces/generate_interfaces.cpp @@ -9,36 +9,44 @@ // static char old_xxx[128] = ... const static std::vector interface_patterns = { + R"(STEAMAPPLIST_INTERFACE_VERSION\d+)", + R"(STEAMAPPS_INTERFACE_VERSION\d+)", + R"(STEAMAPPTICKET_INTERFACE_VERSION\d+)", R"(SteamClient\d+)", - + R"(SteamController\d+)", + R"(SteamFriends\d+)", + R"(SteamGameCoordinator\d+)", R"(SteamGameServerStats\d+)", R"(SteamGameServer\d+)", - + R"(SteamGameStats\d+)", + R"(STEAMHTMLSURFACE_INTERFACE_VERSION_\d+)", + R"(STEAMHTTP_INTERFACE_VERSION\d+)", + R"(SteamInput\d+)", + R"(STEAMINVENTORY_INTERFACE_V\d+)", + R"(SteamMasterServerUpdater\d+)", + R"(SteamMatchGameSearch\d+)", R"(SteamMatchMakingServers\d+)", R"(SteamMatchMaking\d+)", - - R"(SteamUser\d+)", - R"(SteamFriends\d+)", - R"(SteamUtils\d+)", - R"(STEAMUSERSTATS_INTERFACE_VERSION\d+)", - R"(STEAMAPPS_INTERFACE_VERSION\d+)", - R"(SteamNetworking\d+)", - R"(STEAMREMOTESTORAGE_INTERFACE_VERSION\d+)", - R"(STEAMSCREENSHOTS_INTERFACE_VERSION\d+)", - R"(STEAMHTTP_INTERFACE_VERSION\d+)", - R"(STEAMUNIFIEDMESSAGES_INTERFACE_VERSION\d+)", - - R"(STEAMCONTROLLER_INTERFACE_VERSION\d+)", - R"(SteamController\d+)", - - R"(STEAMUGC_INTERFACE_VERSION\d+)", - R"(STEAMAPPLIST_INTERFACE_VERSION\d+)", R"(STEAMMUSIC_INTERFACE_VERSION\d+)", R"(STEAMMUSICREMOTE_INTERFACE_VERSION\d+)", - R"(STEAMHTMLSURFACE_INTERFACE_VERSION_\d+)", - R"(STEAMINVENTORY_INTERFACE_V\d+)", - R"(STEAMVIDEO_INTERFACE_V\d+)", - R"(SteamMasterServerUpdater\d+)", + R"(SteamNetworkingMessages\d+)", + R"(SteamNetworkingSocketsSerialized\d+)", + R"(SteamNetworkingSockets\d+)", + R"(SteamNetworkingUtils\d+)", + R"(SteamNetworking\d+)", + R"(STEAMPARENTALSETTINGS_INTERFACE_VERSION\d+)", + R"(SteamParties\d+)", + R"(STEAMREMOTEPLAY_INTERFACE_VERSION\d+)", + R"(STEAMREMOTESTORAGE_INTERFACE_VERSION\d+)", + R"(STEAMSCREENSHOTS_INTERFACE_VERSION\d+)", + R"(STEAMTIMELINE_INTERFACE_V\d+)", + R"(STEAMTV_INTERFACE_V\d+)", + R"(STEAMUGC_INTERFACE_VERSION\d+)", + R"(STEAMUNIFIEDMESSAGES_INTERFACE_VERSION\d+)", + R"(STEAMUSERSTATS_INTERFACE_VERSION\d+)", + R"(SteamUser\d+)", + R"(SteamUtils\d+)", + R"(STEAMVIDEO_INTERFACE_V\d+)" }; unsigned int findinterface( @@ -63,8 +71,10 @@ unsigned int findinterface( int main (int argc, char *argv[]) { + std::cout << "Generate_Interfaces.exe for Goldberg Steam Emulator " << std::endl << std::endl; + if (argc < 2) { - std::cerr << "usage: " << argv[0] << " " << std::endl; + std::cerr << "Usage: " << argv[0] << " " << std::endl; return 1; } @@ -84,6 +94,8 @@ int main (int argc, char *argv[]) return 1; } + std::cout << "Please wait... Generating steam_interfaces.txt" << std::endl << std::endl; + unsigned int total_matches = 0; std::ofstream out_file(std::filesystem::u8path("steam_interfaces.txt")); if (!out_file.is_open()) { @@ -93,6 +105,7 @@ int main (int argc, char *argv[]) for (const auto &patt : interface_patterns) { total_matches += findinterface(out_file, steam_api_contents, patt); + std::cout << "Searching for '" + patt + "'..." << std::endl; } out_file.close(); diff --git a/tools/lobby_connect/lobby_connect.cpp b/tools/lobby_connect/lobby_connect.cpp index 3478f3b3..e5a0709d 100644 --- a/tools/lobby_connect/lobby_connect.cpp +++ b/tools/lobby_connect/lobby_connect.cpp @@ -45,10 +45,10 @@ int main() { //Set appid to: LOBBY_CONNECT_APPID SteamAPI_RestartAppIfNecessary(LOBBY_CONNECT_APPID); - std::cout << "This is a program to find lobbies and run the game with lobby connect parameters" << std::endl; - std::cout << "Api initialized, "; + std::cout << "Lobby_Connect.exe for Goldberg Steam Emulator " << std::endl << std::endl; + std::cout << "Steam Emulator API initialized" << std::endl; top: - std::cout << "waiting a few seconds for connections:" << std::endl; + std::cout << "Waiting a few seconds for connections" << std::endl << std::endl; for (int i = 0; i < 10; ++i) { SteamAPI_RunCallbacks(); std::this_thread::sleep_for(std::chrono::milliseconds(200)); @@ -65,7 +65,7 @@ top: std::cout << name << " is playing: " << friend_info.m_gameID.AppID() << std::endl; } - std::cout << std::endl << "--------------Menu-------------" << std::endl << "\tappid\tname\tcommand line" << std::endl; + std::cout << std::endl << "----------------------Menu---------------------" << std::endl << " \tappid\t\tname\t\tcmdline" << std::endl << std::endl; std::vector> arguments; for (int i = 0; i < friend_count; ++i) { @@ -77,19 +77,19 @@ top: auto appid = friend_info.m_gameID.AppID(); if (strlen(connect) > 0) { - std::cout << arguments.size() << "\t" << appid << "\t" << name << "\t" << connect << std::endl; + std::cout << arguments.size() << ": \t" << appid << "\t\t" << name << "\t\t" << connect << std::endl; arguments.emplace_back(connect, appid); } else { if (friend_info.m_steamIDLobby != k_steamIDNil) { std::string connect = "+connect_lobby " + std::to_string(friend_info.m_steamIDLobby.ConvertToUint64()); - std::cout << arguments.size() << "\t" << appid << "\t" << name << "\t" << connect << std::endl; + std::cout << arguments.size() << ": \t" << appid << "\t\t" << name << "\t\t" << connect << std::endl; arguments.emplace_back(connect, appid); } } } - std::cout << arguments.size() << ": Retry." << std::endl; - std::cout << std::endl << "Enter the number corresponding to your choice then press Enter." << std::endl; + std::cout << arguments.size() << ": \tRetry" << std::endl; + std::cout << std::endl << "Enter the number corresponding to your choice then press Enter" << std::endl; unsigned int choice; std::cin >> choice; @@ -98,7 +98,7 @@ top: auto connect = arguments[choice].first; #ifdef _WIN32 auto appid = arguments[choice].second; - std::cout << "starting the game with: " << connect << std::endl; + std::cout << "Starting the game with: " << connect << std::endl; char szBaseDirectory[MAX_PATH] = ""; GetModuleFileNameA(0, szBaseDirectory, MAX_PATH); @@ -150,7 +150,7 @@ top: std::string filename = readLobbyFile(); if (filename.empty() || !fileExists(filename) || !joinLobby(filename)) { - std::cout << "Please select the game exe" << std::endl; + std::cout << "Please browse for game exe" << std::endl; OPENFILENAMEA ofn; char szFileName[MAX_PATH] = ""; diff --git a/tools/migrate_gse/README.md b/tools/migrate_gse/README.md index 9ca5ff9f..7557bd8b 100644 --- a/tools/migrate_gse/README.md +++ b/tools/migrate_gse/README.md @@ -1,16 +1,8 @@ -# Save & Settings folder migration tool -This tool allows you to migrate your `steam_settings` folder, or your global `settings` folder from the old format, to the new `.ini` oriented format. - -## Where is the global settings folder? -On Windows this folder is located at `%appdata%\Goldberg SteamEmu Saves\settings\` -On Linux this folder is located at: - * if env var `XDG_DATA_HOME` is defined: - `$XDG_DATA_HOME/Goldberg SteamEmu Saves/settings/` - * Otherwise, if env var `HOME` is defined: - `$HOME/.local/share/Goldberg SteamEmu Saves/settings/` +# What is this ? +This tool allows you to migrate your `steam_settings` folder, or your global `settings` folder from the old `.txt` format, to the new `.ini` oriented format. ## How to migrate the global settings folder -Simply open the terminal/cmd in the folder of the tool and run it **without** any arguments. +Open the terminal/cmd in the folder of the tool and run it **without** any arguments. * On Windows: ```shell migrate_gse.exe @@ -20,7 +12,7 @@ Simply open the terminal/cmd in the folder of the tool and run it **without** an chmod 777 migrate_gse ./migrate_gse ``` -The tool will generate a new folder in the current directory called `steam_settings`, copy the **content inside** this folder (a bunch of `.ini` files) and paste them here: + The tool will generate a new folder in the current directory called `steam_settings`, copy the **content inside** this folder (a bunch of `.ini` files) and paste them here: * On Windows: `%appdata%\GSE Saves\settings\` * On Linux: * if env var `XDG_DATA_HOME` is defined: @@ -32,7 +24,7 @@ Notice the new name of the global saves folder `GSE Saves`, not to be confused w Finally, copy everything from `Goldberg SteamEmu Saves` to `GSE Saves` -## How to migrate a local `steam_settings` folder you already have +## How to migrate a local steam settings folder Open the terminal/cmd in the folder of the tool and run it with only one argument, which is the path to the target `steam_settings` folder. * On Windows: ```shell @@ -43,11 +35,11 @@ Open the terminal/cmd in the folder of the tool and run it with only one argumen chmod 777 migrate_gse ./migrate_gse ~/"some game/steam_settings" ``` -The tool will generate a new folder in the current directory called `steam_settings`, copy the **content inside** this folder (a bunch of `.ini` files) and paste them inside the target/old `steam_settings` folder + The tool will generate a new folder in the current directory called `steam_settings`, copy the **content inside** this folder (a bunch of `.ini` files) and paste them inside the target/old `steam_settings` folder ## General notes * In all cases, the tool will not copy the achievements images, overlay fonts/sounds, and all the extra stuff, it will just generate the corresponding `.ini` files -* Some configuration files are still using the same old format, that includes all the `.json` files, depots.txt, subscribed_groups_xxx.txt, etc... +* Some configuration files are still using the same old format, that includes all the `.json` files, depots.txt, subscribed_groups_xxx.txt, etc ... So don't just remove everything from the old `steam_settings` folder diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api.7z b/tools/migrate_gse/_DEFAULT/0/steam_api.7z new file mode 100644 index 00000000..a1b35a78 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/0/steam_api.7z differ diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api.dll b/tools/migrate_gse/_DEFAULT/0/steam_api.dll new file mode 100644 index 00000000..a90054e6 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/0/steam_api.dll differ diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api64.7z b/tools/migrate_gse/_DEFAULT/0/steam_api64.7z new file mode 100644 index 00000000..1e741114 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/0/steam_api64.7z differ diff --git a/tools/migrate_gse/_DEFAULT/0/steam_api64.dll b/tools/migrate_gse/_DEFAULT/0/steam_api64.dll new file mode 100644 index 00000000..1d72bd5b Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/0/steam_api64.dll differ diff --git a/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.cfg b/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.cfg new file mode 100644 index 00000000..3bcab4ed --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\acw_helper.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.exe b/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/gse_acw_helper.exe differ diff --git a/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.cfg b/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.cfg new file mode 100644 index 00000000..63cd4ecb --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\debug_switch.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.exe b/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/gse_debug_switch.exe differ diff --git a/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.cfg b/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.cfg new file mode 100644 index 00000000..7e8faf9a --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\generate_interfaces.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.exe b/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/gse_generate_interfaces.exe differ diff --git a/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.cfg b/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.cfg new file mode 100644 index 00000000..dbf64ac5 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\steam_misc\tools\bat\lobby_connect.bat + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=0 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.exe b/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/gse_lobby_connect.exe differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt new file mode 100644 index 00000000..5142f3f7 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za-license.txt @@ -0,0 +1,125 @@ + 7-Zip Extra + ~~~~~~~~~~~ + License for use and distribution + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Copyright (C) 1999-2024 Igor Pavlov. + + 7-Zip Copyright (C) 1999-2024 Igor Pavlov. + + The licenses for files are: + + - 7za.exe: + - The "GNU LGPL" as main license for most of the code + - The "BSD 3-clause License" for some code + - The "BSD 2-clause License" for some code + - All other files: the "GNU LGPL". + + Redistributions in binary form must reproduce related license information from this file. + + Note: + You can use 7-Zip Extra on any computer, including a computer in a commercial + organization. You don't need to register or pay for 7-Zip. + + It is allowed to digitally sign DLL and EXE files included into this package + with arbitrary signatures of third parties. + + +GNU LGPL information +-------------------- + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You can receive a copy of the GNU Lesser General Public License from + http://www.gnu.org/ + + + +BSD 3-clause License in 7-Zip code +---------------------------------- + + The "BSD 3-clause License" is used for the following code in 7za.exe + - ZSTD data decompression. + that code was developed using original zstd decoder code as reference code. + The original zstd decoder code was developed by Facebook Inc, + that also uses the "BSD 3-clause License". + + Copyright (c) Facebook, Inc. All rights reserved. + Copyright (c) 2023-2024 Igor Pavlov. + +Text of the "BSD 3-clause License" +---------------------------------- + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + + + + +BSD 2-clause License in 7-Zip code +---------------------------------- + + The "BSD 2-clause License" is used for the XXH64 code in 7za.exe. + + XXH64 code in 7-Zip was derived from the original XXH64 code developed by Yann Collet. + + Copyright (c) 2012-2021 Yann Collet. + Copyright (c) 2023-2024 Igor Pavlov. + +Text of the "BSD 2-clause License" +---------------------------------- + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za.exe b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za.exe new file mode 100644 index 00000000..bb7216dd Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/7za/7za.exe differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt new file mode 100644 index 00000000..3be4eb06 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3-license.txt @@ -0,0 +1,58 @@ +Software License + +AutoIt + +Author : Jonathan Bennett and the AutoIt Team +WWW : https://www.autoitscript.com/site/autoit/ +Email : support at autoitscript dot com +________________________________________________________ + +END-USER LICENSE AGREEMENT FOR THIS SOFTWARE + + +This End-User License Agreement ("EULA") is a legal agreement between you (either an individual or a single entity) and the mentioned author of this Software for the software product identified above, which includes computer software and may include associated media, printed materials, and "online" or electronic documentation ("SOFTWARE PRODUCT"). By installing, copying, or otherwise using the SOFTWARE PRODUCT, you agree to be bound by the terms of this EULA. If you do not agree to the terms of this EULA, do not install or use the SOFTWARE PRODUCT. + + + +SOFTWARE PRODUCT LICENSE + +The SOFTWARE PRODUCT is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. The SOFTWARE PRODUCT is licensed, not sold. + +The definition of SOFTWARE PRODUCT does not includes any files generated by the SOFTWARE PRODUCT, such as compiled script files in the form of standalone executables. + + +1. GRANT OF LICENSE + +This EULA grants you the following rights: + +Installation and Use. You may install and use an unlimited number of copies of the SOFTWARE PRODUCT. + +Reproduction and Distribution. You may reproduce and distribute an unlimited number of copies of the SOFTWARE PRODUCT either in whole or in part; each copy should include all copyright and trademark notices, and shall be accompanied by a copy of this EULA. Copies of the SOFTWARE PRODUCT may be distributed as a standalone product or included with your own product. + +Commercial Use. You may use the SOFTWARE PRODUCT for commercial purposes. You may sell for profit and freely distribute scripts and/or compiled scripts that were created with the SOFTWARE PRODUCT. + +Reverse engineering. You may not reverse engineer or disassemble the SOFTWARE PRODUCT. + +2. COPYRIGHT + +All title and copyrights in and to the SOFTWARE PRODUCT (including but not limited to any images, photographs, animations, video, audio, music, text, and "applets" incorporated into the SOFTWARE PRODUCT), the accompanying printed materials, and any copies of the SOFTWARE PRODUCT are owned by the Author of this Software. The SOFTWARE PRODUCT is protected by copyright laws and international treaty provisions. Therefore, you must treat the SOFTWARE PRODUCT like any other copyrighted material. + + + +MISCELLANEOUS + +If you acquired this product in the United Kingdom, this EULA is governed by the laws of the United Kingdom. If this product was acquired outside the United Kingdom, then local law may apply. + +Should you have any questions concerning this EULA, or if you desire to contact the author of this Software for any reason, please contact him/her at the email address mentioned at the top of this EULA. + + + +LIMITED WARRANTY + +1. NO WARRANTIES + +The Author of this Software expressly disclaims any warranty for the SOFTWARE PRODUCT. The SOFTWARE PRODUCT and any related documentation is provided "as is" without warranty of any kind, either express or implied, including, without limitation, the implied warranties or merchantability, fitness for a particular purpose, or non-infringement. The entire risk arising out of use or performance of the SOFTWARE PRODUCT remains with you. + +2. NO LIABILITY FOR DAMAGES + +In no event shall the author of this Software be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use of or inability to use this product, even if the Author of this Software has been advised of the possibility of such damages. Because some states/jurisdictions do not allow the exclusion or limitation of liability for consequential or incidental damages, the above limitation may not apply to you. diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3.exe b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3.exe new file mode 100644 index 00000000..d495de2a Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/au3.exe differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x new file mode 100644 index 00000000..c3b94af7 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.a3x differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 new file mode 100644 index 00000000..e8dfdffc --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.au3 @@ -0,0 +1,184 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +#include +#include + +; ARC_NAME + +$arc_extra_acw = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "extra_acw", "extra_acw.zip") + +$ach_watcher_arc = @ScriptDir & "\steam_misc\extra_acw\" & $arc_extra_acw +$ach_watcher_dst = @AppDataDir & "\Achievement Watcher" + +If FileExists($ach_watcher_arc) Then + + $gse_saves = IniRead(@ScriptDir & "\steam_settings\configs.user.ini", "user::saves", "saves_folder_name", "GSE Saves") + $local_save = IniRead(@ScriptDir & "\steam_settings\configs.user.ini", "user::saves", "local_save_path", "") + $local_save = StringReplace($local_save, "./", "") + $local_save = StringReplace($local_save, ".\", "") + + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $ach_watcher_arc & '" -o"' & $ach_watcher_dst & '" -aoa', "", "", @SW_HIDE) + + If $local_save <> "" Then + + $userdir_line1 = ' {' + $userdir_line2 = ' "path": "' & StringReplace(@ScriptDir & "\" & $gse_saves, "\", "\\") & '",' + $userdir_line3 = ' "notify": true' + $userdir_line4 = ' }' + + $file = @AppDataDir & "\Achievement Watcher\cfg\userdir.db" + $temp = @AppDataDir & "\Achievement Watcher\cfg\userdir_temp.db" + + If Not FileExists($file) Then + ;FileCopy(@ScriptDir & "\steam_settings\ach\cfg\userdir.db", $file, 1) + FileWriteLine($file, "[") + FileWriteLine($file, "]") + If FileExists($temp) Then FileDelete($temp) + Local $aLines + _FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + Else + Local $aLines, $hMatch + _FileReadToArray($file, $aLines) + For $i = 1 To $aLines[0] + If StringInStr($aLines[$i], $userdir_line2) Then $hMatch = 1 + Next + If $hMatch == 1 Then + If FileExists($temp) Then FileDelete($temp) + Else + If FileExists($temp) Then FileDelete($temp) + ;Local $aLines + ;_FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + EndIf + EndIf + + _ReplaceStringInFile($file, " }" & @CRLF & " {", " }," & @CRLF & " {") + + ; --- + + $userdir_line1 = ' {' + $userdir_line2 = ' "path": "' & StringReplace(@ScriptDir & "\" & $local_save, "\", "\\") & '",' + $userdir_line3 = ' "notify": true' + $userdir_line4 = ' }' + + $file = @AppDataDir & "\Achievement Watcher\cfg\userdir.db" + $temp = @AppDataDir & "\Achievement Watcher\cfg\userdir_temp.db" + + If Not FileExists($file) Then + ;FileCopy(@ScriptDir & "\steam_settings\ach\cfg\userdir.db", $file, 1) + FileWriteLine($file, "[") + FileWriteLine($file, "]") + If FileExists($temp) Then FileDelete($temp) + Local $aLines + _FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + Else + Local $aLines, $hMatch + _FileReadToArray($file, $aLines) + For $i = 1 To $aLines[0] + If StringInStr($aLines[$i], $userdir_line2) Then $hMatch = 1 + Next + If $hMatch == 1 Then + If FileExists($temp) Then FileDelete($temp) + Else + If FileExists($temp) Then FileDelete($temp) + ;Local $aLines + ;_FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + EndIf + EndIf + + _ReplaceStringInFile($file, " }" & @CRLF & " {", " }," & @CRLF & " {") + + Else + + $userdir_line1 = ' {' + $userdir_line2 = ' "path": "' & StringReplace(@AppDataDir & "\" & $gse_saves, "\", "\\") & '",' + $userdir_line3 = ' "notify": true' + $userdir_line4 = ' }' + + $file = @AppDataDir & "\Achievement Watcher\cfg\userdir.db" + $temp = @AppDataDir & "\Achievement Watcher\cfg\userdir_temp.db" + + If Not FileExists($file) Then + ;FileCopy(@ScriptDir & "\steam_settings\ach\cfg\userdir.db", $file, 1) + FileWriteLine($file, "[") + FileWriteLine($file, "]") + If FileExists($temp) Then FileDelete($temp) + Local $aLines + _FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + Else + Local $aLines, $hMatch + _FileReadToArray($file, $aLines) + For $i = 1 To $aLines[0] + If StringInStr($aLines[$i], $userdir_line2) Then $hMatch = 1 + Next + If $hMatch == 1 Then + If FileExists($temp) Then FileDelete($temp) + Else + If FileExists($temp) Then FileDelete($temp) + ;Local $aLines + ;_FileReadToArray($file, $aLines) + Local $lastline = _ArrayPop($aLines) + _FileWriteFromArray($temp, $aLines) + FileWriteLine($temp, $userdir_line1) + FileWriteLine($temp, $userdir_line2) + FileWriteLine($temp, $userdir_line3) + FileWriteLine($temp, $userdir_line4) + FileWriteLine($temp, $lastline) + _ReplaceStringInFile($temp, $aLines[0] & @CRLF, "") + FileMove($temp, $file, 1) + EndIf + EndIf + + _ReplaceStringInFile($file, " }" & @CRLF & " {", " }," & @CRLF & " {") + + EndIf + +EndIf \ No newline at end of file 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 new file mode 100644 index 00000000..fbe73d68 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/acw_helper.ini @@ -0,0 +1,3 @@ +[ARC_NAME] + +extra_acw = extra_acw.7z diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.a3x new file mode 100644 index 00000000..25d8ead7 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/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/1/steam_misc/tools/au3/scripts/debug_switch.au3 new file mode 100644 index 00000000..d2e42dca --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.au3 @@ -0,0 +1,81 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +; ARC_NAME + +$arc_steam_api = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steam_api", "steam_api.7z") +$arc_steam_api64 = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steam_api64", "steam_api64.7z") + +$arc_steamclient = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steamclient", "steamclient.7z") +$arc_steamclient64 = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "steamclient64", "steamclient64.7z") + +; DLL_PATH + +$steam_api_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api_release", "release\steam_api.dll") +$steam_api64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api64_release", "release\steam_api64.dll") + +$steam_api_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api_debug", "debug\steam_api.dll") +$steam_api64_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steam_api64_debug", "debug\steam_api64.dll") + +$steamclient_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steamclient_release", "release\steamclient.dll") +$steamclient64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steamclient64_release", "release\steamclient64.dll") + +$steamclient_debug = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "DLL_PATH", "steamclient_debug", "debug\steamclient.dll") +$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 + $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, "\\", "\") + If FileExists($steam_api_dst) Then + FileMove($steam_api_debug_src, $steam_api_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 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 + $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, "\\", "\") + If FileExists($steamclient_dst) Then + FileMove($steamclient_debug_src, $steamclient_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 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 + $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, "\\", "\") + If FileExists($steam_api_dst) Then + FileMove($steam_api_release_src, $steam_api_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steam_api, 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 + $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, "\\", "\") + If FileExists($steamclient_dst) Then + FileMove($steamclient_release_src, $steamclient_dst, 1) + EndIf + DirRemove(@ScriptDir & "\steam_misc\" & StringTrimRight($arc_steamclient, 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/1/steam_misc/tools/au3/scripts/debug_switch.ini new file mode 100644 index 00000000..4c32acbb --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/debug_switch.ini @@ -0,0 +1,22 @@ +[ARC_NAME] + +steam_api = steam_api.7z +steam_api64 = steam_api64.7z + +steamclient = steamclient.7z +steamclient64 = steamclient64.7z + + +[DLL_PATH] + +steam_api_release = release\steam_api.dll +steam_api64_release = release\steam_api64.dll + +steam_api_debug = debug\steam_api.dll +steam_api64_debug = debug\steam_api64.dll + +steamclient_release = release\steamclient.dll +steamclient64_release = release\steamclient64.dll + +steamclient_debug = debug\steamclient.dll +steamclient64_debug = debug\steamclient64.dll \ No newline at end of file diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x new file mode 100644 index 00000000..bd7ca33e Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.a3x differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 new file mode 100644 index 00000000..c76d8aac --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.au3 @@ -0,0 +1,200 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +#include + +; ARC_NAME + +$arc_generate_interfaces = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "generate_interfaces", "generate_interfaces.7z") + +; EXE_PATH + +$generate_interfaces_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "generate_interfaces_release", "generate_interfaces.exe") +$generate_interfaces64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "generate_interfaces64_release", "generate_interfaces64.exe") + +$generate_interfaces_7z = @ScriptDir & '\steam_misc\tools\generate_interfaces\' & $arc_generate_interfaces +$generate_interfaces_dst = @ScriptDir & '\steam_misc\tools\generate_interfaces' +$generate_interfaces_exe = '' +Switch @OSArch + Case 'X64' + $generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) ; generate_interfaces64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case 'X86' + $generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)) ; generate_interfaces.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case Else + $generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) ; generate_interfaces64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $generate_interfaces_7z & '" -o"' & $generate_interfaces_dst & '" -aoa', "", "", @SW_HIDE) + EndIf +EndSwitch + +If Not FileExists(@ScriptDir & '\steam_api.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) +If Not FileExists(@ScriptDir & '\steam_api64.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) + +Switch @OSArch + Case 'X64' + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + $generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)) + EndIf + Case 'X86' + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1))) Then + $generate_interfaces_exe = StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1)) + EndIf + Case Else + If Not FileExists(@ScriptDir & '\steam_misc\tools\generate_interfaces\' & StringTrimLeft($generate_interfaces64_release, StringInStr($generate_interfaces64_release, "\", 0, -1))) Then + $generate_interfaces_exe = StringTrimLeft($generate_interfaces_release, StringInStr($generate_interfaces_release, "\", 0, -1)) + EndIf +EndSwitch + +If FileExists(@ScriptDir & '\valve_api.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\valve_api.dll.bak' & '"', @ScriptDir, @SW_HIDE) +EndIf + +If FileExists(@ScriptDir & '\steam_api.dll.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api.dll.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api_orig.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api_orig.dll' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api_legit.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api_legit.dll' & '"', @ScriptDir, @SW_HIDE) +#ElseIf FileExists(@ScriptDir & '\steam_api.dll') Then + #RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api.dll' & '"', @ScriptDir, @SW_HIDE) +EndIf + +If FileExists(@ScriptDir & '\valve_api64.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\valve_api64.dll.bak' & '"', @ScriptDir, @SW_HIDE) +EndIf + +If FileExists(@ScriptDir & '\steam_api64.dll.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64.dll.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64.bak') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.bak' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64.org') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.org' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64_orig.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe &' ' & '"' & @ScriptDir & '\steam_api64_orig.dll' & '"', @ScriptDir, @SW_HIDE) +ElseIf FileExists(@ScriptDir & '\steam_api64_legit.dll') Then + RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe &' ' & '"' & @ScriptDir & '\steam_api64_legit.dll' & '"', @ScriptDir, @SW_HIDE) +#ElseIf FileExists(@ScriptDir & '\steam_api64.dll') Then + #RunWait($generate_interfaces_dst & '\' & $generate_interfaces_exe & ' ' & '"' & @ScriptDir & '\steam_api64.dll' & '"', @ScriptDir, @SW_HIDE) +EndIf + +FileMove(@ScriptDir & '\steam_interfaces.txt', @ScriptDir & '\steam_settings\steam_interfaces.txt', 9) +FileCopy(@ScriptDir & '\steam_settings\steam_interfaces.txt', @ScriptDir & '\steam_settings\steam_interfaces.ini', 9) + +$hFile=FileOpen(@ScriptDir & '\steam_settings\steam_interfaces.ini',0) +$sOld=FileRead($hFile) +FileClose($hFile) +$hFile=FileOpen(@ScriptDir & '\steam_settings\steam_interfaces.ini',2) +$sNew='[steam_interfaces]' & @CRLF & $sOld +FileWrite($hFile,$sNew) +FileClose($hFile) + +$interfaces_ini = @ScriptDir & '\steam_settings\steam_interfaces.ini' +$codex_ini = @ScriptDir & '\steam_misc\extra_cdx\steam_emu.ini' + +If FileExists($codex_ini) Then + + _ReplaceStringInFile($interfaces_ini, 'STEAMAPPLIST_', 'SteamAppList=STEAMAPPLIST_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMAPPS_', 'SteamApps=STEAMAPPS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMAPPTICKET_', 'SteamAppTicket=STEAMAPPTICKET_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamClient', 'SteamClient=SteamClient', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamController', 'SteamController=SteamController', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamFriends', 'SteamFriends=SteamFriends', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameCoordinator', 'SteamGameCoordinator=SteamGameCoordinator', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameServerStats', 'Steam_Game_Server_Stats=Steam_Game_Server_Stats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameServer', 'SteamGameServer=SteamGameServer', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Game_Server_Stats', 'SteamGameServerStats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamGameStats', 'SteamGameStats=SteamGameStats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMHTMLSURFACE_', 'SteamHTMLSurface=STEAMHTMLSURFACE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMHTTP_', 'SteamHTTP=STEAMHTTP_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamInput', 'SteamInput=SteamInput', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMINVENTORY_', 'SteamInventory=STEAMINVENTORY_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMasterServerUpdater', 'SteamMasterServerUpdater=SteamMasterServerUpdater', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMatchGameSearch', 'SteamMatchGameSearch=SteamMatchGameSearch', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMatchMakingServers', 'Steam_Match_Making_Servers=Steam_Match_Making_Servers', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamMatchMaking', 'SteamMatchMaking=SteamMatchMaking', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Match_Making_Servers', 'SteamMatchMakingServers', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMMUSIC_', 'SteamMusic=STEAMMUSIC_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMMUSICREMOTE_', 'SteamMusicRemote=STEAMMUSICREMOTE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingMessages', 'Steam_Networking_Messages=Steam_Networking_Messages', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingSocketsSerialized', 'Steam_Networking_Sockets_Serialized=Steam_Networking_Sockets_Serialized', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingSockets', 'Steam_Networking_Sockets=Steam_Networking_Sockets', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworkingUtils', 'Steam_Networking_Utils=Steam_Networking_Utils', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamNetworking', 'SteamNetworking=SteamNetworking', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Messages', 'SteamNetworkingMessages', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Sockets_Serialized', 'SteamNetworkingSocketsSerialized', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Sockets', 'SteamNetworkingSockets', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_Networking_Utils', 'SteamNetworkingUtils', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMPARENTALSETTINGS_', 'SteamParentalSettings=STEAMPARENTALSETTINGS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamParties', 'SteamParties=SteamParties', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMREMOTEPLAY_', 'SteamRemotePlay=STEAMREMOTEPLAY_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMREMOTESTORAGE_', 'SteamRemoteStorage=STEAMREMOTESTORAGE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMSCREENSHOTS_', 'SteamScreenshots=STEAMSCREENSHOTS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMTIMELINE_', 'SteamTimeline=STEAMTIMELINE_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMTV_', 'SteamTV=STEAMTV_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMUGC_', 'SteamUGC=STEAMUGC_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMUNIFIEDMESSAGES_', 'SteamUnifiedMessages=STEAMUNIFIEDMESSAGES_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMUSERSTATS_', 'Steam_User_Stats=STEAMUSERSTATS_', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamUser', 'SteamUser=SteamUser', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'Steam_User_Stats', 'SteamUserStats', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'SteamUtils', 'SteamUtils=SteamUtils', 1, 1) + _ReplaceStringInFile($interfaces_ini, 'STEAMVIDEO_', 'SteamVideo=STEAMVIDEO_', 1, 1) + + IniWrite($codex_ini, 'Interfaces', 'SteamAppList', IniRead($interfaces_ini, 'steam_interfaces', 'SteamAppList', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamApps', IniRead($interfaces_ini, 'steam_interfaces', 'SteamApps', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamAppTicket', IniRead($interfaces_ini, 'steam_interfaces', 'SteamAppTicket', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamClient', IniRead($interfaces_ini, 'steam_interfaces', 'SteamClient', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamController', IniRead($interfaces_ini, 'steam_interfaces', 'SteamController', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamFriends', IniRead($interfaces_ini, 'steam_interfaces', 'SteamFriends', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameCoordinator', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameCoordinator', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameServerStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameServerStats', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameServer', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameServer', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamGameStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamGameStats', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamHTMLSurface', IniRead($interfaces_ini, 'steam_interfaces', 'SteamHTMLSurface', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamHTTP', IniRead($interfaces_ini, 'steam_interfaces', 'SteamHTTP', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamInput', IniRead($interfaces_ini, 'steam_interfaces', 'SteamInput', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamInventory', IniRead($interfaces_ini, 'steam_interfaces', 'SteamInventory', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMasterServerUpdater', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMasterServerUpdater', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMatchGameSearch', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchGameSearch', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMatchMakingServers', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchMakingServers', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMatchMaking', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMatchMaking', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMusic', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMusic', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamMusicRemote', IniRead($interfaces_ini, 'steam_interfaces', 'SteamMusicRemote', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingMessages', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingMessages', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingSocketsSerialized', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingSocketsSerialized', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingSockets', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingSockets', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworkingUtils', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworkingUtils', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamNetworking', IniRead($interfaces_ini, 'steam_interfaces', 'SteamNetworking', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamParentalSettings', IniRead($interfaces_ini, 'steam_interfaces', 'SteamParentalSettings', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamParties', IniRead($interfaces_ini, 'steam_interfaces', 'SteamParties', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamRemotePlay', IniRead($interfaces_ini, 'steam_interfaces', 'SteamRemotePlay', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamRemoteStorage', IniRead($interfaces_ini, 'steam_interfaces', 'SteamRemoteStorage', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamScreenshots', IniRead($interfaces_ini, 'steam_interfaces', 'SteamScreenshots', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamTimeline', IniRead($interfaces_ini, 'steam_interfaces', 'SteamTimeline', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamTV', IniRead($interfaces_ini, 'steam_interfaces', 'SteamTV', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUGC', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUGC', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUnifiedMessages', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUnifiedMessages', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUserStats', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUserStats', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUser', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUser', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamUtils', IniRead($interfaces_ini, 'steam_interfaces', 'SteamUtils', '')) + IniWrite($codex_ini, 'Interfaces', 'SteamVideo', IniRead($interfaces_ini, 'steam_interfaces', 'SteamVideo', '')) + +EndIf + +FileDelete($interfaces_ini) diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini new file mode 100644 index 00000000..42f9f825 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/generate_interfaces.ini @@ -0,0 +1,9 @@ +[ARC_NAME] + +generate_interfaces = generate_interfaces.7z + + +[EXE_PATH] + +generate_interfaces_release = generate_interfaces.exe +generate_interfaces64_release = generate_interfaces64.exe diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x new file mode 100644 index 00000000..42592c3d Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.a3x differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 new file mode 100644 index 00000000..dade2dcd --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.au3 @@ -0,0 +1,57 @@ +#NoTrayIcon + +#Region ;**** Directives created by AutoIt3Wrapper_GUI **** +#AutoIt3Wrapper_Outfile_type=a3x +#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** + +#include + +; ARC_NAME + +$arc_lobby_connect = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "ARC_NAME", "lobby_connect", "lobby_connect.7z") + +; EXE_PATH + +$lobby_connect_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "lobby_connect_release", "lobby_connect.exe") +$lobby_connect64_release = IniRead(@ScriptDir & "\" & StringTrimRight(@ScriptName, 4) & ".ini", "EXE_PATH", "lobby_connect64_release", "lobby_connect64.exe") + +$lobby_connect_7z = @ScriptDir & '\steam_misc\tools\lobby_connect\' & $arc_lobby_connect +$lobby_connect_dst = @ScriptDir & '\steam_misc\tools\lobby_connect' +$lobby_connect_exe = '' +Switch @OSArch + Case 'X64' + $lobby_connect_exe = StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1)) ; lobby_connect64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $lobby_connect_7z & '" -o"' & $lobby_connect_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case 'X86' + $lobby_connect_exe = StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1)) ; lobby_connect.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $lobby_connect_7z & '" -o"' & $lobby_connect_dst & '" -aoa', "", "", @SW_HIDE) + EndIf + Case Else + $lobby_connect_exe = StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1)) ; lobby_connect64.exe + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + ShellExecuteWait(@ScriptDir & "\steam_misc\tools\7za\7za.exe", 'x "' & $lobby_connect_7z & '" -o"' & $lobby_connect_dst & '" -aoa', "", "", @SW_HIDE) + EndIf +EndSwitch + +If Not FileExists(@ScriptDir & '\steam_api.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1))) +If Not FileExists(@ScriptDir & '\steam_api64.dll') Then FileDelete(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) + +Switch @OSArch + Case 'X64' + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + $lobby_connect_exe = StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1)) + EndIf + Case 'X86' + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1))) Then + $lobby_connect_exe = StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1)) + EndIf + Case Else + If Not FileExists(@ScriptDir & '\steam_misc\tools\lobby_connect\' & StringTrimLeft($lobby_connect64_release, StringInStr($lobby_connect64_release, "\", 0, -1))) Then + $lobby_connect_exe = StringTrimLeft($lobby_connect_release, StringInStr($lobby_connect_release, "\", 0, -1)) + EndIf +EndSwitch + +RunWait($lobby_connect_dst & '\' & $lobby_connect_exe, @ScriptDir, @SW_SHOW) \ No newline at end of file diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini new file mode 100644 index 00000000..de426c92 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/au3/scripts/lobby_connect.ini @@ -0,0 +1,9 @@ +[ARC_NAME] + +generate_interfaces = lobby_connect.7z + + +[EXE_PATH] + +lobby_connect_release = lobby_connect.exe +lobby_connect64_release = lobby_connect64.exe diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat new file mode 100644 index 00000000..150b973c --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/acw_helper.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\acw_helper.a3x .\ +copy .\steam_misc\tools\au3\scripts\acw_helper.ini .\ +ren .\acw_helper.a3x gse_acw_helper.a3x +ren .\acw_helper.ini gse_acw_helper.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript .\gse_acw_helper.a3x +del .\gse_acw_helper.a3x +del .\gse_acw_helper.ini \ No newline at end of file diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat new file mode 100644 index 00000000..47bd5cac --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/debug_switch.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\debug_switch.a3x .\ +copy .\steam_misc\tools\au3\scripts\debug_switch.ini .\ +ren .\debug_switch.a3x gse_debug_switch.a3x +ren .\debug_switch.ini gse_debug_switch.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript ".\gse_debug_switch.a3x" +del .\gse_debug_switch.a3x +del .\gse_debug_switch.ini \ No newline at end of file diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat new file mode 100644 index 00000000..de124a90 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/generate_interfaces.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\generate_interfaces.a3x .\ +copy .\steam_misc\tools\au3\scripts\generate_interfaces.ini .\ +ren .\generate_interfaces.a3x gse_generate_interfaces.a3x +ren .\generate_interfaces.ini gse_generate_interfaces.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript .\gse_generate_interfaces.a3x +del .\gse_generate_interfaces.a3x +del .\gse_generate_interfaces.ini \ No newline at end of file diff --git a/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat new file mode 100644 index 00000000..44a2ac34 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/bat/lobby_connect.bat @@ -0,0 +1,8 @@ +@echo off +copy .\steam_misc\tools\au3\scripts\lobby_connect.a3x .\ +copy .\steam_misc\tools\au3\scripts\lobby_connect.ini .\ +ren .\lobby_connect.a3x gse_lobby_connect.a3x +ren .\lobby_connect.ini gse_lobby_connect.ini +.\steam_misc\tools\au3\au3.exe /AutoIt3ExecuteScript .\gse_lobby_connect.a3x +del .\gse_lobby_connect.a3x +del .\gse_lobby_connect.ini \ No newline at end of file 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 new file mode 100644 index 00000000..f22a8221 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/generate_interfaces/generate_interfaces.7z 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 new file mode 100644 index 00000000..b915ab27 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_misc/tools/lobby_connect/lobby_connect.7z differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/account_avatar.jpg b/tools/migrate_gse/_DEFAULT/1/steam_settings/account_avatar.jpg new file mode 100644 index 00000000..aa490cb4 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/account_avatar.jpg differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/account_avatar_default.jpg b/tools/migrate_gse/_DEFAULT/1/steam_settings/account_avatar_default.jpg new file mode 100644 index 00000000..aa490cb4 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/account_avatar_default.jpg 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 new file mode 100644 index 00000000..9b0a19b7 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.app.ini @@ -0,0 +1,26 @@ +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[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 +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 +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 +unlock_all=0 +# format: ID=name +# 1234=DLCNAME +# 56789=This is another example DLC name + +[app::paths] +# format: ID=path +# 556760=../DLCRoot0 +# 1234=./folder_where_steam_api_is +# 3456=../folder_one_level_above_where_steam_api_is +# 5678=../../folder_two_levels_above_where_steam_api_is diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.main.ini b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.main.ini new file mode 100644 index 00000000..e92b7034 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.main.ini @@ -0,0 +1,80 @@ +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[main::general] +# generate new app auth ticket +new_app_ticket=1 +# generate/embed GC token inside new app ticket +gc_token=1 +# pretend the app is running on a steam deck +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 +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 +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 +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 +crash_printer_location=./EMU_CRASHES.txt + +[main::connectivity] +# prevent hooking OS networking APIs and allow any external requests +# only used by the experimental builds on Windows +disable_lan_only=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 +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 +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 +offline=0 +# prevent sharing stats and achievements with any game server, also disables the interface ISteamGameServerStats +disable_sharing_stats_with_gameserver=0 +# do not send server details to the server browser, only works for game servers +disable_source_query=0 +# enable sharing leaderboards scores with people playing the same game on the same network +share_leaderboards_over_network=0 +# prevent lobby creation in steam matchmaking interface +disable_lobby_creation=0 +# attempt to download external HTTP(S) requests made via Steam_HTTP::SendHTTPRequest() inside "steam_settings/http/" +# 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 + +############################################ +# mostly workarounds for specific problems # +############################################ + +[main::misc] +# force SetAchievement() to always return true +achievements_bypass=0 +# force the function Steam_HTTP::SendHTTPRequest() to always succeed +force_steamhttp_success=0 +# env var SteamOverlayGameId breaks Steam Input when the game is added to Steam as a non-steam game +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 +# https://developer.valvesoftware.com/wiki/Steam_Application_IDs +# https://developer.valvesoftware.com/wiki/Dedicated_Servers_List +enable_steam_preowned_ids=0 diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.overlay.ini b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.overlay.ini new file mode 100644 index 00000000..8e282a59 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.overlay.ini @@ -0,0 +1,112 @@ +# # +# USE AT YOUR OWN RISK :: This feature might cause crashes or other problems # +# # +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[overlay::general] +# enable the experimental overlay, might cause crashes +enable_experimental_overlay=1 +# 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 +disable_achievement_notification=0 +# disable friends invitations and messages notifications +disable_friend_notification=0 +# disable showing notifications for achievements progress +disable_achievement_progress=0 +# disable any warning in the overlay +disable_warning_any=0 +# disable the bad app ID warning in the overlay +disable_warning_bad_appid=0 +# disable the local_save warning in the overlay +disable_warning_local_save=0 + +[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 +Font_Size=16.0 + +# achievement icon size +Icon_Size=64.0 + +# spacing between characters +Font_Glyph_Extra_Spacing_x=1.0 +Font_Glyph_Extra_Spacing_y=0.0 + +# background for all types of notifications +Notification_R=0.12 +Notification_G=0.14 +Notification_B=0.21 +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 +Notification_Animation=0.35 + +# duration of achievement progress indication +Notification_Duration_Progress=6.0 +# duration of achievement unlocked +Notification_Duration_Achievement=6.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 +# look for the format here: https://en.cppreference.com/w/cpp/chrono/c/strftime +Achievement_Unlock_Datetime_Format=%Y/%m/%d - %H:%M:%S + +# main background when you press shift+tab +Background_R=0.12 +Background_G=0.11 +Background_B=0.11 +Background_A=0.55 + +Element_R=0.30 +Element_G=0.32 +Element_B=0.40 +Element_A=1.0 + +ElementHovered_R=0.278 +ElementHovered_G=0.393 +ElementHovered_B=0.602 +ElementHovered_A=1.0 + +ElementActive_R=-1.0 +ElementActive_G=-1.0 +ElementActive_B=-1.0 +ElementActive_A=-1.0 + +# ############################# # +# available options: +# top_left +# top_center +# top_right +# bot_left +# bot_center +# bot_right + +# position of achievements +PosAchievement=bot_right +# position of invitations +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 new file mode 100644 index 00000000..b22a1af7 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/configs.user.ini @@ -0,0 +1,26 @@ +# ################################################################################ # +# you do not have to specify everything, pick and choose the options you need only # +# ################################################################################ # + +[user::general] +# user account name +account_name=goldberg +# Steam64 format +account_steamid=76561197960287930 +# the language reported to the app/game +# look for the column 'API language code' here: https://partner.steamgames.com/doc/store/localization/languages +# default=english +language=english +# report a country IP if the game queries it +# ISO 3166-1-alpha-2 format, use this link to get the 'Alpha-2' country code: https://www.iban.com/country-codes +# default=US +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 +# 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=GSE Saves +saves_folder_name=GSE Saves diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_a.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_a.png new file mode 100644 index 00000000..4b83560f Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_a.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_b.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_b.png new file mode 100644 index 00000000..339788fc Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_b.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_x.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_x.png new file mode 100644 index 00000000..ccac01ea Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_x.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_y.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_y.png new file mode 100644 index 00000000..caa8fd0e Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/button_y.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_l.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_l.png new file mode 100644 index 00000000..0bde85e0 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_l.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_r.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_r.png new file mode 100644 index 00000000..7f17f6d0 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/shoulder_r.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_e.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_e.png new file mode 100644 index 00000000..6232a752 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_e.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_n.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_n.png new file mode 100644 index 00000000..a54222ca Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_n.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_s.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_s.png new file mode 100644 index 00000000..21974621 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_s.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_w.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_w.png new file mode 100644 index 00000000..dc07f43a Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_dpad_w.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_click.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_click.png new file mode 100644 index 00000000..237f1ed5 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_click.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_move.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_move.png new file mode 100644 index 00000000..34d2fe25 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_l_move.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_click.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_click.png new file mode 100644 index 00000000..2d76fdc7 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_click.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_move.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_move.png new file mode 100644 index 00000000..4f40b3df Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/stick_r_move.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_click.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_click.png new file mode 100644 index 00000000..1ad596f0 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_click.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_pull.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_pull.png new file mode 100644 index 00000000..1ad596f0 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_l_pull.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_click.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_click.png new file mode 100644 index 00000000..5fc0f32a Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_click.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_pull.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_pull.png new file mode 100644 index 00000000..5fc0f32a Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/trigger_r_pull.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_e.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_e.png new file mode 100644 index 00000000..b2416cd9 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_e.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_move.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_move.png new file mode 100644 index 00000000..29817da3 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_move.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_n.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_n.png new file mode 100644 index 00000000..8dab7ac7 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_n.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_s.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_s.png new file mode 100644 index 00000000..654bdb69 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_s.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_w.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_w.png new file mode 100644 index 00000000..3885e638 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_dpad_w.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_select.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_select.png new file mode 100644 index 00000000..e3fabc18 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_select.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_start.png b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_start.png new file mode 100644 index 00000000..46814629 Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/controller/glyphs/xbox_button_start.png differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/emu_version.txt b/tools/migrate_gse/_DEFAULT/1/steam_settings/emu_version.txt new file mode 100644 index 00000000..b09dd503 --- /dev/null +++ b/tools/migrate_gse/_DEFAULT/1/steam_settings/emu_version.txt @@ -0,0 +1,4 @@ +release + +you are currently using the 'release' version of the emulator +use 'gse_debug_switch.exe' if you want to use the 'debug' version \ No newline at end of file diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/fonts/Roboto-Medium.ttf b/tools/migrate_gse/_DEFAULT/1/steam_settings/fonts/Roboto-Medium.ttf new file mode 100644 index 00000000..ac0f908b Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/fonts/Roboto-Medium.ttf differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/sounds/overlay_achievement_notification.wav b/tools/migrate_gse/_DEFAULT/1/steam_settings/sounds/overlay_achievement_notification.wav new file mode 100644 index 00000000..7fbc54cb Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/sounds/overlay_achievement_notification.wav differ diff --git a/tools/migrate_gse/_DEFAULT/1/steam_settings/sounds/overlay_friend_notification.wav b/tools/migrate_gse/_DEFAULT/1/steam_settings/sounds/overlay_friend_notification.wav new file mode 100644 index 00000000..7fbc54cb Binary files /dev/null and b/tools/migrate_gse/_DEFAULT/1/steam_settings/sounds/overlay_friend_notification.wav differ diff --git a/tools/migrate_gse/bat/migrate_gse.py_ini.bat b/tools/migrate_gse/bat/migrate_gse.py_ini.bat new file mode 100644 index 00000000..994e2ebb --- /dev/null +++ b/tools/migrate_gse/bat/migrate_gse.py_ini.bat @@ -0,0 +1,4 @@ +@echo off +pip install pyinstaller +pip install configparser +pip install configobj \ No newline at end of file diff --git a/tools/migrate_gse/bat/migrate_gse.py_run.bat b/tools/migrate_gse/bat/migrate_gse.py_run.bat new file mode 100644 index 00000000..dc3754b5 --- /dev/null +++ b/tools/migrate_gse/bat/migrate_gse.py_run.bat @@ -0,0 +1,4 @@ +@echo off +set /p arg="Migrate GSE for folder: " +python -W ignore::DeprecationWarning main.py %arg% +pause \ No newline at end of file diff --git a/tools/migrate_gse/main.py b/tools/migrate_gse/main.py index f3aa484d..d595324a 100644 --- a/tools/migrate_gse/main.py +++ b/tools/migrate_gse/main.py @@ -4,7 +4,8 @@ import sys import glob import configparser import traceback - +import shutil +from configobj import ConfigObj def help(): exe_name = os.path.basename(sys.argv[0]) @@ -22,376 +23,139 @@ def help(): print(" Running the tool without any switches will make it attempt to read the global settings folder") print("") - -NEW_STEAM_SETTINGS_FOLDER = 'steam_settings' +NEW_STEAM_SETTINGS_FOLDER = os.path.join('_OUTPUT', 'steam_settings') def create_new_steam_settings_folder(): if not os.path.exists(NEW_STEAM_SETTINGS_FOLDER): os.makedirs(NEW_STEAM_SETTINGS_FOLDER) +# use CongigObj to correctly update existing 'configs.app.ini' copied from ./_DEFAULT configuration --- START, read ini +configs_app = ConfigObj(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.app.ini"), encoding='utf-8') +configs_app_initial = configs_app -def merge_dict(dest: dict, src: dict): - # merge similar keys, but don't overwrite values - for kv in src.items(): - v_dest = dest.get(kv[0], None) - if isinstance(kv[1], dict) and isinstance(v_dest, dict): - merge_dict(v_dest, kv[1]) - elif kv[0] not in dest: - dest[kv[0]] = kv[1] +# use CongigObj to correctly update existing 'configs.main.ini' copied from ./_DEFAULT configuration --- START, read ini +configs_main = ConfigObj(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.main.ini"), encoding='utf-8') +configs_main_initial = configs_main -def write_ini_file(base_path: str, out_ini: dict): - for file in out_ini.items(): - with open(os.path.join(base_path, file[0]), 'wt', encoding='utf-8') as f: - for item in file[1].items(): - f.write('[' + str(item[0]) + ']\n') # section - for kv in item[1].items(): - if kv[1][1]: # comment - f.write('# ' + str(kv[1][1]) + '\n') - f.write(str(kv[0]) + '=' + str(kv[1][0]) + '\n') # key/value pair - f.write('\n') +# use CongigObj to correctly update existing 'configs.overlay.ini' copied from ./_DEFAULT configuration --- START, read ini +configs_overlay = ConfigObj(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.overlay.ini"), encoding='utf-8') +configs_overlay_initial = configs_overlay -def convert_to_ini(global_settings: str, out_dict_ini: dict): - # oh no, they're too many! +# use CongigObj to correctly update existing 'configs.user.ini' copied from ./_DEFAULT configuration --- START, read ini +configs_user = ConfigObj(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.user.ini"), encoding='utf-8') +configs_user_initial = configs_user + +def convert_to_ini(global_settings: str): + # oh no, they're too many! --- they are indeed... it is way simpler to use ConfigObj to properly update the default ini files for file in glob.glob('*.*', root_dir=global_settings): file = file.lower() - if file == 'force_account_name.txt' or file == 'account_name.txt': + if file == 'steam_appid.txt': + steam_appid = fr.readline().strip('\n').strip('\r') + elif file == 'force_account_name.txt' or file == 'account_name.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.user.ini': { - 'user::general': { - 'account_name': (fr.readline().strip('\n').strip('\r'), 'user account name'), - }, - } - }) + configs_user["user::general"]["account_name"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'force_branch_name.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.app.ini': { - 'app::general': { - 'branch_name': (fr.readline().strip(), 'the name of the beta branch'), - }, - } - }) + configs_app["app::general"]["branch_name"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'force_language.txt' or file == 'language.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.user.ini': { - 'user::general': { - 'language': (fr.readline().strip(), 'the language reported to the app/game, https://partner.steamgames.com/doc/store/localization/languages'), - }, - } - }) + configs_user["user::general"]["language"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'force_listen_port.txt' or file == 'listen_port.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'listen_port': (fr.readline().strip(), 'change the UDP/TCP port the emulator listens on'), - }, - } - }) + configs_main["main::connectivity"]["listen_port"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'force_steamid.txt' or file == 'user_steam_id.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.user.ini': { - 'user::general': { - 'account_steamid': (fr.readline().strip(), 'Steam64 format'), - }, - } - }) + configs_user["user::general"]["account_steamid"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'ip_country.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.user.ini': { - 'user::general': { - 'ip_country': (fr.readline().strip(), 'report a country IP if the game queries it, https://www.iban.com/country-codes'), - }, - } - }) + configs_user["user::general"]["ip_country"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'overlay_appearance.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: ov_lines = [lll.strip() for lll in fr.readlines() if lll.strip() and lll.strip()[0] != ';' and lll.strip()[0] != '#'] for ovl in ov_lines: [ov_name, ov_val] = ovl.split(' ', 1) - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::appearance': { - ov_name.strip(): (ov_val.strip(), ''), - }, - } - }) - elif file == 'build_id.txt': - with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.app.ini': { - 'app::general': { - 'build_id': (fr.readline().strip(), 'allow the app/game to show the correct build id'), - }, - } - }) + configs_overlay["overlay::appearance"][ov_name.strip()] = ov_val.strip() #updated ini through ConfigObj + # NOTE generating 'branches.json' would require copy pasting some code from 'generate_config_emu.py' + # if possible, avoid using 'migrate_gse' alltogether, and use 'generate_emu_config' instead + #elif file == 'build_id.txt': + #with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: + #configs_app["app::general"]["build_id"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'disable_account_avatar.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'enable_account_avatar': (0, 'enable avatar functionality'), - }, - } - }) + configs_main["main::general"]["enable_account_avatar"] = 0 #updated ini through ConfigObj elif file == 'disable_networking.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'disable_networking': (1, 'disable all steam networking interface functionality'), - }, - } - }) + configs_main["main::connectivity"]["disable_networking"] = 1 #updated ini through ConfigObj elif file == 'disable_sharing_stats_with_gameserver.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'disable_sharing_stats_with_gameserver': (1, 'prevent sharing stats and achievements with any game server, this also disables the interface ISteamGameServerStats'), - }, - } - }) + configs_main["main::connectivity"]["disable_sharing_stats_with_gameserver"] = 1 #updated ini through ConfigObj elif file == 'disable_source_query.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'disable_source_query': (1, 'do not send server details to the server browser, only works for game servers'), - }, - } - }) + configs_main["main::connectivity"]["disable_source_query"] = 1 #updated ini through ConfigObj elif file == 'overlay_hook_delay_sec.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'hook_delay_sec': (fr.readline().strip(), 'amount of time to wait before attempting to detect and hook the renderer'), - }, - } - }) + configs_overlay["overlay::general"]["hook_delay_sec"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'overlay_renderer_detector_timeout_sec.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'renderer_detector_timeout_sec': (fr.readline().strip(), 'timeout for the renderer detector'), - }, - } - }) + configs_overlay["overlay::general"]["renderer_detector_timeout_sec"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'enable_experimental_overlay.txt' or file == 'disable_overlay.txt': enable_ovl = 0 if file == 'enable_experimental_overlay.txt': enable_ovl = 1 - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'enable_experimental_overlay': (enable_ovl, 'XXX USE AT YOUR OWN RISK XXX, enable the experimental overlay, might cause crashes'), - }, - } - }) + configs_overlay["overlay::general"]["enable_experimental_overlay"] = enable_ovl #updated ini through ConfigObj elif file == 'app_paths.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: app_lines = [lll.strip('\n').strip('\r') for lll in fr.readlines() if lll.strip() and lll.strip()[0] != '#'] for app_lll in app_lines: - [apppid, appppath] = app_lll.split('=', 1) - merge_dict(out_dict_ini, { - 'configs.app.ini': { - 'app::paths': { - apppid.strip(): (appppath, ''), - }, - } - }) + [appid, apppath] = app_lll.split('=', 1) + configs_app["app::paths"][appid.strip()] = apppath #updated ini through ConfigObj elif file == 'dlc.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: dlc_lines = [lll.strip('\n').strip('\r') for lll in fr.readlines() if lll.strip() and lll.strip()[0] != '#'] - merge_dict(out_dict_ini, { - 'configs.app.ini': { - 'app::dlcs': { - 'unlock_all': (0, 'should the emu report all DLCs as unlocked, default=1'), - }, - } - }) + configs_app["app::dlcs"]["unlock_all"] = 0 #updated ini through ConfigObj for dlc_lll in dlc_lines: [dlcid, dlcname] = dlc_lll.split('=', 1) - merge_dict(out_dict_ini, { - 'configs.app.ini': { - 'app::dlcs': { - dlcid.strip(): (dlcname, ''), - }, - } - }) + configs_app["app::dlcs"][dlcid.strip()] = dlcname #updated ini through ConfigObj elif file == 'achievements_bypass.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::misc': { - 'achievements_bypass': (1, 'force SetAchievement() to always return true'), - }, - } - }) + configs_main["main::misc"]["achievements_bypass"] = 1 #updated ini through ConfigObj elif file == 'crash_printer_location.txt': with open(os.path.join(global_settings, file), "r", encoding='utf-8') as fr: - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'crash_printer_location': (fr.readline().strip('\n').strip('\r'), 'this is intended to debug some annoying scenarios, and best used with the debug build'), - }, - } - }) + configs_main["main::general"]["crash_printer_location"] = fr.readline().strip('\n').strip('\r') #updated ini through ConfigObj elif file == 'disable_lan_only.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'disable_lan_only': (1, 'prevent hooking OS networking APIs and allow any external requests'), - }, - } - }) + configs_main["main::connectivity"]["disable_lan_only"] = 1 #updated ini through ConfigObj elif file == 'disable_leaderboards_create_unknown.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'disable_leaderboards_create_unknown': (1, 'prevent Steam_User_Stats::FindLeaderboard() from always succeeding and creating the unknown leaderboard'), - }, - } - }) + configs_main["main::general"]["disable_leaderboards_create_unknown"] = 1 #updated ini through ConfigObj elif file == 'disable_lobby_creation.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'disable_lobby_creation': (1, 'prevent lobby creation in steam matchmaking interface'), - }, - } - }) + configs_main["main::connectivity"]["disable_lobby_creation"] = 1 #updated ini through ConfigObj elif file == 'disable_overlay_achievement_notification.txt': - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'disable_achievement_notification': (1, 'disable the achievements notifications'), - }, - } - }) + configs_overlay["overlay::general"]["disable_achievement_notification"] = 1 #updated ini through ConfigObj elif file == 'disable_overlay_friend_notification.txt': - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'disable_friend_notification': (1, 'disable friends invitations and messages notifications'), - }, - } - }) + configs_overlay["overlay::general"]["disable_friend_notification"] = 1 #updated ini through ConfigObj elif file == 'disable_overlay_warning_any.txt': - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'disable_warning_any': (1, 'disable any warning in the overlay'), - }, - } - }) + configs_overlay["overlay::general"]["disable_warning_any"] = 1 #updated ini through ConfigObj elif file == 'disable_overlay_warning_bad_appid.txt': - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'disable_warning_bad_appid': (1, 'disable the bad app ID warning in the overlay'), - }, - } - }) + configs_overlay["overlay::general"]["disable_warning_bad_appid"] = 1 #updated ini through ConfigObj elif file == 'disable_overlay_warning_local_save.txt': - merge_dict(out_dict_ini, { - 'configs.overlay.ini': { - 'overlay::general': { - 'disable_warning_local_save': (1, 'disable the local_save warning in the overlay'), - }, - } - }) + configs_overlay["overlay::general"]["disable_warning_local_save"] = 1 #updated ini through ConfigObj elif file == 'download_steamhttp_requests.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'download_steamhttp_requests': (1, 'attempt to download external HTTP(S) requests made via Steam_HTTP::SendHTTPRequest()'), - }, - } - }) + configs_main["main::connectivity"]["download_steamhttp_requests"] = 1 #updated ini through ConfigObj elif file == 'force_steamhttp_success.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::misc': { - 'force_steamhttp_success': (1, 'force the function Steam_HTTP::SendHTTPRequest() to always succeed'), - }, - } - }) + configs_main["main::misc"]["force_steamhttp_success"] = 1 #updated ini through ConfigObj elif file == 'new_app_ticket.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'new_app_ticket': (1, 'generate new app auth ticket'), - }, - } - }) + configs_main["main::general"]["new_app_ticket"] = 1 #updated ini through ConfigObj elif file == 'gc_token.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'gc_token': (1, 'generate/embed GC token inside new App Ticket'), - }, - } - }) + configs_main["main::general"]["gc_token"] = 1 #updated ini through ConfigObj elif file == 'immediate_gameserver_stats.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'immediate_gameserver_stats': (1, 'synchronize user stats/achievements with game servers as soon as possible instead of caching them'), - }, - } - }) + configs_main["main::general"]["immediate_gameserver_stats"] = 1 #updated ini through ConfigObj elif file == 'is_beta_branch.txt': - merge_dict(out_dict_ini, { - 'configs.app.ini': { - 'app::general': { - 'is_beta_branch': (1, 'make the game/app think we are playing on a beta branch'), - }, - } - }) + configs_main["main::general"]["is_beta_branch"] = 1 #updated ini through ConfigObj elif file == 'matchmaking_server_details_via_source_query.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'matchmaking_server_details_via_source_query': (1, 'grab the server details for match making using an actual server query'), - }, - } - }) + configs_main["main::general"]["matchmaking_server_details_via_source_query"] = 1 #updated ini through ConfigObj elif file == 'matchmaking_server_list_actual_type.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'matchmaking_server_list_actual_type': (1, 'use the proper type of the server list (internet, friends, etc...) when requested by the game'), - }, - } - }) + configs_main["main::general"]["matchmaking_server_list_actual_type"] = 1 #updated ini through ConfigObj elif file == 'offline.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'offline': (1, 'pretend steam is running in offline mode'), - }, - } - }) + configs_main["main::connectivity"]["offline"] = 1 #updated ini through ConfigObj elif file == 'share_leaderboards_over_network.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::connectivity': { - 'share_leaderboards_over_network': (1, 'enable sharing leaderboards scores with people playing the same game on the same network'), - }, - } - }) + configs_main["main::connectivity"]["share_leaderboards_over_network"] = 1 #updated ini through ConfigObj elif file == 'steam_deck.txt': - merge_dict(out_dict_ini, { - 'configs.main.ini': { - 'main::general': { - 'steam_deck': (1, 'pretend the app is running on a steam deck'), - }, - } - }) - - + configs_main["main::general"]["steam_deck"] = 1 #updated ini through ConfigObj + def write_txt_file(filename: str, dict_ini: dict, section: str, key: str): val = dict_ini.get(section, {}).get(key, None) if val is None: @@ -433,9 +197,8 @@ def write_txt_file_multi(filename: str, dict_ini: dict, section: str): return True - def convert_to_txt(global_settings: str): - # oh no, they're too many! + # oh no, they're too many! --- they are indeed... it seems ConfigParser does the job here config = configparser.ConfigParser(strict=False, empty_lines_in_values=False) for file in glob.glob('*.ini*', root_dir=global_settings): config.read(os.path.join(global_settings, file), encoding='utf-8') @@ -447,7 +210,9 @@ def convert_to_txt(global_settings: str): done = 0 done += write_txt_file_bool('achievements_bypass.txt', dict_ini, 'main::misc', 'achievements_bypass', True) done += write_txt_file_multi('app_paths.txt', dict_ini, 'app::paths') - done += write_txt_file('build_id.txt', dict_ini, 'app::general', 'build_id') + # NOTE generating 'branches.json' would require copy pasting some code from 'generate_config_emu.py' + # if possible, avoid using 'migrate_gse' alltogether, and use 'generate_emu_config' instead + #done += write_txt_file('build_id.txt', dict_ini, 'app::general', 'build_id') # disabled after 'branches.json' update done += write_txt_file('crash_printer_location.txt', dict_ini, 'main::general', 'crash_printer_location') done += write_txt_file_bool('disable_account_avatar.txt', dict_ini, 'main::general', 'enable_account_avatar', False) done += write_txt_file_bool('disable_lan_only.txt', dict_ini, 'main::connectivity', 'disable_lan_only',True) @@ -517,16 +282,16 @@ def main(): if is_windows: appdata = os.getenv('APPDATA') if appdata: - global_settings = os.path.join(appdata, 'Goldberg SteamEmu Saves', 'settings') + global_settings = os.path.join(appdata, 'GSE Saves', 'settings') else: xdg = os.getenv('XDG_DATA_HOME') if xdg: - global_settings = os.path.join(xdg, 'Goldberg SteamEmu Saves', 'settings') + global_settings = os.path.join(xdg, 'GSE Saves', 'settings') if not global_settings: home_env = os.getenv('HOME') if home_env: - global_settings = os.path.join(home_env, 'Goldberg SteamEmu Saves', 'settings') + global_settings = os.path.join(home_env, 'GSE Saves', 'settings') if not global_settings or not os.path.isdir(global_settings): print('failed to detect folder', file=sys.stderr) @@ -536,12 +301,44 @@ def main(): print(f'searching inside the folder: "{global_settings}"') if CONVERT_TO_INI: - out_dict_ini = {} - convert_to_ini(global_settings, out_dict_ini) + shutil.copytree(os.path.join("_DEFAULT", str(0)), "_OUTPUT", dirs_exist_ok=True) # copy from ./_DEFAULT/0 dir + shutil.copytree(os.path.join("_DEFAULT", str(1)), "_OUTPUT", dirs_exist_ok=True) # copy from ./_DEFAULT/1 dir + convert_to_ini(global_settings) - if out_dict_ini: + if convert_to_ini(global_settings): create_new_steam_settings_folder() - write_ini_file(NEW_STEAM_SETTINGS_FOLDER, out_dict_ini) + configs_app.write() # use CongigObj to correctly update existing 'configs.app.ini' copied from ./_DEFAULT configuration --- END, write ini + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.app.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.app.ini"), 'w') as file: + file.write(filedata) + configs_main.write() # use CongigObj to correctly update existing 'configs.main.ini' copied from ./_DEFAULT configuration --- END, write ini + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.main.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.main.ini"), 'w') as file: + file.write(filedata) + configs_overlay.write() # use CongigObj to correctly update existing 'configs.overlay.ini' copied from ./_DEFAULT configuration --- END, write ini + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.overlay.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.overlay.ini"), 'w') as file: + file.write(filedata) + configs_user.write() # use CongigObj to correctly update existing 'configs.user.ini' copied from ./_DEFAULT configuration --- END, write ini + # ConfigObj overrides the default ini format, adding spaces before and after '=' and '""' for empty keys, so we'll use this to undo the changes + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.user.ini"), 'r') as file: + filedata = file.read() + filedata = filedata.replace(' = ""', '=') + filedata = filedata.replace(' = ', '=') + with open(os.path.join(NEW_STEAM_SETTINGS_FOLDER, "configs.user.ini"), 'w') as file: + file.write(filedata) print(f'new settings written inside: "{os.path.join(os.path.curdir, NEW_STEAM_SETTINGS_FOLDER)}"') else: print('nothing found!', file=sys.stderr) diff --git a/tools/migrate_gse/migrate_gse.py_ini.cfg b/tools/migrate_gse/migrate_gse.py_ini.cfg new file mode 100644 index 00000000..0218a852 --- /dev/null +++ b/tools/migrate_gse/migrate_gse.py_ini.cfg @@ -0,0 +1,171 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1 - for RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, 4, 5, DO NOTE that if your .BAT/.CMD/.PS1 file ends with 'pause' and/or you have '& pause'(CMD)/'; pause'(PS) at the end of CommandLine, it is recommended you use CommandWindowMode 2, so that CMD/PS process will close after 'Press any key to continue' +# ... If you wish to run your .BAT/.CMD/.PS1 file or command silent and hidden (with CommandWindowMode 2 and WindowState 0), make sure to remove 'pause' from your .BAT/.CMD/.PS1 file and/or at the end of CommandLine, otherwise CMD/PS process will fail to close automatically +CommandLine=.\bat\migrate_gse.py_ini.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Keep window opened after executing commands (same as 'CMD /K') - try to avoid this, instead use 'pause' at the end of script or CommandLine, otherwise CMD/PS process will close only with 'exit' command +# 2 - Close window after executing commands (same as 'CMD /C') - try to always use this, with 'pause' at the end of script or CommandLine, so that CMD/PS process will close after 'Press any key to continue', or close automatically if no 'pause' at the end +# DO NOTE that CommandWindowMode 1 is not the same as your .BAT/.CMD/.PS1 file ending with 'pause' and/or having '& pause'(CMD)/'; pause'(PS) at the end of CommandLine +# ... With CommandWindowMode 1 and no 'pause' at the end, CMD/PS window will show current directory and terminate only with 'exit' command +# ... With CommandWindowMode 2 and 'pause' at the end, CMD/PS window will show 'Press any key to continue' and terminate on any key press +CommandWindowMode=1 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/migrate_gse/migrate_gse.py_ini.exe b/tools/migrate_gse/migrate_gse.py_ini.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/migrate_gse/migrate_gse.py_ini.exe differ diff --git a/tools/migrate_gse/migrate_gse.py_run.cfg b/tools/migrate_gse/migrate_gse.py_run.cfg new file mode 100644 index 00000000..6c44e0c6 --- /dev/null +++ b/tools/migrate_gse/migrate_gse.py_run.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\bat\migrate_gse.py_run.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/migrate_gse/migrate_gse.py_run.exe b/tools/migrate_gse/migrate_gse.py_run.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/migrate_gse/migrate_gse.py_run.exe differ diff --git a/tools/migrate_gse/post_build/bat/migrate_gse.exe_run.bat b/tools/migrate_gse/post_build/bat/migrate_gse.exe_run.bat new file mode 100644 index 00000000..84366a3d --- /dev/null +++ b/tools/migrate_gse/post_build/bat/migrate_gse.exe_run.bat @@ -0,0 +1,4 @@ +@echo off +set /p arg="Migrate GSE for folder: " +migrate_gse.exe %arg% +pause \ No newline at end of file diff --git a/tools/migrate_gse/post_build/migrate_gse.exe_run.cfg b/tools/migrate_gse/post_build/migrate_gse.exe_run.cfg new file mode 100644 index 00000000..9537ab1b --- /dev/null +++ b/tools/migrate_gse/post_build/migrate_gse.exe_run.cfg @@ -0,0 +1,167 @@ +[General] + +# 0 - Show Advanced Run window +# 1 - Skip Advanced Run window +AutoRun=1 + +# + +# 1 - Run .EXE File +# 2 - ShellExecute - Open the specified file, folder or URL with the default program +# 3 - Command Prompt - Execute command or batch file of Windows Command Prompt (.BAT, .CMD) +# 4 - PowerShell Command - Execute the specified PowerShell command +# 5 - PowerShell Script File - Run the specified PowerShell script (.PS1) +RunMode=3 + +# open, edit, explore, print - only for RunMode 2 +ShellExecuteAction=open + +# Program to Run - only for RunMode 1. For RunMode 2, 3, 4, 5 use CommandLine +EXEFilename= + +# Command-line arguments, file to ShellExecute, Command Prompt / PowerShell file to run or Command Prompt / PowerShell command string to execute +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandLine=.\bat\migrate_gse.exe_run.bat & pause + +# Start Directory - make sure any paths in CommandLine are relative to the start directory +StartDirectory=.\ + +# AdvancedRun process will wait in the background until the process executed by AdvancedRun is terminated, 0 - disabled, 1 -enabled +WaitProcess=1 + +# Process Priority Class: +# 64 - low, 32 - normal, 128 - high, 256 - realtime, 16384 - below normal, 32768 - above normal +PriorityClass=32 + +# Command Window Mode - only for RunMode 3, 4, 5 +# 1 - Leave window opened after executing commands (same as 'CMD /K'), 2 - Close window after executing commands (same as 'CMD /C') - only for RunMode 3, 4, 5 +# For RunMode 3, DO NOTE that if your .BAT file ends with 'pause' or you add '& pause' at the end of CommandLine, CommandWindowMode 2 will have no effect - CMD window will show 'Press any key to continue . . .' +CommandWindowMode=2 + +# Main window state +# 0 - hidden, 1 - normal, 2 - minimized, 3 - maximized +WindowState=1 + +# Main window position +UseWindowPosition=0 +WindowPosition=20,20 + +# Main window size +UseWindowSize=0 +WindowSize=640,400 + +# + +# 1 - Current User - Allow UAC Elevation +# 2 - Current User - Without UAC Elevation +# 3 - Administrator (Force UAC Elevation) +# 4 - SYSTEM User +# 5 - User of the selected process +# 6 - Child of the selected process (Using code injection) +# 7 - Specified username and password +# 8 - TrustedInstaller +# 9 - Another logged-in user +# 10 - Network Service +# 11 - Local Service +RunAs=1 + +# Selected process name - only for RunAs 5, 6 +RunAsProcessName= + +# Specified username - only for RunAs 7, 9 (password can't be set in this .CFG file, so it's better to run with /RunAsUserName "username" /RunAsPassword "password" parameters instead) +RunAsUserName= + +# Specified domain - only for RunAs 7 +RunAsDomain= + +# + +# Run on remote computer with temporary Windows service, 0 - disabled, 1 - enabled +RunFromService=0 + +# Remote computer name - only for RunFromService 1 +ComputerName= + +# + +# Use search path to find the program location if the full path is not specified, 0 - disabled, 1 - enabled +UseSearchPath=0 + +# Parse the environment variables inside the command-line string before passing it to the program +ParseVarCommandLine=0 + +# + +# Use process affinity mask, 0 - disabled, 1 - enabled +UseAffinityMask=0 + +# Set process affinity mask (space-delimited list) - e.g. '0 1 2 3' process runs only on first 4 cores +AffinityMask=0 1 + +# + +# 0 - Compatibility mode disabled +# 1 - Windows 95 +# 2 - Windows 98 +# 3 - Windows NT 4.0 SP5 +# 4 - Windows 2000 +# 5 - Windows XP SP2 +# 6 - Windows XP SP3 +# 7 - Server 2003 SP1 +# 8 - Server 2008 SP1 +# 9 - Vista +# 10 - Vista SP1 +# 11 - Vista SP2 +# 12 - Windows 7 +# 13 - Windows 8 +OSCompatMode=0 + +# Use 1 to disable visual themes +CompatDisableVisualThemes=0 + +# Use 1 to disable desktop composition +CompatDisableDesktopComp=0 + +# Use 1 to run in 640 x 480 resolution +Compat640480=0 + +# Use 1 to disable full screen optimizations +CompatDisableFullScreenOpt=0 + +# 0 - Reduced colors disabled +# 1 - 8-bit, 256 colors +# 2 - 16-bit, 65536 colors +CompatColors=0 + +# 0 - High DPI scaling override disabled +# 1 - Application +# 2 - System +# 3 - System Enhanced +CompatHighDPI=0 + +# 1 - Use current system environment variables without any change +# 2 - Merge the following environment variables with the system variables +# 3 - Use only the following environment variables (ignore the system variables) +EnvironmentVariablesMode=1 + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF D5 03 00 00 4B 04 00 00 A2 08 00 00 FC 07 00 00 + +[EnvironmentVariables] + +# Advanced Run window position - only for AutoRun 0 +WinPos=2C 00 00 00 00 00 00 00 01 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 78 03 00 00 FC 02 00 00 45 08 00 00 AD 06 00 00 + +# Number of environment variables to merge - only for EnvironmentVariablesMode 2, 3 +Lines=0 + +# Merge the following environment variables, one by one on each line +Line1= +Line2= +Line3= +Line4= +Line5= +Line6= +Line7= +Line8= +Line9= diff --git a/tools/migrate_gse/post_build/migrate_gse.exe_run.exe b/tools/migrate_gse/post_build/migrate_gse.exe_run.exe new file mode 100644 index 00000000..c6d71fad Binary files /dev/null and b/tools/migrate_gse/post_build/migrate_gse.exe_run.exe differ diff --git a/tools/migrate_gse/rebuild_win.bat b/tools/migrate_gse/rebuild_win.bat index d8df6fd1..63719784 100644 --- a/tools/migrate_gse/rebuild_win.bat +++ b/tools/migrate_gse/rebuild_win.bat @@ -36,6 +36,9 @@ pyinstaller "main.py" --distpath "%out_dir%" -y --clean --onedir --name "migrate ) call "%signer_tool%" "%out_dir%\migrate_gse\migrate_gse.exe" +xcopy /s /y /e "post_build" "%out_dir%\migrate_gse\" +xcopy /s /y /e "_DEFAULT" "%out_dir%\migrate_gse\_DEFAULT" + copy /y README.md "%out_dir%\migrate_gse\" echo: diff --git a/tools/migrate_gse/requirements.txt b/tools/migrate_gse/requirements.txt index ef376ca8..43730154 100644 --- a/tools/migrate_gse/requirements.txt +++ b/tools/migrate_gse/requirements.txt @@ -1 +1,3 @@ pyinstaller +configparser +configobj diff --git a/tools/steamclient_loader/linux/README.md b/tools/steamclient_loader/linux/README.md index 8f82bb63..71610874 100644 --- a/tools/steamclient_loader/linux/README.md +++ b/tools/steamclient_loader/linux/README.md @@ -1,20 +1,23 @@ ->## How to use it: -Copy both files +## How to use it: + +Copy both files + - `steamclient.so` - `steamclient64.so` -beside the script and specify the requird input, either from commdnline or via the configuration files: `ldr_*.txt` +beside the script and specify the required input, either from command-line or via the configuration files: `ldr_*.txt` It is recommended to create a separate setup for each game via the config files -to avoid specifying the commandline each time. +to avoid specifying the command-line each time Command line arguments will override the values in the configuration files, with an exception for the arguments passed to the executable, both specified -in the cofiguration file and via command line will be passed to the executable. +in the configuration file and via command line will be passed to the executable --- ->## Command line arguments: +## Command line arguments: + * `-exe`: path to the executable * `-appid`: numeric app ID * `-cwd`: *`(optional)`* working directory to switch to when running the executable @@ -35,13 +38,15 @@ in the cofiguration file and via command line will be passed to the executable. --- ->## Configuraion files: +## Configuration files: + Additionally, you can set these values in the equivalent configuration files, everything on a single line for each file, except `ldr_cmd.txt`: + * `ldr_exe.txt`: specify the executable path in this file * `ldr_appid.txt`: specify the app ID in this file * `ldr_cwd.txt`: *`(optional)`* specify the working directory of the executable path in this file * `ldr_steam_rt.txt`: *`(optional)`* specify the path of the Steam runtime script in this file -* `ldr_cmd.txt`: *`(optional)`* specify aditional arguments that will be passed to the executable in this file, +* `ldr_cmd.txt`: *`(optional)`* specify additional arguments that will be passed to the executable in this file, this file has the exception that the arguments must be specified on separate lines