fixed bug #1947702 - Wrong default for PROGRAMFILES64 on Win2000

default to $PROGRAMFIELS if $PROGRAMFILES64 can't be found instead of "C:\Program Files"

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5604 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-04-21 23:01:21 +00:00
parent da312003a8
commit 3d28b97c82

View file

@ -350,8 +350,17 @@ CEXEBuild::CEXEBuild() :
}
m_ShellConstants.add("PROGRAMFILES", 0x80 | program_files, program_files_def);
unsigned int program_files64_def = add_string("$PROGRAMFILES");
if (program_files64_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("PROGRAMFILES32", 0x80 | program_files, program_files_def);
m_ShellConstants.add("PROGRAMFILES64", 0xC0 | program_files, program_files_def);
m_ShellConstants.add("PROGRAMFILES64", 0xC0 | program_files, program_files64_def);
unsigned int common_files = add_string("CommonFilesDir", 0);
unsigned int common_files_def = add_string("$PROGRAMFILES\\Common Files");
@ -363,20 +372,33 @@ CEXEBuild::CEXEBuild() :
}
m_ShellConstants.add("COMMONFILES", 0x80 | common_files, common_files_def);
unsigned int common_files64_def = add_string("$COMMONFILES");
if (common_files64_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("COMMONFILES32", 0x80 | common_files, common_files_def);
m_ShellConstants.add("COMMONFILES64", 0xC0 | common_files, common_files_def);
m_ShellConstants.add("COMMONFILES64", 0xC0 | common_files, common_files64_def);
set_uninstall_mode(1);
unsigned int uprogram_files = add_string("ProgramFilesDir", 0);
unsigned int uprogram_files_def = add_string("C:\\Program Files");
unsigned int uprogram_files64_def = add_string("$PROGRAMFILES");
unsigned int ucommon_files = add_string("CommonFilesDir", 0);
unsigned int ucommon_files_def = add_string("$PROGRAMFILES\\Common Files");
unsigned int ucommon_files64_def = add_string("$COMMONFILES");
if (uprogram_files != program_files
|| uprogram_files_def != program_files_def
|| uprogram_files64_def != program_files64_def
|| ucommon_files != common_files
|| ucommon_files_def != common_files_def)
|| ucommon_files_def != common_files_def
|| ucommon_files64_def != common_files64_def)
{
ERROR_MSG("Internal compiler error: installer's shell constants are different than uninstallers!\n");
throw out_of_range("Internal compiler error: installer's shell constants are different than uninstallers!");