1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2024-12-01 01:27:18 +01:00

feat(launcher): Improve error output when missing vcredist deps

Apply a simple heuristic to provide the user with more
specific information regarding which vcredist package
might not have been found on their system.

This is a common problem as different games require
different versions and different versions of windows
and installations might already come with some versions
already pre-installed.

Also improve the readme regarding that and provide links
to all versions that are required by one game or another
today.
This commit is contained in:
icex2 2024-02-25 09:36:53 +01:00
parent d3c293de45
commit 3a2ebae869
3 changed files with 65 additions and 14 deletions

View File

@ -148,22 +148,37 @@ helpful or important to know and should be added.
### Setup and dependencies ### Setup and dependencies
Most (older generation) games were developed for Windows XP Embedded but should run fine on any The games bemanitools support span several generations of (embedded) Windows versions: XP, 7 and 10
consumer version of Windows XP. Newer versions of Windows, e.g. Windows 7, 8 and 10, should be fine (IoT). With these come different generations of dependencies as requirements.
as well. Some hooks also include fixes required to run the games on a more recent version.
Depending on the game, you also need the following dependencies installed: Simplified, this boils down to the following list of C++ Redistributable (vcredist) packages that
are recommended to be installed without going into detail which game needs exactly which version.
Keep in mind the "bitness" (32-bit vs. 64-bit) of each specific game and download the right ones
accordingly.
- The 32-bit (x86) version of You can use a tool like [dependencywalker](https://www.dependencywalker.com/) to figure that out if
[Microsoft Visual C++ 2010 Service Pack 1 Redistributable Package MFC Security Update](https://www.microsoft.com/en-sg/download/details.aspx?id=26999) it is relevant to you.
- The 32-bit (x86) and 64-bit (x64) versions of
[Microsoft Visual C++ Redistributable Packages for Visual Studio 2013](https://www.microsoft.com/en-sg/download/details.aspx?id=40784) Links/files are also provided by
- The [bemanitools-supplement](https://github.com/djhackersdev/bemanitools-supplement/tree/master/misc/win-runtime#windows-runtimes-and-libraries)
#### Visual C++ Redistributable Packages
- 2010
- [32-bit (x86)](http://download.microsoft.com/download/5/B/C/5BC5DBB3-652D-4DCE-B14A-475AB85EEF6E/vcredist_x86.exe)
- [64-bit (x64)](http://download.microsoft.com/download/d/2/4/d242c3fb-da5a-4542-ad66-f9661d0a8d19/vcredist_x64.exe)
- 2013
- [32-bit (x86)](http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x86.exe)
- [64-bit (x64)](http://download.microsoft.com/download/2/E/6/2E61CFA4-993B-4DD4-91DA-3737CD5CD6E3/vcredist_x64.exe)
- 2015
- [32-bit (x86)](https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe)
- [64-bit (x64)](https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe)
#### DirectX 9
Most/nearly all games support to this day use the DirectX 9(ex) API. Make sure to install the
[DirectX 9 End-User Runtimes (June 2010)](https://www.microsoft.com/en-us/download/details.aspx?id=8109) [DirectX 9 End-User Runtimes (June 2010)](https://www.microsoft.com/en-us/download/details.aspx?id=8109)
See also [bemanitools-supplement](https://www.github.com/djhackersdev/bemanitools-supplement/) for
files.
## Development ## Development
### Building ### Building

View File

@ -16,6 +16,20 @@
#define MM_ALLOCATION_GRANULARITY 0x10000 #define MM_ALLOCATION_GRANULARITY 0x10000
static bool _module_dependency_available(const char *lib)
{
HMODULE module;
module = LoadLibraryA(lib);
if (module == NULL) {
return false;
} else {
FreeLibrary(module);
return true;
}
}
static bool static bool
module_replace_dll_iat(HMODULE hModule, const struct array *iat_hook_dlls) module_replace_dll_iat(HMODULE hModule, const struct array *iat_hook_dlls)
{ {
@ -141,7 +155,7 @@ void module_init(struct module_context *module, const char *path)
log_info("init: %s", path); log_info("init: %s", path);
module->dll = LoadLibrary(path); module->dll = LoadLibraryA(path);
if (module->dll == NULL) { if (module->dll == NULL) {
LPSTR buffer; LPSTR buffer;
@ -160,6 +174,28 @@ void module_init(struct module_context *module, const char *path)
if (err == ERROR_MOD_NOT_FOUND) { if (err == ERROR_MOD_NOT_FOUND) {
log_warning("%s is likely missing dependencies", path); log_warning("%s is likely missing dependencies", path);
log_warning("Do you have vcredist/directx runtimes installed?"); log_warning("Do you have vcredist/directx runtimes installed?");
log_warning(
"Ensure the installed dependencies match the architecture, "
"32-bit/64-bit, of the game");
log_warning(
"Running heuristic for commonly used libraries (actual "
"requirements depend on game)...");
if (_module_dependency_available("d3d9.dll")) {
log_warning("Could not find directx9 runtime");
}
if (_module_dependency_available("msvcr100.dll")) {
log_warning("Could not find vcredist 2010 runtime");
}
if (_module_dependency_available("msvcr120.dll")) {
log_warning("Could not find vcredist 2013 runtime");
}
if (_module_dependency_available("msvcp140.dll")) {
log_warning("Could not find vcredist 2015 runtime");
}
} }
log_fatal("%s: Failed to load game DLL: %s", path, buffer); log_fatal("%s: Failed to load game DLL: %s", path, buffer);