From 8fb85aa737eb67225d2764a8eb389991a2016eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Wed, 9 Nov 2005 08:27:19 +0000 Subject: [PATCH] INTEGRATION: CWS sdkinstaller (1.4.8); FILE MERGED 2005/10/26 16:05:53 is 1.4.8.2: #126357# including help page 2005/10/24 15:45:09 is 1.4.8.1: #126357# new nsis parameters --- .../source/win32/nsis/downloadtemplate.nsi | 242 ++++++++++++++++-- 1 file changed, 223 insertions(+), 19 deletions(-) diff --git a/setup_native/source/win32/nsis/downloadtemplate.nsi b/setup_native/source/win32/nsis/downloadtemplate.nsi index 4f609cf794e9..3c75d64b7c63 100644 --- a/setup_native/source/win32/nsis/downloadtemplate.nsi +++ b/setup_native/source/win32/nsis/downloadtemplate.nsi @@ -10,20 +10,187 @@ SetCompressor zlib !include "MUI.nsh" Function .onInit -IfSilent onInitSilent onInitNoSilent -onInitSilent: - StrCpy $INSTDIR "$TEMP\PRODUCTPATHPLACEHOLDER Installation Files" -GoTo onInitDone + Call GetParameters + Pop $1 + ;MessageBox MB_OK "$1" -onInitNoSilent: - StrCpy $INSTDIR "$DESKTOP\PRODUCTPATHPLACEHOLDER Installation Files" -GoTo onInitDone + Push $1 + Push "/HELP=" + Call GetOptions + Pop $2 + ;MessageBox MB_OK "HELP: $2" -onInitDone: + StrCmp $2 "ON" showhelp nohelp + showhelp: + MessageBox MB_OK|MB_ICONINFORMATION \ + "DOWNLOADNAMEPLACEHOLDER options: $\n $\n \ + /S : Silent information $\n \ + /D= : NSIS installation directory (must be the last option!) $\n \ + /EXTRACTONLY=ON : NSIS only extracts the PRODUCTNAMEPLACEHOLDER PRODUCTVERSIONPLACEHOLDER installation set $\n \ + /INSTALLLOCATION= : PRODUCTNAMEPLACEHOLDER PRODUCTVERSIONPLACEHOLDER installation directory $\n \ + /POSTREMOVE=ON : Removes the unpacked installation set after PRODUCTNAMEPLACEHOLDER PRODUCTVERSIONPLACEHOLDER installation $\n \ + /HELP=ON : Shows this help $\n" + Quit + GoTo onInitDone + + nohelp: + + StrCmp $INSTDIR "" pathnotset pathset + pathnotset: + + IfSilent onInitSilent onInitNoSilent + + onInitSilent: + StrCpy $INSTDIR "$TEMP\PRODUCTPATHPLACEHOLDER Installation Files" + GoTo onInitDone + + onInitNoSilent: + StrCpy $INSTDIR "$DESKTOP\PRODUCTPATHPLACEHOLDER Installation Files" + GoTo onInitDone + + onInitDone: + pathset: FunctionEnd +Function 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 + +Function GetOptions + + Exch $1 + Exch + Exch $0 + Exch + Push $2 + Push $3 + Push $4 + Push $5 + Push $6 + Push $7 + + StrCpy $2 $1 '' 1 + StrCpy $1 $1 1 + StrLen $3 $2 + StrCpy $7 0 + + begin: + StrCpy $4 -1 + StrCpy $6 '' + + quote: + IntOp $4 $4 + 1 + StrCpy $5 $0 1 $4 + StrCmp $5$7 '0' notfound + StrCmp $5 '' trimright + StrCmp $5 '"' 0 +7 + StrCmp $6 '' 0 +3 + StrCpy $6 '"' + goto quote + StrCmp $6 '"' 0 +3 + StrCpy $6 '' + goto quote + StrCmp $5 `'` 0 +7 + StrCmp $6 `` 0 +3 + StrCpy $6 `'` + goto quote + StrCmp $6 `'` 0 +3 + StrCpy $6 `` + goto quote + StrCmp $5 '`' 0 +7 + StrCmp $6 '' 0 +3 + StrCpy $6 '`' + goto quote + StrCmp $6 '`' 0 +3 + StrCpy $6 '' + goto quote + StrCmp $6 '"' quote + StrCmp $6 `'` quote + StrCmp $6 '`' quote + StrCmp $5 $1 0 quote + StrCmp $7 0 trimleft trimright + + trimleft: + IntOp $4 $4 + 1 + StrCpy $5 $0 $3 $4 + StrCmp $5 '' notfound + StrCmp $5 $2 0 quote + IntOp $4 $4 + $3 + StrCpy $0 $0 '' $4 + StrCpy $4 $0 1 + StrCmp $4 ' ' 0 +3 + StrCpy $0 $0 '' 1 + goto -3 + StrCpy $7 1 + goto begin + + trimright: + StrCpy $0 $0 $4 + StrCpy $4 $0 1 -1 + StrCmp $4 ' ' 0 +3 + StrCpy $0 $0 -1 + goto -3 + StrCpy $3 $0 1 + StrCpy $4 $0 1 -1 + StrCmp $3 $4 0 end + StrCmp $3 '"' +3 + StrCmp $3 `'` +2 + StrCmp $3 '`' 0 end + StrCpy $0 $0 -1 1 + goto end + + notfound: + StrCpy $0 '' + + end: + Pop $7 + Pop $6 + Pop $5 + Pop $4 + Pop $3 + Pop $2 + Pop $1 + Exch $0 + +FunctionEnd + ; MUI Settings !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_RIGHT @@ -74,19 +241,56 @@ SectionEnd Section -Post -IfSilent onPostSilent onPostNoSilent + Call GetParameters + Pop $1 -onPostSilent: - ExecWait "$INSTDIR\setup.exe -lang $LANGUAGE /qr -ignore_running" - RMDir /r $INSTDIR - RMDir $INSTDIR -GoTo onPostDone + Push $1 + Push "/EXTRACTONLY=" + Call GetOptions + Pop $2 + ;MessageBox MB_OK "EXTRACTONLY: $2" -onPostNoSilent: - Exec "$INSTDIR\setup.exe -lang $LANGUAGE" - Quit -GoTo onPostDone + StrCmp $2 "ON" onPostDone callsetup + callsetup: + + Push $1 + Push "/INSTALLLOCATION=" + Call GetOptions + Pop $2 + ;MessageBox MB_OK "INSTALLLOCATION: $2" -onPostDone: + StrCmp $2 "" installnotset installset + installset: + StrCpy $3 'INSTALLLOCATION="$2"' + installnotset: + + IfSilent onPostSilent onPostNoSilent + + onPostSilent: + ExecWait "$INSTDIR\setup.exe -lang $LANGUAGE /qr -ignore_running" + RMDir /r $INSTDIR + RMDir $INSTDIR + GoTo onPostDone + + onPostNoSilent: + Push $1 + Push "/POSTREMOVE=" + Call GetOptions + Pop $2 + ;MessageBox MB_OK "POSTREMOVE: $2" + + StrCmp $2 "ON" postremove nopostremove + nopostremove: + Exec "$INSTDIR\setup.exe -lang $LANGUAGE $3" + Quit + GoTo onPostDone + postremove: + ExecWait "$INSTDIR\setup.exe -lang $LANGUAGE $3" + RMDir /r $INSTDIR + RMDir $INSTDIR + Quit + GoTo onPostDone + + onPostDone: SectionEnd