Skip to content

Commit

Permalink
Separate all tools into standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
MolotovCherry committed Nov 11, 2024
1 parent 93ab597 commit 06ed788
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 112 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,22 +90,34 @@ jobs:
- name: Create staging folders
if: github.event_name == 'release' || inputs.release
run: |
New-Item -ItemType Directory -Force -Path bin
New-Item -ItemType Directory -Force -Path debug
New-Item -ItemType Directory -Force -Path _staging-watcher/bin
New-Item -ItemType Directory -Force -Path _staging-injector/bin
New-Item -ItemType Directory -Force -Path _staging-autostarter/bin
New-Item -ItemType Directory -Force -Path _staging-debug
- name: Zip files up
if: github.event_name == 'release' || inputs.release
run: |
# release assets
Get-ChildItem -Path target/*/*.exe,target/*/*.dll,assets/* | Copy-Item -Destination "bin"
Compress-Archive -Path "bin" -CompressionLevel Optimal -DestinationPath "yet-another-bg3-native-mod-loader-x64.zip"
Get-ChildItem -Path "bin" -Recurse | Remove-Item -Force
# watcher
Get-ChildItem -Path target/*/*watcher.exe,target/*/loader.dll,assets/*,assets-watcher/* | Copy-Item -Destination "_staging-watcher/bin"
Compress-Archive -Path "_staging-watcher" -CompressionLevel Optimal -DestinationPath "yet-another-bg3-native-mod-loader-watcher-x64.zip"
Get-ChildItem -Path "_staging-watcher" -Recurse | Remove-Item -Force
# injector
Get-ChildItem -Path target/*/*injector.exe,target/*/loader.dll,assets/*,assets-injector/* | Copy-Item -Destination "_staging-injector/bin"
Compress-Archive -Path "_staging-injector" -CompressionLevel Optimal -DestinationPath "yet-another-bg3-native-mod-loader-injector-x64.zip"
Get-ChildItem -Path "_staging-injector" -Recurse | Remove-Item -Force
# autostart
Get-ChildItem -Path target/*/*autostart*.exe,target/*/loader.dll,assets/*,assets-autostart/* | Copy-Item -Destination "_staging-autostart/bin"
Compress-Archive -Path "_staging-autostart" -CompressionLevel Optimal -DestinationPath "yet-another-bg3-native-mod-loader-autostart-x64.zip"
Get-ChildItem -Path "_staging-autostart" -Recurse | Remove-Item -Force
# debug symbols
Get-ChildItem -Path target/*/*.pdb,assets-dbg/* | Copy-Item -Destination "debug"
$files = Get-ChildItem -Path debug/*
Get-ChildItem -Path target/*/*.pdb,assets-dbg/* | Copy-Item -Destination "_staging-debug"
$files = Get-ChildItem -Path _staging-debug/*
Compress-Archive -CompressionLevel Optimal -Path $files.FullName -DestinationPath "yet-another-bg3-native-mod-loader-dbg-symbols-x64.zip"
Get-ChildItem -Path "debug" -Recurse | Remove-Item -Force
Get-ChildItem -Path "_staging-debug" -Recurse | Remove-Item -Force
- name: Attach assets to release
if: github.event_name == 'release' || inputs.release
Expand Down
68 changes: 68 additions & 0 deletions assets-autostarter/INSTRUCTIONS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
_____ _ _ _
|_ _| | | | | (_)
| | _ __ ___| |_ _ __ _ _ ___| |_ _ ___ _ __ ___
| || '_ \/ __| __| '__| | | |/ __| __| |/ _ \| '_ \/ __|
_| || | | \__ \ |_| | | |_| | (__| |_| | (_) | | | \__ \
\___/_| |_|___/\__|_| \__,_|\___|\__|_|\___/|_| |_|___/
----------------------------------------------------------

Place bg3_autostart.exe and loader.dll wherever you want. Keep all these files together, including loader.dll.

bg3_autostart.exe automatically patches the game. It does not need to be manually run;
it starts when the game starts, and stops when the game stops. Just like Native Mod Loader, it is seamless.
This does however require extra registry edits to accomplish.

The benefit of this tool is that it doesn't require manual starting. The downside is it requires installation,
and it is more work to disable it if you don't want plugins running (since that requires you to uninstall it).

To install this tool, run install.bat, and to uninstall run uninstall.bat.

Once you install, you must not move the exe. If you wish to move it, uninstall, move the tool, then reinstall it.

Please also note that the registry entries point at the current bg3_autostart.exe location. If this file is in your
windows user folder and another windows user tries to launch the game, they may not have access to the exe in your
windows user folder (since it's another windows user's files). If multiple windows users play this game, you should
instead place this exe at a location accessible by all windows users to avoid this problem.

Also, if you delete the tools, make sure to uninstall it!

The two registry entries added/removed are. You may also remove these manually if you wish.
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bg3.exe
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\bg3_dx11.exe

____ _
/ ___|| |_ ___ _ __ ___
\___ \| __/ _ \ '_ \/ __|
___) | || __/ |_) \__ \
|____/ \__\___| .__/|___/
|_|
--------------------------

The first time you run a tool, it will:
- Generate a config.toml for you
- Check the `config.toml` file inside `C:\Users\<user>\AppData\Local\Larian Studios\Baldur's Gate 3\Plugins`
- If the game was installed to a non-standard path, you must adjust this path to correct it.
It needs to point to the game's root installation directory.
E.g. `C:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3`
- If the tools are placed in <bg3_root>/bin or <bg3_root>/bin/subfolder, they will detect the install root
automatically, and install_root in config.toml won't require configuring.
- Place any dll plugins you have inside `C:\Users\<user>\AppData\Local\Larian Studios\Baldur's Gate 3\Plugins`
- Remember, all NativeModLoader plugins are compatible!

Using:
1. Run your game as normal. It will automatically be patched.

If you wish to disable a mod, add an entry without extension to the `disabled` key
- For example, if you have `FooBar.dll` and `FooBaz.dll` plugins, the entry looks like:
disabled = ["FooBar", "FooBaz"]
- If you wish to disable all plugins, uninstall autostart tool, uninstall it,
and then start the game normally as you always do.

Source code: https://github.com/MolotovCherry/Yet-Another-BG3-Native-Mod-Loader

Disclaimer:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
File renamed without changes.
File renamed without changes.
63 changes: 63 additions & 0 deletions assets-injector/INSTRUCTIONS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
_____ _ _ _
|_ _| | | | | (_)
| | _ __ ___| |_ _ __ _ _ ___| |_ _ ___ _ __ ___
| || '_ \/ __| __| '__| | | |/ __| __| |/ _ \| '_ \/ __|
_| || | | \__ \ |_| | | |_| | (__| |_| | (_) | | | \__ \
\___/_| |_|___/\__|_| \__,_|\___|\__|_|\___/|_| |_|___/
----------------------------------------------------------

Place bg3_injector.exe and loader.dll wherever you want, maybe create a shortcut to it.
Keep all these files together, including loader.dll.

bg3_injector.exe is a simpler, one-time use tool, which finds any instance of the game that's already
running (vulkan or dx11), and injects the plugins into it at runtime. The purpose of this
tool is to be an alternative to bg3_watcher; for those people who don't want a tool always
running in the background.

The benefit of this tool is that it doesn't require installation, and if you don't want plugins
running, just don't start the tool. The downside is it requires manual running.

Please use it BEFORE loading a save. Plugins expect that they are run on the game process startup,
so please run it as soon as possible.

____ _
/ ___|| |_ ___ _ __ ___
\___ \| __/ _ \ '_ \/ __|
___) | || __/ |_) \__ \
|____/ \__\___| .__/|___/
|_|
--------------------------

The first time you run a tool, it will:
- Generate a config.toml for you
- Check the `config.toml` file inside `C:\Users\<user>\AppData\Local\Larian Studios\Baldur's Gate 3\Plugins`
- If the game was installed to a non-standard path, you must adjust this path to correct it.
It needs to point to the game's root installation directory.
E.g. `C:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3`
- If the tools are placed in <bg3_root>/bin or <bg3_root>/bin/subfolder, they will detect the install root
automatically, and install_root in config.toml won't require configuring.
- Place any dll plugins you have inside `C:\Users\<user>\AppData\Local\Larian Studios\Baldur's Gate 3\Plugins`
- Remember, all NativeModLoader plugins are compatible!

Using:
- This tool is similar to the watcher, but it is a one-time use tool. It is useful if you don't
want the watcher tool always running in the background.
1. Start your game.
2. Start the injector tool.*

* If you start too late, some plugins may not properly load. You could try starting the injector tool
first, then the game after to fix this. As long as you start the game within 10 seconds, it'll work.

If you wish to disable a mod, add an entry without extension to the `disabled` key
- For example, if you have `FooBar.dll` and `FooBaz.dll` plugins, the entry looks like:
disabled = ["FooBar", "FooBaz"]
- If you wish to disable all plugins, don't run the injector, and then start the game normally as you always do.

Source code: https://github.com/MolotovCherry/Yet-Another-BG3-Native-Mod-Loader

Disclaimer:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
59 changes: 59 additions & 0 deletions assets-watcher/INSTRUCTIONS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
_____ _ _ _
|_ _| | | | | (_)
| | _ __ ___| |_ _ __ _ _ ___| |_ _ ___ _ __ ___
| || '_ \/ __| __| '__| | | |/ __| __| |/ _ \| '_ \/ __|
_| || | | \__ \ |_| | | |_| | (__| |_| | (_) | | | \__ \
\___/_| |_|___/\__|_| \__,_|\___|\__|_|\___/|_| |_|___/
----------------------------------------------------------

Place bg3_watcher.exe and loader.dll wherever you want, maybe create a shortcut to it.
Keep all these files together, including loader.dll.

bg3_watcher is a tool which stays running in the background. It watches for the launch of bg3 or
bg3_dx11, and injects the plugins into the game. You can load your game through normal means, and
it'll all be transparently patched in the background. This tool creates a tray icon. You can go
to your taskbar to find the icon, right click on it, and press quit, when you are done using it.

The benefit of this tool is that it doesn't require installation, and if you don't want plugins
running, just don't start the tool. The downside is it requires manual running.

____ _
/ ___|| |_ ___ _ __ ___
\___ \| __/ _ \ '_ \/ __|
___) | || __/ |_) \__ \
|____/ \__\___| .__/|___/
|_|
--------------------------

The first time you run a tool, it will:
- Generate a config.toml for you
- Check the `config.toml` file inside `C:\Users\<user>\AppData\Local\Larian Studios\Baldur's Gate 3\Plugins`
- If the game was installed to a non-standard path, you must adjust this path to correct it.
It needs to point to the game's root installation directory.
E.g. `C:\Program Files (x86)\Steam\steamapps\common\Baldurs Gate 3`
- If the tools are placed in <bg3_root>/bin or <bg3_root>/bin/subfolder, they will detect the install root
automatically, and install_root in config.toml won't require configuring.
- Place any dll plugins you have inside `C:\Users\<user>\AppData\Local\Larian Studios\Baldur's Gate 3\Plugins`
- Remember, all NativeModLoader plugins are compatible!

Using:
- This will silently run in the background and watch for game launches. Once the game launches,
it will auto-patch the game instance. When you're done using the tool, go to the systray, right
click on the icon, and click Quit
1. Run the watcher tool
2. When the game launches, it will auto-patch the game instance

If you wish to disable a mod, add an entry without extension to the `disabled` key
- For example, if you have `FooBar.dll` and `FooBaz.dll` plugins, the entry looks like:
disabled = ["FooBar", "FooBaz"]
- If you wish to disable all plugins, quit the watcher tool if it's running,
then start the game normally as you always do.

Source code: https://github.com/MolotovCherry/Yet-Another-BG3-Native-Mod-Loader

Disclaimer:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
103 changes: 0 additions & 103 deletions assets/INSTRUCTIONS.txt

This file was deleted.

0 comments on commit 06ed788

Please sign in to comment.