Skip to content

Commit

Permalink
Ini file path is now constructed using the host process' root folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
FransBouma committed Sep 18, 2023
1 parent 8210eba commit 0afc5c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -783,13 +783,13 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID)
return FALSE;
}

// From ReShade
WCHAR buf[4096];
const std::filesystem::path dllPath = GetModuleFileNameW(hModule, buf, ARRAYSIZE(buf)) ? buf : std::filesystem::path(); // <installpath>/shadertoggler.addon64
// We'll pass a nullptr for the module handle so we get the containing process' executable + path. We can't use the reshade's api as we don't have the runtime
// and we can't use reshade's handle because under vulkan reshade is stored in a central space and therefore it won't get the folder of the exe (where the reshade dll is located as well).
WCHAR buf[MAX_PATH];
const std::filesystem::path dllPath = GetModuleFileNameW(nullptr, buf, ARRAYSIZE(buf)) ? buf : std::filesystem::path(); // <installpath>/shadertoggler.addon64
const std::filesystem::path basePath = dllPath.parent_path(); // <installpath>
const std::string& hashFileName = HASH_FILE_NAME;
g_iniFileName = (basePath / hashFileName).string(); // <installpath>/shadertoggler.ini

reshade::register_event<reshade::addon_event::init_pipeline>(onInitPipeline);
reshade::register_event<reshade::addon_event::init_command_list>(onInitCommandList);
reshade::register_event<reshade::addon_event::destroy_command_list>(onDestroyCommandList);
Expand Down
8 changes: 4 additions & 4 deletions src/ShaderToggler.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,0,0
PRODUCTVERSION 1,2,0,0
FILEVERSION 1,2,1,0
PRODUCTVERSION 1,2,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Frans 'Otis_Inf' Bouma"
VALUE "FileDescription", "ShaderToggler Addon for ReShade 5+"
VALUE "FileVersion", "1.2.0.0"
VALUE "FileVersion", "1.2.1.0"
VALUE "InternalName", "ShaderTo.dll"
VALUE "LegalCopyright", "Copyright (C) 2023 Frans Bouma"
VALUE "OriginalFilename", "ShaderTo.dll"
VALUE "ProductName", "Shader Toggler addon for ReShade 5+"
VALUE "ProductVersion", "1.2.0.0"
VALUE "ProductVersion", "1.2.1.0"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 0afc5c9

Please sign in to comment.