diff --git a/cmake/installer/TextLog.nsh b/cmake/installer/TextLog.nsh deleted file mode 100644 index a61ea1531e..0000000000 --- a/cmake/installer/TextLog.nsh +++ /dev/null @@ -1,68 +0,0 @@ -# TextLog.nsh v1.1 - 2005-12-26 -# Written by Mike Schinkel [http://www.mikeschinkel.com/blog/] - -Var /GLOBAL __TextLog_FileHandle -Var /GLOBAL __TextLog_FileName -Var /GLOBAL __TextLog_State - -!define LogMsg '!insertmacro LogMsgCall' -!macro LogMsgCall _text - Call LogSetOn - Push "${_text}" - Call LogText - Call LogSetOff -!macroend - - -!define LogText '!insertmacro LogTextCall' -!macro LogTextCall _text - Push "${_text}" - Call LogText -!macroend - -Function LogText - Exch $0 ; pABC -> 0ABC - FileWrite $__TextLog_FileHandle "$0$\r$\n" - Pop $0 ; 0ABC -> ABC -FunctionEnd - -!define LogSetFileName '!insertmacro LogSetFileNameCall' -!macro LogSetFileNameCall _filename - Push "${_filename}" - Call LogSetFileName -!macroend - -Function LogSetFileName - Exch $0 ; pABC -> 0ABC - StrCpy $__TextLog_FileName "$0" - StrCmp $__TextLog_State "open" +1 +3 - Call LogSetOff - Call LogSetOn - Pop $0 ; 0ABC -> ABC -FunctionEnd - -!define LogSetOn '!insertmacro LogSetOnCall' -!macro LogSetOnCall - Call LogSetOn -!macroend - -Function LogSetOn - StrCmp $__TextLog_FileName "" +1 AlreadySet - StrCpy $__TextLog_FileName "$INSTDIR\install.log" -AlreadySet: - StrCmp $__TextLog_State "open" +2 - FileOpen $__TextLog_FileHandle "$__TextLog_FileName" a - FileSeek $__TextLog_FileHandle 0 END - StrCpy $__TextLog_State "open" -FunctionEnd - -!define LogSetOff '!insertmacro LogSetOffCall' -!macro LogSetOffCall - Call LogSetOff -!macroend - -Function LogSetOff - StrCmp $__TextLog_State "open" +1 +2 - FileClose $__TextLog_FileHandle - StrCpy $__TextLog_State "" -FunctionEnd \ No newline at end of file diff --git a/cmake/templates/CPackProperties.cmake.in b/cmake/templates/CPackProperties.cmake.in index 73f52d72bf..cb6474b010 100644 --- a/cmake/templates/CPackProperties.cmake.in +++ b/cmake/templates/CPackProperties.cmake.in @@ -54,4 +54,3 @@ set(CLIENT_COMPONENT_CONDITIONAL "@CLIENT_COMPONENT_CONDITIONAL@") set(INSTALLER_TYPE "@INSTALLER_TYPE@") set(APP_USER_MODEL_ID "@APP_USER_MODEL_ID@") set(BYPASS_SIGNING "@BYPASS_SIGNING@") -set(HF_CMAKE_DIR "@HF_CMAKE_DIR@") diff --git a/cmake/templates/NSIS.template.in b/cmake/templates/NSIS.template.in index 4a9b67d843..19f661b42b 100644 --- a/cmake/templates/NSIS.template.in +++ b/cmake/templates/NSIS.template.in @@ -30,8 +30,75 @@ ;-------------------------------- ;Include Installer Logging - !addincludedir "@HF_CMAKE_DIR@\installer" - !include "TextLog.nsh" +; taken from http://nsis.sourceforge.net/Logging:_Simple_Text_File_Logging_Functions_and_Macros +; TextLog.nsh v1.1 - 2005-12-26 +; Written by Mike Schinkel [http://www.mikeschinkel.com/blog/] + + Var /GLOBAL __TextLog_FileHandle + Var /GLOBAL __TextLog_FileName + Var /GLOBAL __TextLog_State + + !define LogMsg '!insertmacro LogMsgCall' + !macro LogMsgCall _text + Call LogSetOn + Push "${_text}" + Call LogText + Call LogSetOff + !macroend + + + !define LogText '!insertmacro LogTextCall' + !macro LogTextCall _text + Push "${_text}" + Call LogText + !macroend + + Function LogText + Exch $0 ; pABC -> 0ABC + FileWrite $__TextLog_FileHandle "$0$\r$\n" + Pop $0 ; 0ABC -> ABC + FunctionEnd + + !define LogSetFileName '!insertmacro LogSetFileNameCall' + !macro LogSetFileNameCall _filename + Push "${_filename}" + Call LogSetFileName + !macroend + + Function LogSetFileName + Exch $0 ; pABC -> 0ABC + StrCpy $__TextLog_FileName "$0" + StrCmp $__TextLog_State "open" +1 +3 + Call LogSetOff + Call LogSetOn + Pop $0 ; 0ABC -> ABC + FunctionEnd + + !define LogSetOn '!insertmacro LogSetOnCall' + !macro LogSetOnCall + Call LogSetOn + !macroend + + Function LogSetOn + StrCmp $__TextLog_FileName "" +1 AlreadySet + StrCpy $__TextLog_FileName "$INSTDIR\install.log" + AlreadySet: + StrCmp $__TextLog_State "open" +2 + FileOpen $__TextLog_FileHandle "$__TextLog_FileName" a + FileSeek $__TextLog_FileHandle 0 END + StrCpy $__TextLog_State "open" + FunctionEnd + + !define LogSetOff '!insertmacro LogSetOffCall' + !macro LogSetOffCall + Call LogSetOff + !macroend + + Function LogSetOff + StrCmp $__TextLog_State "open" +1 +2 + FileClose $__TextLog_FileHandle + StrCpy $__TextLog_State "" + FunctionEnd ;-------------------------------- ; Utilities and Functions