From: Brian S. <xue...@us...> - 2008-04-02 20:18:32
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26677 Modified Files: Tag: b0_22_2 installer.nsi Log Message: Updated to work with current NSIS compiler (v2.36). Ensure the full list of supported languages appears in the Language Selection list. Make the "Install" log friendlier by storing the name of the selected language instead of simply the language ID number. Stop changing the text on the DIRECTORY page's "Next" button to "Install" or "Upgrade" because this button no longer starts the install/upgrade process. The next page shown is the "Setup Summary" one and this already has its "Next" button changed to "Install" or "Upgrade" as appropriate. Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.242.4.25 retrieving revision 1.242.4.26 diff -C2 -d -r1.242.4.25 -r1.242.4.26 *** installer.nsi 26 Jan 2008 14:54:58 -0000 1.242.4.25 --- installer.nsi 2 Apr 2008 20:18:37 -0000 1.242.4.26 *************** *** 50,65 **** #-------------------------------------------------------------------------- ! ; This version of the script has been tested with the "NSIS v2.22" compiler, ! ; released 27 November 2006. This particular compiler can be downloaded from ! ; http://prdownloads.sourceforge.net/nsis/nsis-2.22-setup.exe?download !define ${NSIS_VERSION}_found ! !ifndef v2.22_found !warning \ "$\r$\n\ $\r$\n*** NSIS COMPILER WARNING:\ $\r$\n***\ ! $\r$\n*** This script has only been tested using the NSIS v2.22 compiler\ $\r$\n*** and may not work properly with this NSIS ${NSIS_VERSION} compiler\ $\r$\n***\ --- 50,67 ---- #-------------------------------------------------------------------------- ! ; This version of the script has been tested with the "NSIS v2.36" compiler, ! ; released 29 March 2008. This particular compiler can be downloaded from ! ; http://prdownloads.sourceforge.net/nsis/nsis-2.36-setup.exe?download ! ! !define C_EXPECTED_VERSION "v2.36" !define ${NSIS_VERSION}_found ! !ifndef ${C_EXPECTED_VERSION}_found !warning \ "$\r$\n\ $\r$\n*** NSIS COMPILER WARNING:\ $\r$\n***\ ! $\r$\n*** This script has only been tested using the NSIS ${C_EXPECTED_VERSION} compiler\ $\r$\n*** and may not work properly with this NSIS ${NSIS_VERSION} compiler\ $\r$\n***\ *************** *** 69,72 **** --- 71,75 ---- !undef ${NSIS_VERSION}_found + !undef C_EXPECTED_VERSION ; Normally no NSIS compiler warnings are expected. However there may be some warnings *************** *** 118,122 **** ; appropriate ${NSISDIR} sub-folders if you wish, but this step is entirely optional. ; ! ; Tested with version v0.0.6b of the 'UAC' plugin. #-------------------------------------------------------------------------- --- 121,126 ---- ; appropriate ${NSISDIR} sub-folders if you wish, but this step is entirely optional. ; ! ; Tested with version v0.0.8 (20080310) of the 'UAC' plugin, ! ; timestamped 10 March 2008 20:17:46. #-------------------------------------------------------------------------- *************** *** 371,377 **** Var G_GUI ; GUI port (1-65535) ! Var G_PFIFLAG ; Multi-purpose variable: ! ; (1) used to indicate if banner was shown before the 'WELCOME' page ! ; (2) used to avoid unnecessary Install/Upgrade button text updates Var G_NOTEPAD ; path to notepad.exe ("" = not found in search path) --- 375,379 ---- Var G_GUI ; GUI port (1-65535) ! Var G_PFIFLAG ; used to indicate if banner was shown before the 'WELCOME' page Var G_NOTEPAD ; path to notepad.exe ("" = not found in search path) *************** *** 580,583 **** --- 582,586 ---- !define MUI_LANGDLL_ALWAYSSHOW + !define MUI_LANGDLL_ALLLANGUAGES ; Remember user's language selection and offer this as the default when re-installing *************** *** 1157,1190 **** #-------------------------------------------------------------------------- - # Installer Function: .onVerifyInstDir - # - # This function is called every time the user changes the installation directory. It ensures - # that the button used to start the installation process is labelled "Install" or "Upgrade" - # depending upon the currently selected directory. As this function is called EVERY time the - # directory is altered, the button text is only updated when a change is required. - # - # The '$G_PFIFLAG' global variable is initialized by 'CheckForExistingLocation' - # (the "pre" function for the PROGRAM DIRECTORY page). - #-------------------------------------------------------------------------- - - Function .onVerifyInstDir - - IfFileExists "$INSTDIR\popfile.pl" upgrade - StrCmp $G_PFIFLAG "install" exit - StrCpy $G_PFIFLAG "install" - GetDlgItem $G_DLGITEM $HWNDPARENT 1 - SendMessage $G_DLGITEM ${WM_SETTEXT} 0 "STR:$(^InstallBtn)" - Goto exit - - upgrade: - StrCmp $G_PFIFLAG "upgrade" exit - StrCpy $G_PFIFLAG "upgrade" - GetDlgItem $G_DLGITEM $HWNDPARENT 1 - SendMessage $G_DLGITEM ${WM_SETTEXT} 0 "STR:$(PFI_LANG_INST_BTN_UPGRADE)" - - exit: - FunctionEnd - - #-------------------------------------------------------------------------- # Installer Section: StartLog (this must be the very first section) # --- 1160,1163 ---- *************** *** 1201,1205 **** DetailPrint "Command-line: $CMDLINE" DetailPrint "User Details: $G_WINUSERNAME ($G_WINUSERTYPE)" ! DetailPrint "PFI Language: $LANGUAGE" DetailPrint "------------------------------------------------------------" Call PFI_GetDateTimeStamp --- 1174,1178 ---- DetailPrint "Command-line: $CMDLINE" DetailPrint "User Details: $G_WINUSERNAME ($G_WINUSERTYPE)" ! DetailPrint "PFI Language: $(^Language) ($LANGUAGE)" DetailPrint "------------------------------------------------------------" Call PFI_GetDateTimeStamp *************** *** 2001,2009 **** Function CheckForExistingLocation - ; Initialize the $G_PFIFLAG used by the '.onVerifyInstDir' function to avoid sending - ; unnecessary messages to change the text on the button used to start the installation - - StrCpy $G_PFIFLAG "" - ReadRegStr $INSTDIR HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "InstallPath" StrCmp $INSTDIR "" try_HKLM --- 1974,1977 ---- *************** *** 2345,2470 **** #-------------------------------------------------------------------------- - # Macro-based Function: NSIS2IO - # - # Convert an NSIS string to a form suitable for use by InstallOptions - # - # Inputs: - # (top of stack) - a string to be used on an InstallOptions page - # Outputs: - # (top of stack) - a safe version of the input which will be displayed correctly - # - # Usage: - # Push "C:\Install\Workshop\restore" ; InstallOptions treats '\r' as a CR char - # Call NSIS2IO - # Pop $R0 - # - # $R0 will now hold "C:\\Install\\Workshop\\restore" - # to make InstallOptions display "C:\Install\Workshop\restore" on one line - # instead of using two lines to display the string like this: - # C:\Install\Workshop - # estore - # - #-------------------------------------------------------------------------- - - !macro NSIS2IO UN - Function ${UN}NSIS2IO - - !define L_STRING $R0 ; the string to be converted - !define L_LENGTH $R1 ; length of string - !define L_OFFSET $R2 ; current character offset (offset 0 = first character) - !define L_CURRENT $R3 ; current character(s) from string - !define L_CONVERTED $R4 ; InstallOptions equivalent character-pair - - Exch ${L_STRING} - Push ${L_LENGTH} - Push ${L_OFFSET} - Push ${L_CURRENT} - Push ${L_CONVERTED} - - ; Get length of input string (use length so we can cope with MBCS strings; - ; the previous version of this function looped through the string until - ; a null byte ("") was found - this resulted in the truncation of some - ; MBCS strings) - - StrLen ${L_LENGTH} ${L_STRING} - - StrCpy ${L_OFFSET} -1 - - ; Loop until end of string is reached - - loop: - IntOp ${L_OFFSET} ${L_OFFSET} + 1 - IntCmp ${L_OFFSET} ${L_LENGTH} exit 0 exit - - ; Get the next character from the string - - StrCpy ${L_CURRENT} ${L_STRING} 1 ${L_OFFSET} - - ; Check if this is one of the characters that needs to be converted - - StrCmp ${L_CURRENT} "$\r" carriagereturn - StrCmp ${L_CURRENT} "$\n" linefeed - StrCmp ${L_CURRENT} "$\t" tab - StrCmp ${L_CURRENT} "\" backslash - Goto loop - - carriagereturn: - StrCpy ${L_CONVERTED} "\r" - Goto replace_char - - linefeed: - StrCpy ${L_CONVERTED} "\n" - Goto replace_char - - tab: - StrCpy ${L_CONVERTED} "\t" - Goto replace_char - - backslash: - StrCpy ${L_CONVERTED} "\\" - - replace_char: - StrCpy ${L_CURRENT} ${L_STRING} ${L_OFFSET} - IntOp ${L_OFFSET} ${L_OFFSET} + 1 - StrCpy ${L_STRING} ${L_STRING} "" ${L_OFFSET} - StrCpy ${L_STRING} "${L_CURRENT}${L_CONVERTED}${L_STRING}" - IntOp ${L_LENGTH} ${L_LENGTH} + 1 - Goto loop - - ; Return "InstallOptions-safe" string - - exit: - Pop ${L_CONVERTED} - Pop ${L_CURRENT} - Pop ${L_OFFSET} - Pop ${L_LENGTH} - Exch ${L_STRING} - - !undef L_STRING - !undef L_LENGTH - !undef L_OFFSET - !undef L_CURRENT - !undef L_CONVERTED - - FunctionEnd - !macroend - - #-------------------------------------------------------------------------- - # Installer Function: NSIS2IO - # - # This function is used during the installation process - #-------------------------------------------------------------------------- - - !insertmacro NSIS2IO "" - - #-------------------------------------------------------------------------- - # Uninstaller Function: un.NSIS2IO - # - # This function is used during the uninstall process - #-------------------------------------------------------------------------- - - !insertmacro NSIS2IO "un." - - #-------------------------------------------------------------------------- # End of 'installer.nsi' #-------------------------------------------------------------------------- --- 2313,2316 ---- |