I want to add "%userprofile%" to the InstallPath
heetbeet opened this issue · 2 comments
I want to expand this part to work with %userprofile% (or maybe even any environment variables), but I don't know how to actually retrieve environment variables in C++ (well, not without adding extra bloat like std::
).
My question is: are there any functionality already in the codebase to access environment variables? Where can I find it?
I am guessing you want to imitate
7-Zip/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
Lines 245 to 257 in dfe3836
And retrieving an environment variable is as easy as calling GetEnvironmentVariable()
. There is one precedent for this in the current code:
7-Zip/C/Util/7zipInstall/7zipInstall.c
Line 1048 in dfe3836
Thanks for the info