From: Brian S. <xue...@us...> - 2007-10-14 17:24:18
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18760 Modified Files: Tag: b0_22_2 pfi-library.nsh Log Message: Updated to cope with the uninstaller being changed to allow it to modify an existing installation. Index: pfi-library.nsh =================================================================== RCS file: /cvsroot/popfile/windows/pfi-library.nsh,v retrieving revision 1.53.4.9 retrieving revision 1.53.4.10 diff -C2 -d -r1.53.4.9 -r1.53.4.10 *** pfi-library.nsh 5 Oct 2007 18:39:24 -0000 1.53.4.9 --- pfi-library.nsh 14 Oct 2007 17:24:20 -0000 1.53.4.10 *************** *** 59,63 **** #-------------------------------------------------------------------------- ! !define C_PFI_LIBRARY_VERSION "0.3.1" #-------------------------------------------------------------------------- --- 59,63 ---- #-------------------------------------------------------------------------- ! !define C_PFI_LIBRARY_VERSION "0.3.4" #-------------------------------------------------------------------------- *************** *** 411,415 **** # # Installer Function: PFI_GetIEVersion - # Installer Function: PFI_GetParameters # Installer Function: PFI_GetRoot # Installer Function: PFI_GetSeparator --- 411,414 ---- *************** *** 527,590 **** - !ifndef BACKUP - #-------------------------------------------------------------------------- - # Installer Function: PFI_GetParameters - # - # Returns the command-line parameters (if any) supplied when the installer was started - # - # Inputs: - # none - # Outputs: - # (top of stack) - all of the parameters supplied on the command line (may be "") - # - # Usage: - # Call PFI_GetParameters - # Pop $R0 - # - # (if 'setup.exe /SSL' was used to start the installer, $R0 will hold '/SSL') - # - #-------------------------------------------------------------------------- - - Function PFI_GetParameters - - Push $R0 - Push $R1 - Push $R2 - Push $R3 - - StrCpy $R2 1 - StrLen $R3 $CMDLINE - - ; Check for quote or space - - StrCpy $R0 $CMDLINE $R2 - StrCmp $R0 '"' 0 +3 - StrCpy $R1 '"' - Goto loop - - StrCpy $R1 " " - - loop: - IntOp $R2 $R2 + 1 - StrCpy $R0 $CMDLINE 1 $R2 - StrCmp $R0 $R1 get - StrCmp $R2 $R3 get - Goto loop - - get: - IntOp $R2 $R2 + 1 - StrCpy $R0 $CMDLINE 1 $R2 - StrCmp $R0 " " get - StrCpy $R0 $CMDLINE "" $R2 - - Pop $R3 - Pop $R2 - Pop $R1 - Exch $R0 - - FunctionEnd - !endif - - !ifdef ADDUSER | INSTALLER | RESTORE #-------------------------------------------------------------------------- --- 526,529 ---- *************** *** 1019,1022 **** --- 958,965 ---- # Uninstaller Function: un.PFI_GetMessagesPath # + # Macro: PFI_GetParameters + # Installer Function: PFI_GetParameters + # Uninstaller Function: un.PFI_GetParameters + # # Macro: PFI_GetParent # Installer Function: PFI_GetParent *************** *** 2796,2799 **** --- 2739,2831 ---- #-------------------------------------------------------------------------- + # Macro: PFI_GetParameters + # + # The installation process and the uninstall process may need a function which extracts + # the parameters (if any) supplied on the command-line. This macro makes maintenance + # easier by ensuring that both processes use identical functions, with the only difference + # being their names. + # + # NOTE: + # The !insertmacro PFI_GetParameters "" and !insertmacro PFI_GetParameters "un." commands are + # included in this file so the NSIS script can use 'Call PFI_GetParameters' and + # 'Call un.PFI_GetParameters' without additional preparation. + # + # Inputs: + # none + # + # Outputs: + # top of stack) - all of the parameters supplied on the command line (may be "") + # + # Usage (after macro has been 'inserted'): + # + # Call PFI_GetParameters + # Pop $R0 + # + # (if 'setup.exe /SSL' was used to start the installer, $R0 will hold '/SSL') + #-------------------------------------------------------------------------- + + !macro PFI_GetParameters UN + Function ${UN}PFI_GetParameters + + Push $R0 + Push $R1 + Push $R2 + Push $R3 + + StrCpy $R2 1 + StrLen $R3 $CMDLINE + + ; Check for quote or space + + StrCpy $R0 $CMDLINE $R2 + StrCmp $R0 '"' 0 +3 + StrCpy $R1 '"' + Goto loop + + StrCpy $R1 " " + + loop: + IntOp $R2 $R2 + 1 + StrCpy $R0 $CMDLINE 1 $R2 + StrCmp $R0 $R1 get + StrCmp $R2 $R3 get + Goto loop + + get: + IntOp $R2 $R2 + 1 + StrCpy $R0 $CMDLINE 1 $R2 + StrCmp $R0 " " get + StrCpy $R0 $CMDLINE "" $R2 + + Pop $R3 + Pop $R2 + Pop $R1 + Exch $R0 + + FunctionEnd + !macroend + + !ifndef BACKUP + #-------------------------------------------------------------------------- + # Installer Function: PFI_GetParameters + # + # This function is used during the installation process + #-------------------------------------------------------------------------- + + !insertmacro PFI_GetParameters "" + !endif + + !ifdef INSTALLER + #-------------------------------------------------------------------------- + # Uninstaller Function: un.PFI_GetParameters + # + # This function is used during the uninstall process + #-------------------------------------------------------------------------- + + !insertmacro PFI_GetParameters "un." + !endif + + + #-------------------------------------------------------------------------- # Macro: PFI_GetParent # *************** *** 4227,4231 **** !endif ! !ifdef ADDUSER #-------------------------------------------------------------------------- # Uninstaller Function: un.PFI_StrBackSlash --- 4259,4263 ---- !endif ! !ifdef ADDUSER | INSTALLER #-------------------------------------------------------------------------- # Uninstaller Function: un.PFI_StrBackSlash *************** *** 4631,4635 **** !endif ! !ifdef ADDUSER #-------------------------------------------------------------------------- # Uninstaller Function: un.PFI_WaitUntilUnlocked --- 4663,4667 ---- !endif ! !ifdef ADDUSER | INSTALLER #-------------------------------------------------------------------------- # Uninstaller Function: un.PFI_WaitUntilUnlocked |