From 24ce3ca0dd258a4b52ca2d95d1747f09aa9b271a Mon Sep 17 00:00:00 2001 From: kichik Date: Tue, 1 May 2007 20:53:45 +0000 Subject: [PATCH] make $PROGRAMFILES and $COMMONFILES available in the uninstaller as well git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5141 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/build.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/build.cpp b/Source/build.cpp index 216edf25..8a962c87 100644 --- a/Source/build.cpp +++ b/Source/build.cpp @@ -367,6 +367,24 @@ CEXEBuild::CEXEBuild() : m_ShellConstants.add("COMMONFILES32", 0x80 | common_files, common_files_def); m_ShellConstants.add("COMMONFILES64", 0xC0 | common_files, common_files_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 ucommon_files = add_string("CommonFilesDir", 0); + unsigned int ucommon_files_def = add_string("$PROGRAMFILES\\Common Files"); + + if (uprogram_files != program_files + || uprogram_files_def != program_files_def + || ucommon_files != common_files + || ucommon_files_def != common_files_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!"); + } + + set_uninstall_mode(0); + set_code_type_predefines(); }