mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
use parent of windows directory as "program files" directory, if no program
files directory exists bug 238133 r=dveditz sr=roc
This commit is contained in:
parent
368c5f07f7
commit
5f4e7cb5b0
@ -7948,11 +7948,31 @@ HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize)
|
||||
{
|
||||
/* parse for the "c:\Program Files" directory */
|
||||
GetWinReg(HKEY_LOCAL_MACHINE, szWRMSCurrentVersion, "ProgramFilesDir", szVariable, dwVariableSize);
|
||||
/* see if that failed */
|
||||
if (*szVariable == 0)
|
||||
{
|
||||
char* backslash;
|
||||
/* Use the parent of the windows directory */
|
||||
GetWindowsDirectory(szVariable, dwVariableSize);
|
||||
backslash = strrchr(szVariable, '\\');
|
||||
if (backslash)
|
||||
*backslash = 0;
|
||||
}
|
||||
}
|
||||
else if(lstrcmpi(szVariable, "PROGRAMFILESPATH") == 0)
|
||||
{
|
||||
/* parse for the "\Program Files" directory -- NOTE does not include the drive letter */
|
||||
GetWinReg(HKEY_LOCAL_MACHINE, szWRMSCurrentVersion, "ProgramFilesDir", szBuf, sizeof(szBuf));
|
||||
/* see if that failed */
|
||||
if (*szBuf == 0)
|
||||
{
|
||||
char* backslash;
|
||||
/* Use the parent of the windows directory */
|
||||
GetWindowsDirectory(szBuf, sizeof(szBuf));
|
||||
backslash = strrchr(szBuf, '\\');
|
||||
if (backslash)
|
||||
*backslash = 0;
|
||||
}
|
||||
lstrcpy(szVariable, szBuf+2);
|
||||
}
|
||||
else if(lstrcmpi(szVariable, "INSTALLDRIVE") == 0)
|
||||
|
@ -2202,6 +2202,16 @@ HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize)
|
||||
{
|
||||
/* parse for the "c:\Program Files" directory */
|
||||
GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir", szVariable, dwVariableSize);
|
||||
/* see if that failed */
|
||||
if (*szVariable == 0)
|
||||
{
|
||||
char* backslash;
|
||||
/* Use the parent of the windows directory */
|
||||
GetWindowsDirectory(szVariable, dwVariableSize);
|
||||
backslash = strrchr(szVariable, '\\');
|
||||
if (backslash)
|
||||
*backslash = 0;
|
||||
}
|
||||
}
|
||||
else if(lstrcmpi(szVariable, "COMMONFILESDIR") == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user