use $PROGRAMFILES for the root of the default $COMMONFILES instead of hard-coding "C:\Program Files"

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5102 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2007-04-19 20:02:24 +00:00
parent 99208104ad
commit 6440139e8e
2 changed files with 12 additions and 5 deletions

View file

@ -338,12 +338,9 @@ CEXEBuild::CEXEBuild() :
m_ShellConstants.add("CDBURN_AREA", CSIDL_CDBURN_AREA, CSIDL_CDBURN_AREA);
unsigned int program_files = add_string("ProgramFilesDir");
unsigned int common_files = add_string("CommonFilesDir");
unsigned int program_files_def = add_string("C:\\Program Files");
unsigned int common_files_def = add_string("C:\\Program Files\\Common Files");
if ((program_files >= 0x40) || (common_files >= 0x40)
|| (program_files_def > 0xFF) || (common_files_def > 0xFF))
if ((program_files >= 0x40) || (program_files_def >= 0xFF))
{
// see Source\exehead\util.c for implementation details
// basically, it knows it needs to get folders from the registry when the 0x80 is on
@ -354,6 +351,16 @@ CEXEBuild::CEXEBuild() :
m_ShellConstants.add("PROGRAMFILES", 0x80 | program_files, program_files_def);
m_ShellConstants.add("PROGRAMFILES32", 0x80 | program_files, program_files_def);
m_ShellConstants.add("PROGRAMFILES64", 0xC0 | program_files, program_files_def);
unsigned int common_files = add_string("CommonFilesDir");
unsigned int common_files_def = add_string("$PROGRAMFILES\\Common Files");
if ((common_files > 0x40) || (common_files_def > 0xFF))
{
ERROR_MSG("Internal compiler error: too many strings added to strings block before adding shell constants!\n");
throw out_of_range("Internal compiler error: too many strings added to strings block before adding shell constants!");
}
m_ShellConstants.add("COMMONFILES", 0x80 | common_files, common_files_def);
m_ShellConstants.add("COMMONFILES32", 0x80 | common_files, common_files_def);
m_ShellConstants.add("COMMONFILES64", 0xC0 | common_files, common_files_def);

View file

@ -636,7 +636,7 @@ char * NSISCALL GetNSISString(char *outbuf, int strtab)
{
myRegGetStr(HKEY_LOCAL_MACHINE, SYSREGKEY, GetNSISStringNP(fldrs[0] & 0x3F), out, fldrs[0] & 0x40);
if (!*out)
mystrcpy(out, GetNSISStringNP(fldrs[2]));
GetNSISString(out, fldrs[2]);
x = 0;
}
else if (fldrs[0] == CSIDL_SYSTEM)