Update of /cvsroot/popfile/windows
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20603
Modified Files:
installer.nsi
Log Message:
Ensure that the "summary" page does not show a garbled installation path
when the path contains any of the InstallOptions2 escape sequences
(e.g. "C:\Program Files\new POPFile" contains the "\n" escape sequence)
Index: installer.nsi
===================================================================
RCS file: /cvsroot/popfile/windows/installer.nsi,v
retrieving revision 1.257
retrieving revision 1.258
diff -C2 -d -r1.257 -r1.258
*** installer.nsi 4 Mar 2005 14:44:23 -0000 1.257
--- installer.nsi 1 Jul 2005 09:51:31 -0000 1.258
***************
*** 1488,1491 ****
--- 1488,1497 ----
!define C_NLT "${IO_NL}\t"
+ ; Convert the installation pathname into a string which is safe to use in the summary page
+
+ Push $G_ROOTDIR
+ Call NSIS2IO
+ Pop $G_PLS_FIELD_2
+
IfFileExists "$G_ROOTDIR\popfile.pl" upgrade
StrCpy ${L_TEMP} "$(PFI_LANG_SUMMARY_NEWLOCN)"
***************
*** 2025,2028 ****
--- 2031,2092 ----
#--------------------------------------------------------------------------
+ # Installer 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"
+ # instead of "C:\Install\Workshop
+ # estore")
+ #
+ #--------------------------------------------------------------------------
+
+ Function NSIS2IO
+ Exch $0 ; The source
+ Push $1 ; The output
+ Push $2 ; Temporary char
+ StrCpy $1 "" ; Initialise the output
+
+ loop:
+ StrCpy $2 $0 1 ; Get the next source char
+ StrCmp $2 "" done ; Abort when none left
+ StrCpy $0 $0 "" 1 ; Remove it from the source
+ StrCmp $2 "\" "" +3 ; Back-slash?
+ StrCpy $1 "$1\\"
+ Goto loop
+
+ StrCmp $2 "$\r" "" +3 ; Carriage return?
+ StrCpy $1 "$1\r"
+ Goto loop
+
+ StrCmp $2 "$\n" "" +3 ; Line feed?
+ StrCpy $1 "$1\n"
+ Goto loop
+
+ StrCmp $2 "$\t" "" +3 ; Tab?
+ StrCpy $1 "$1\t"
+ Goto loop
+
+ StrCpy $1 "$1$2" ; Anything else
+ Goto loop
+
+ done:
+ StrCpy $0 $1
+ Pop $2
+ Pop $1
+ Exch $0
+ FunctionEnd
+
+ #--------------------------------------------------------------------------
# End of 'installer.nsi'
#--------------------------------------------------------------------------
|