X-Git-Url: https://git.gag.com/?p=fw%2Fsdcc;a=blobdiff_plain;f=support%2Fscripts%2Fsdcc.nsi;h=fcad17a8b36d78e4f5f2540d492caa37f58afcd0;hp=dd5d0073a6e0cee82d836cca5c406726cdbd9f03;hb=a8df0838af9bf5d521eac7f34da9c296fb64340e;hpb=a5a8b6f557e3ed1858018a676c5c8e57745a2f89 diff --git a/support/scripts/sdcc.nsi b/support/scripts/sdcc.nsi index dd5d0073..fcad17a8 100644 --- a/support/scripts/sdcc.nsi +++ b/support/scripts/sdcc.nsi @@ -1,6 +1,6 @@ # sdcc.nsi - NSIS installer script for SDCC # -# Copyright (c) 2003-2008 Borut Razem +# Copyright (c) 2003-2009 Borut Razem # # This file is part of sdcc. # @@ -93,7 +93,7 @@ StrCpy $SDCC.StrStack2 $SDCC.StrStack1 StrCpy $SDCC.StrStack1 $SDCC.StrStack0 StrCpy $SDCC.StrStack0 $SDCC.FunctionName - StrCpy $SDCC.FunctionName ${NAME} + StrCpy $SDCC.FunctionName "${NAME}" !macroend !define SDCC.PopStr "!insertmacro MACRO_SDCC_PopStr" @@ -219,7 +219,7 @@ Var SDCC.PathToRemove !insertmacro MUI_PAGE_WELCOME ; License page -!insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.TXT" +!insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.txt" ; Uninstall/reinstall page !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD @@ -255,10 +255,15 @@ ${Function} SDCC.InstFilesLeave ${EndIf} ${FunctionEnd} -; Finish page +; Finish page - add to path +!define MUI_FINISHPAGE_TEXT "Confirm the checkbox if you want to add SDCC binary directory to the PATH environment variable" !define MUI_FINISHPAGE_SHOWREADME_TEXT "Add $INSTDIR\bin to the PATH" !define MUI_FINISHPAGE_SHOWREADME_FUNCTION SDCC.AddBinToPath !define MUI_FINISHPAGE_SHOWREADME +!define MUI_FINISHPAGE_BUTTON "Next" +!insertmacro MUI_PAGE_FINISH + +; Finish page - reboot !insertmacro MUI_PAGE_FINISH ${Function} SDCC.AddBinToPath @@ -271,6 +276,7 @@ ${FunctionEnd} ; Uninstaller pages !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH ; Language files !insertmacro MUI_LANGUAGE "English" @@ -301,7 +307,7 @@ ${Function} .onInit uninst: ; Run the uninstaller ClearErrors - ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file + ExecWait '$R0' Goto done inst: @@ -345,7 +351,7 @@ ${FunctionEnd} ${Section} -Common SECCOMMON SetOutPath "$INSTDIR" File ".\sdcc.ico" - File "${SDCC_ROOT}\COPYING.TXT" + File "${SDCC_ROOT}\COPYING.txt" ${SectionEnd} ${Section} "SDCC application files" SEC01 @@ -356,6 +362,7 @@ ${Section} "SDCC application files" SEC01 File "${SDCC_ROOT}\bin\as-z80.exe" File "${SDCC_ROOT}\bin\asx8051.exe" File "${SDCC_ROOT}\bin\aslink.exe" + File "${SDCC_ROOT}\bin\asranlib.exe" File "${SDCC_ROOT}\bin\link-gbz80.exe" File "${SDCC_ROOT}\bin\link-hc08.exe" File "${SDCC_ROOT}\bin\link-z80.exe" @@ -420,6 +427,7 @@ ${Section} "SDCC include files" SEC05 File "${DEV_ROOT}\include\pic\*.inc" SetOutPath "$INSTDIR\include\pic16" File "${DEV_ROOT}\include\pic16\*.h" + File "${DEV_ROOT}\include\pic16\*.txt" SetOutPath "$INSTDIR\include\z80" File "${DEV_ROOT}\include\z80\*.h" SetOutPath "$INSTDIR\include" @@ -429,64 +437,55 @@ ${SectionEnd} ${Section} "SDCC DS390 library" SEC06 SectionIn 1 2 SetOutPath "$INSTDIR\lib\ds390" - File "${DEV_ROOT}\lib\ds390\*.rel" - File "${DEV_ROOT}\lib\ds390\*.lib" + File "${DEV_ROOT}\lib\ds390\*.*" ${SectionEnd} ${Section} "SDCC DS400 library" SEC07 SectionIn 1 2 SetOutPath "$INSTDIR\lib\ds400" - File "${DEV_ROOT}\lib\ds400\*.rel" - File "${DEV_ROOT}\lib\ds400\*.lib" + File "${DEV_ROOT}\lib\ds400\*.*" ${SectionEnd} ${Section} "SDCC GBZ80 library" SEC08 SectionIn 1 2 SetOutPath "$INSTDIR\lib\gbz80" - File "${DEV_ROOT}\lib\gbz80\*.o" - File "${DEV_ROOT}\lib\gbz80\*.lib" + File "${DEV_ROOT}\lib\gbz80\*.*" ${SectionEnd} ${Section} "SDCC Z80 library" SEC09 SectionIn 1 2 SetOutPath "$INSTDIR\lib\z80" - File "${DEV_ROOT}\lib\z80\*.o" - File "${DEV_ROOT}\lib\z80\*.lib" + File "${DEV_ROOT}\lib\z80\*.*" ${SectionEnd} ${Section} "SDCC small model library" SEC10 SectionIn 1 2 SetOutPath "$INSTDIR\lib\small" - File "${DEV_ROOT}\lib\small\*.rel" - File "${DEV_ROOT}\lib\small\*.lib" + File "${DEV_ROOT}\lib\small\*.*" ${SectionEnd} ${Section} "SDCC medium model library" SEC11 SectionIn 1 2 SetOutPath "$INSTDIR\lib\medium" - File "${DEV_ROOT}\lib\medium\*.rel" - File "${DEV_ROOT}\lib\medium\*.lib" + File "${DEV_ROOT}\lib\medium\*.*" ${SectionEnd} ${Section} "SDCC large model library" SEC12 SectionIn 1 2 SetOutPath "$INSTDIR\lib\large" - File "${DEV_ROOT}\lib\large\*.rel" - File "${DEV_ROOT}\lib\large\*.lib" + File "${DEV_ROOT}\lib\large\*.*" ${SectionEnd} ${Section} "SDCC small-stack-auto model library" SEC13 SectionIn 1 2 SetOutPath "$INSTDIR\lib\small-stack-auto" - File "${DEV_ROOT}\lib\small-stack-auto\*.rel" - File "${DEV_ROOT}\lib\small-stack-auto\*.lib" + File "${DEV_ROOT}\lib\small-stack-auto\*.*" ${SectionEnd} ${Section} "SDCC HC08 library" SEC14 SectionIn 1 2 SetOutPath "$INSTDIR\lib\hc08" - File "${DEV_ROOT}\lib\hc08\*.rel" - File "${DEV_ROOT}\lib\hc08\*.lib" + File "${DEV_ROOT}\lib\hc08\*.*" ${SectionEnd} ${Section} "SDCC PIC16 library" SEC15 @@ -521,7 +520,6 @@ ${Section} "SDCC library sources" SEC17 # File "${DEV_ROOT}\lib\src\gbz80\Makefile" SetOutPath "$INSTDIR\lib\src\z80" - File "${DEV_ROOT}\lib\src\z80\*.c" File "${DEV_ROOT}\lib\src\z80\*.s" # File "${DEV_ROOT}\lib\src\z80\Makefile" @@ -733,25 +731,23 @@ LangString DESC_SEC17 ${LANG_ENGLISH} "SDCC library sources" ${Section} -Icons SECICONS !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE" - CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" "$INSTDIR\sdcc.url" CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" "$INSTDIR\uninstall.exe" !ifdef FULL_DOC CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\sdccman.pdf" "" "$INSTDIR\sdcc.ico" "" "" "" "" CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\README.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" "" - CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Latest Changes.lnk" "$INSTDIR\change_log.url" CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog.txt" "" "$INSTDIR\sdcc.ico" "" "" "" "" !else CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" "" CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog_head.txt" "" "$INSTDIR\sdcc.ico" "" "" "" "" !endif - CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.TXT" + CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.txt" !insertmacro MUI_STARTMENU_WRITE_END ${SectionEnd} ${Section} -INI SECINI - WriteIniStr "$INSTDIR\sdcc.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/" + WriteIniStr "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/" !ifdef FULL_DOC - WriteIniStr "$INSTDIR\change_log.url" "InternetShortcut" "URL" "http://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc/ChangeLog" + WriteIniStr "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Latest Changes.url" "InternetShortcut" "URL" "http://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc/ChangeLog" !endif ${SectionEnd} @@ -781,15 +777,23 @@ ${SectionEnd} ${Section} Uninstall SECUNINSTALL !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_STARTMENUPAGE_VARIABLE + ${DebugMsg} "removing path $INSTDIR\bin" + Push "$INSTDIR\bin" + Call un.SDCC.RemoveFromPath + +; Clean the registry + DeleteRegKey ${UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" + DeleteRegKey ${SDCC_ROOT_KEY} "Software\${PRODUCT_NAME}" + Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" - Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Latest Changes.lnk" !ifdef FULL_DOC + Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Latest Changes.url" Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\README.lnk" !endif Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" - Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" + Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.url" RMDir "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE" @@ -807,7 +811,6 @@ ${Section} Uninstall SECUNINSTALL Delete "$INSTDIR\lib\src\hc08\hc08.lib" Delete "$INSTDIR\lib\src\hc08\Makefile" - Delete "$INSTDIR\lib\src\z80\*.c" Delete "$INSTDIR\lib\src\z80\*.s" Delete "$INSTDIR\lib\src\z80\z80.lib" Delete "$INSTDIR\lib\src\z80\README" @@ -832,37 +835,28 @@ ${Section} Uninstall SECUNINSTALL Delete "$INSTDIR\lib\src\*.c" - Delete "$INSTDIR\lib\pic\*.o" Delete "$INSTDIR\lib\pic\*.lib" Delete "$INSTDIR\lib\pic16\*.o" Delete "$INSTDIR\lib\pic16\*.lib" - Delete "$INSTDIR\lib\hc08\*.rel" Delete "$INSTDIR\lib\hc08\*.lib" Delete "$INSTDIR\lib\z80\*.o" Delete "$INSTDIR\lib\z80\*.lib" - Delete "$INSTDIR\lib\small\*.rel" Delete "$INSTDIR\lib\small\*.lib" - Delete "$INSTDIR\lib\medium\*.rel" Delete "$INSTDIR\lib\medium\*.lib" - Delete "$INSTDIR\lib\large\*.rel" Delete "$INSTDIR\lib\large\*.lib" - Delete "$INSTDIR\lib\small-stack-auto\*.rel" Delete "$INSTDIR\lib\small-stack-auto\*.lib" - Delete "$INSTDIR\lib\gbz80\*.o" Delete "$INSTDIR\lib\gbz80\*.lib" - Delete "$INSTDIR\lib\ds390\*.rel" Delete "$INSTDIR\lib\ds390\*.lib" - Delete "$INSTDIR\lib\ds400\*.rel" Delete "$INSTDIR\lib\ds400\*.lib" Delete "$INSTDIR\include\asm\z80\*.h" @@ -877,6 +871,7 @@ ${Section} Uninstall SECUNINSTALL Delete "$INSTDIR\include\pic\*.txt" Delete "$INSTDIR\include\pic\*.inc" Delete "$INSTDIR\include\pic16\*.h" + Delete "$INSTDIR\include\pic16\*.txt" Delete "$INSTDIR\include\mcs51\*.h" Delete "$INSTDIR\include\hc08\*.h" Delete "$INSTDIR\include\*.h" @@ -891,6 +886,7 @@ ${Section} Uninstall SECUNINSTALL Delete "$INSTDIR\bin\as-z80.exe" Delete "$INSTDIR\bin\asx8051.exe" Delete "$INSTDIR\bin\aslink.exe" + Delete "$INSTDIR\bin\asranlib.exe" Delete "$INSTDIR\bin\link-gbz80.exe" Delete "$INSTDIR\bin\link-hc08.exe" Delete "$INSTDIR\bin\link-z80.exe" @@ -911,12 +907,8 @@ ${Section} Uninstall SECUNINSTALL Delete "$INSTDIR\bin\sdcdb.el" Delete "$INSTDIR\bin\sdcdbsrc.el" - Delete "$INSTDIR\COPYING.TXT" + Delete "$INSTDIR\COPYING.txt" Delete "$INSTDIR\sdcc.ico" - Delete "$INSTDIR\sdcc.url" -!ifdef FULL_DOC - Delete "$INSTDIR\change_log.url" -!endif Delete "$INSTDIR\uninstall.exe" RMDir /r "$INSTDIR\lib\src\pic" @@ -970,14 +962,6 @@ ${Section} Uninstall SECUNINSTALL RMDir "$INSTDIR\bin" RMDir "$INSTDIR" - - ${DebugMsg} "removing path $INSTDIR\bin" - Push "$INSTDIR\bin" - Call un.SDCC.RemoveFromPath - -; Clean the registry - DeleteRegKey ${UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" - DeleteRegKey ${SDCC_ROOT_KEY} "Software\${PRODUCT_NAME}" ;;;; SetAutoClose true ${SectionEnd} @@ -1030,8 +1014,10 @@ ${Function} SDCC.AddToPath ${If} $2 = 26 ; DOS EOF FileSeek $1 -1 END ; write over EOF ${Endif} + ${DebugMsg} "adding line $\r$\nSET PATH=%PATH%;$3$\r$\n" FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n" FileClose $1 + ${DebugMsg} "SetRebootFlag true" SetRebootFlag true ${Else} ;System PATH variable is at: @@ -1104,6 +1090,8 @@ ${Function} ${un}SDCC.RemoveFromPath ${Else} ; This is the line I'm looking for: ; don't copy it + ${DebugMsg} "removing line $0" + ${DebugMsg} "SetRebootFlag true" SetRebootFlag true Goto nextLine ${EndIf} @@ -1301,11 +1289,17 @@ ${Function} SDCC.PageLeaveReinstall ;Run uninstaller HideWindow - ClearErrors - ExecWait '$R1 _?=$INSTDIR' - ${If} $R0 == "2" + ; Uninstall only: uninstaller should be removed + ClearErrors + ; ExecWait doesn't wait if _?=$INSTDIR is not defined! + ExecWait '$R1' Quit + ${Else} + ; Uninstal & Reinstall: uninstaller will be rewritten + ClearErrors + ; ExecWait doesn't wait if _?=$INSTDIR is not defined! + ExecWait '$R1 _?=$INSTDIR' ${EndIf} BringToFront