https://bugs.winehq.org/show_bug.cgi?id=46901
--- Comment #3 from Fabian Maurer dark.shadow4@web.de --- I did some tests on windows, and it doesn't always expand the variables either. And it seems to expand in lexical order, too.
For example TESTVAR1=%TESTVAR2% TESTVAR2=%TESTVAR3% TESTVAR3=test (all set in the registry obviously) gives TESTVAR1=%TESTVAR2% TESTVAR2=test TESTVAR3=test
Will do more testing soon. Problem is in GetEnvironmentVariableW, AFAIK.
Could you test if your setup with the nested environment variables works on windows?