* support/scripts/sdcc.nsi:
[fw/sdcc] / support / scripts / sdcc.nsi
index faf9895ba8683de8950820c2046f98cf8f2c2df9..fcad17a8b36d78e4f5f2540d492caa37f58afcd0 100644 (file)
@@ -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.
 #
@@ -256,7 +256,7 @@ ${Function} SDCC.InstFilesLeave
 ${FunctionEnd}
 
 ; Finish page - add to path
-!define MUI_FINISHPAGE_TEXT "Confirm the checkbox if you won to add SDCC binary directory to the PATH environment variable"
+!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
@@ -362,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"
@@ -436,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
@@ -528,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"
 
@@ -820,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"
@@ -845,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"
@@ -890,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"
@@ -904,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"
@@ -1306,12 +1289,17 @@ ${Function} SDCC.PageLeaveReinstall
   ;Run uninstaller
   HideWindow
 
-  ClearErrors
-  ; ExecWait doesn't wait if _?=$INSTDIR is not defined!
-  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