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:
cbiesinger%web.de 2004-04-26 12:48:11 +00:00
Родитель 368c5f07f7
Коммит 5f4e7cb5b0
2 изменённых файлов: 30 добавлений и 0 удалений

Просмотреть файл

@ -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)
{