ReShade path names not accepting Windows Environment Variables

  • fang64
  • Topic Author
More
10 months 3 weeks ago #1 by fang64 ReShade path names not accepting Windows Environment Variables was created by fang64
So I'm not sure where to ask this or if anyone has run into this problem.

If I want to use %USERNAME% from Windows Environmental Variables I should be able to use it in a path in the ReShade.ini
EffectSearchPaths=C:\users\%USERNAME%\Documents\reshade,C:\users\%USERNAME%\Documents\reshade-alt
or
EffectSearchPaths=C:\users\%USERNAME%\Documents\reshade

Instead it fails to use the search path and says the path doesn't exist even though USERNAME is set to givenusername or USERNAME=givenusername

I'm guessing this is intentional?

Please Log in or Create an account to join the conversation.

  • seri14
More
10 months 3 weeks ago #2 by seri14 Replied by seri14 on topic ReShade path names not accepting Windows Environment Variables
You should not assume that user-specific paths can be replaced by environment variables.

For example, the document folder you mentioned in your example is actually managed in the registry.
HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\Explorer\User Shell Folders

We should to use these Win32 API to identify them.

SHGetKnownFolderPath
learn.microsoft.com/en-us/windows/win32/...shgetknownfolderpath

KNOWNFOLDERID
learn.microsoft.com/en-us/windows/win32/shell/knownfolderid
 

Please Log in or Create an account to join the conversation.

  • Kaldaien
More
9 months 3 weeks ago - 9 months 3 weeks ago #3 by Kaldaien Replied by Kaldaien on topic ReShade path names not accepting Windows Environment Variables
Use ExpandEnvironmentStrings (...) , it's a very simple API designed for this purpose.
Last edit: 9 months 3 weeks ago by Kaldaien.

Please Log in or Create an account to join the conversation.

  • fang64
  • Topic Author
More
9 months 2 weeks ago - 9 months 2 weeks ago #4 by fang64 Replied by fang64 on topic ReShade path names not accepting Windows Environment Variables
So in the reshade.ini file would I include the GUID?

EffectSearchPaths=C:\users\{9B74B6A3-0DFD-4f11-9E78-5F7800F2E772}\Documents\reshade

Or is this also incorrect? seri14 Kaldaien

I also noticed in the github repository that there is already a function that can resolve the environment variables.
github.com/crosire/reshade/blob/7c811127...rce/dll_main.cpp#L58

it seems they do get expanded for some things...
Last edit: 9 months 2 weeks ago by fang64.

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.