-
-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Load ASI recursive in scripts #140
base: master
Are you sure you want to change the base?
Conversation
source/dllmain.cpp
Outdated
|
||
SetCurrentDirectoryW(szSelfPath); | ||
|
||
if (SetCurrentDirectoryW((i.path().wstring() += L"\\").c_str())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The final character before the null character must be a backslash (''). If you don't specify the backslash, then it will be added for you. Therefore, specify >MAX_PATH-2 characters for the path unless you include the trailing backslash; in which case, specify MAX_PATH-1 characters for the path.
This concatenation is then not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! I was confused by the original input, such as scripts\\
, being passed as an argument to SetCurrentDirectoryW
.
Don't forget to add error handling and symlinks like here: Ultimate-ASI-Loader/source/dllmain.cpp Lines 99 to 101 in 486c47c
Also, if this doesn't break anything, perhaps better to leave it enabled by default.
|
If `nWantsToLoadFromScriptsOnly` was not set, ASI plugins in the root directory were not loaded.
I made changes that fulfill the requests! I'm not entirely sure what the |
I just meant as a replacement for LoadFromScriptsOnly, though probably not worth to do it right now, as I'm not sure what the backwards compatibility impact might be. |
So that's probably it! |
My PR introduces the ability to load ASI plugins recursively from the
scripts
/plugins
/update
directories and adds the option to enable this feature in theglobal.ini
file (it is disabled by default). This allows for better organization of the plugin folder, but only when theLoadFromScriptsRecursive
variable is set to1
.Simple presentation:
I want to load several plugins that belong to a modification called
MySuperMod
, so I create aMySuperMod
folder inscripts
/plugins
/update
and then place several ASI plugins there. This way, I know that in case of inconsistent plugin names, we can easily find them.It doesn't matter whether
LoadFromScriptsRecursive
is set to0
or1
, the plugins located in scripts/plugins will still be loaded, which is obvious.