wsprintf(szVariable, "Software\\Netscape\\Netscape Seamonkey\\%s", szBuf); } else if(lstrcmpi(szVariable, "Netscape 6 CurrentVersion") == 0) {  GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Netscape\\Netscape 6", "CurrentVersion", szBuf, sizeof(szBuf));  if(*szBuf == '\0') return(FALSE);  wsprintf(szVariable, "Software\\Netscape\\Netscape 6\\%s", szBuf); } else if(lstrcmpi(szVariable, "Netscape Netbusiness Messenger CurrentVersion") == 0) {  GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Netscape\\Netscape Netbusiness Messenger", "CurrentVersion", szBuf, sizeof(szBuf));  if(*szBuf == '\0') return(FALSE);  wsprintf(szVariable, "Software\\Netscape\\Netscape Netbusiness Messenger\\%s", szBuf); } else if(lstrcmpi(szVariable, "Mozilla Seamonkey CurrentVersion") == 0) {  GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Mozilla\\Mozilla Seamonkey", "CurrentVersion", szBuf, sizeof(szBuf));  if(*szBuf == '\0') return(FALSE);  wsprintf(szVariable, "Software\\Mozilla\\Mozilla Seamonkey\\%s", szBuf);
wsprintf(szVariable, "Software\\%s\\%s\\%s", sgProduct.szCompanyName, sgProduct.szProductName, szBuf);
HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize){  char szBuf[MAX_BUF];  char szKey[MAX_BUF];  char szName[MAX_BUF];  char szValue[MAX_BUF];  /* zero out the memory allocations */  ZeroMemory(szBuf,       sizeof(szBuf));  ZeroMemory(szKey,       sizeof(szKey));  ZeroMemory(szName,      sizeof(szName));  ZeroMemory(szValue,     sizeof(szValue));  if(lstrcmpi(szVariable, "PROGRAMFILESDIR") == 0)  {    /* parse for the "c:\Program Files" directory */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "ProgramFilesDir", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "COMMONFILESDIR") == 0)  {    /* parse for the "c:\Program Files\Common Files" directory */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "CommonFilesDir", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "MEDIAPATH") == 0)  {    /* parse for the "c:\Winnt40\Media" directory */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "MediaPath", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "CONFIGPATH") == 0)  {    /* parse for the "c:\Windows\Config" directory */    if(ulOSType & OS_WIN9x)    {      GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "ConfigPath", szVariable, dwVariableSize);    }  }  else if(lstrcmpi(szVariable, "DEVICEPATH") == 0)  {    /* parse for the "c:\Winnt40\INF" directory */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion", "DevicePath", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "COMMON_STARTUP") == 0)  {    /* parse for the "C:\WINNT40\Profiles\All Users\Start Menu\\Programs\\Startup" directory */    if(ulOSType & OS_WIN9x)    {      GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Startup", szVariable, dwVariableSize);    }    else    {      GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Common Startup", szVariable, dwVariableSize);    }  }  else if(lstrcmpi(szVariable, "COMMON_PROGRAMS") == 0)  {    /* parse for the "C:\WINNT40\Profiles\All Users\Start Menu\\Programs" directory */    if(ulOSType & OS_WIN9x)    {      GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Programs", szVariable, dwVariableSize);    }    else    {      GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Common Programs", szVariable, dwVariableSize);    }  }  else if(lstrcmpi(szVariable, "COMMON_STARTMENU") == 0)  {    /* parse for the "C:\WINNT40\Profiles\All Users\Start Menu" directory */    if(ulOSType & OS_WIN9x)    {      GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Start Menu", szVariable, dwVariableSize);    }    else    {      GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Common Start Menu", szVariable, dwVariableSize);    }  }  else if(lstrcmpi(szVariable, "COMMON_DESKTOP") == 0)  {    /* parse for the "C:\WINNT40\Profiles\All Users\Desktop" directory */    if(ulOSType & OS_WIN9x)    {      GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Desktop", szVariable, dwVariableSize);    }    else    {      GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Common Desktop", szVariable, dwVariableSize);    }  }  else if(lstrcmpi(szVariable, "PERSONAL_STARTUP") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Start Menu\Programs\Startup" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Startup", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_PROGRAMS") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Start Menu\Programs" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Programs", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_STARTMENU") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Start Menu" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Start Menu", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_DESKTOP") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Desktop" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Desktop", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_APPDATA") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Application Data" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "AppData", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_CACHE") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Temporary Internet Files" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Cache", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_COOKIES") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Cookies" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Cookies", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_FAVORITES") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Favorites" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Favorites", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_FONTS") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Fonts" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Fonts", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_HISTORY") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\History" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "History", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_NETHOOD") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\NetHood" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "NetHood", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_PERSONAL") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Personal" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Personal", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_PRINTHOOD") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\PrintHood" directory */    if(ulOSType & OS_NT)    {      GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "PrintHood", szVariable, dwVariableSize);    }  }  else if(lstrcmpi(szVariable, "PERSONAL_RECENT") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\Recent" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Recent", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_SENDTO") == 0)  {    /* parse for the "C:\WINNT40\Profiles\%USERNAME%\SendTo" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "SendTo", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PERSONAL_TEMPLATES") == 0)  {    /* parse for the "C:\WINNT40\ShellNew" directory */    GetWinReg(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", "Templates", szVariable, dwVariableSize);  }  else if(lstrcmpi(szVariable, "PROGRAMFOLDERNAME") == 0)  {    /* parse for the "Netscape Communicator" folder name */    lstrcpy(szVariable, sgProduct.szProgramFolderName);  }  else if(lstrcmpi(szVariable, "PROGRAMFOLDERPATH") == 0)  {    /* parse for the "c:\Windows\profiles\All Users\Start Menu\Programs" path */    lstrcpy(szVariable, sgProduct.szProgramFolderPath);  }  else if(lstrcmpi(szVariable, "PROGRAMFOLDERPATHNAME") == 0)  {    /* parse for the "c:\Windows\profiles\All Users\Start Menu\Programs\Netscape Communicator" path */    lstrcpy(szVariable, sgProduct.szProgramFolderPath);    lstrcat(szVariable, "\\");    lstrcat(szVariable, sgProduct.szProgramFolderName);  }  else if(lstrcmpi(szVariable, "PROGRAMFOLDERPATH") == 0)  {    /* parse for the "c:\Windows\profiles\All Users\Start Menu\Programs" path */    lstrcpy(szVariable, sgProduct.szProgramFolderPath);  }  else if(lstrcmpi(szVariable, "WIZTEMP") == 0)  {    /* parse for the "c:\Temp" path */    lstrcpy(szVariable, szTempDir);    if(szVariable[strlen(szVariable) - 1] == '\\')      szVariable[strlen(szVariable) - 1] = '\0';  }  else if(lstrcmpi(szVariable, "TEMP") == 0)  {    /* parse for the "c:\Temp" path */    lstrcpy(szVariable, szOSTempDir);    if(szVariable[strlen(szVariable) - 1] == '\\')      szVariable[strlen(szVariable) - 1] = '\0';  }  else if(lstrcmpi(szVariable, "WINDISK") == 0)  {    /* Locate the drive that Windows is installed on, and only use the drive letter and the ':' character (C:). */    if(GetWindowsDirectory(szBuf, MAX_BUF) == 0)    {      char szEGetWinDirFailed[MAX_BUF];      if(NS_LoadString(hSetupRscInst, IDS_ERROR_GET_WINDOWS_DIRECTORY_FAILED, szEGetWinDirFailed, MAX_BUF) == WIZ_OK)        PrintError(szEGetWinDirFailed, ERROR_CODE_SHOW);      exit(1);    }    else    {      /* Copy the first 2 characters from the path..        */      /* This is the drive letter and the ':' character for */      /* where Windows is installed at.                     */      memset(szVariable, '\0', MAX_BUF);      szVariable[0] = szBuf[0];      szVariable[1] = szBuf[1];    }  }  else if(lstrcmpi(szVariable, "WINDIR") == 0)  {    /* Locate the "c:\Windows" directory */    if(GetWindowsDirectory(szVariable, dwVariableSize) == 0)    {      char szEGetWinDirFailed[MAX_BUF];      if(NS_LoadString(hSetupRscInst, IDS_ERROR_GET_WINDOWS_DIRECTORY_FAILED, szEGetWinDirFailed, MAX_BUF) == WIZ_OK)        PrintError(szEGetWinDirFailed, ERROR_CODE_SHOW);      exit(1);    }  }  else if(lstrcmpi(szVariable, "WINSYSDIR") == 0)  {    /* Locate the "c:\Windows\System" (for Win95/Win98) or "c:\Windows\System32" (for NT) directory */    if(GetSystemDirectory(szVariable, dwVariableSize) == 0)    {      char szEGetSysDirFailed[MAX_BUF];      if(NS_LoadString(hSetupRscInst, IDS_ERROR_GET_SYSTEM_DIRECTORY_FAILED, szEGetSysDirFailed, MAX_BUF) == WIZ_OK)        PrintError(szEGetSysDirFailed, ERROR_CODE_SHOW);      exit(1);    }  }  else if(lstrcmpi(szVariable, "JRE BIN PATH") == 0)  {    /* Locate the "c:\Program Files\JavaSoft\JRE\1.3\Bin" directory */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\javaw.Exe", NULL, szVariable, dwVariableSize);    if(*szVariable == '\0')      return(FALSE);    else    {      ParsePath(szVariable, szBuf, MAX_BUF, PP_PATH_ONLY);      lstrcpy(szVariable, szBuf);    }  }  else if(lstrcmpi(szVariable, "JRE PATH") == 0)  {    /* Locate the "c:\Program Files\JavaSoft\JRE\1.3" directory */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\JavaSoft\\Java Plug-in\\1.3", "JavaHome", szVariable, dwVariableSize);    if(*szVariable == '\0')      return(FALSE);  }  else if(lstrcmpi(szVariable, "SETUP PATH") == 0)  {    lstrcpy(szVariable, sgProduct.szPath);    if(*sgProduct.szSubPath != '\0')    {      AppendBackSlash(szVariable, dwVariableSize);      lstrcat(szVariable, sgProduct.szSubPath);    }  }  else if(lstrcmpi(szVariable, "Default Path") == 0)  {    lstrcpy(szVariable, sgProduct.szPath);    if(*sgProduct.szSubPath != '\0')    {      AppendBackSlash(szVariable, dwVariableSize);      lstrcat(szVariable, sgProduct.szSubPath);    }  }  else if(lstrcmpi(szVariable, "SETUP STARTUP PATH") == 0)  {    lstrcpy(szVariable, szSetupDir);  }  else if(lstrcmpi(szVariable, "Default Folder") == 0)  {    lstrcpy(szVariable, sgProduct.szProgramFolderPath);    AppendBackSlash(szVariable, dwVariableSize);    lstrcat(szVariable, sgProduct.szProgramFolderName);  }  else if(lstrcmpi(szVariable, "Netscape Seamonkey CurrentVersion") == 0)  {    /* parse for the current Netscape WinReg key */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Netscape\\Netscape Seamonkey", "CurrentVersion", szBuf, sizeof(szBuf));    if(*szBuf == '\0')      return(FALSE);    wsprintf(szVariable, "Software\\Netscape\\Netscape Seamonkey\\%s", szBuf);  }  else if(lstrcmpi(szVariable, "Netscape 6 CurrentVersion") == 0)  {    /* parse for the current Netscape WinReg key */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Netscape\\Netscape 6", "CurrentVersion", szBuf, sizeof(szBuf));    if(*szBuf == '\0')      return(FALSE);    wsprintf(szVariable, "Software\\Netscape\\Netscape 6\\%s", szBuf);  }  else if(lstrcmpi(szVariable, "Netscape Netbusiness Messenger CurrentVersion") == 0)  {    /* parse for the current Netscape WinReg key */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Netscape\\Netscape Netbusiness Messenger", "CurrentVersion", szBuf, sizeof(szBuf));    if(*szBuf == '\0')      return(FALSE);    wsprintf(szVariable, "Software\\Netscape\\Netscape Netbusiness Messenger\\%s", szBuf);  }  else if(lstrcmpi(szVariable, "Mozilla Seamonkey CurrentVersion") == 0)  {    /* parse for the current Mozilla WinReg key */    GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Mozilla\\Mozilla Seamonkey", "CurrentVersion", szBuf, sizeof(szBuf));    if(*szBuf == '\0')      return(FALSE);    wsprintf(szVariable, "Software\\Mozilla\\Mozilla Seamonkey\\%s", szBuf);  }  else    return(FALSE);  return(TRUE);}