1 # sdcc.nsi - NSIS installer script for SDCC
3 # Copyright (c) 2003-2006 Borut Razem
5 # This file is part of sdcc.
7 # This software is provided 'as-is', without any express or implied
8 # warranty. In no event will the authors be held liable for any damages
9 # arising from the use of this software.
11 # Permission is granted to anyone to use this software for any purpose,
12 # including commercial applications, and to alter it and redistribute it
13 # freely, subject to the following restrictions:
15 # 1. The origin of this software must not be misrepresented; you must not
16 # claim that you wrote the original software. If you use this software
17 # in a product, an acknowledgment in the product documentation would be
18 # appreciated but is not required.
19 # 2. Altered source versions must be plainly marked as such, and must not be
20 # misrepresented as being the original software.
21 # 3. This notice may not be removed or altered from any source distribution.
24 # borut.razem@siol.net
26 # How to create WIN32 setup.exe
28 # - unpack WIN32 mingw daily snapshot sdcc-snapshot-i586-mingw32msvc-yyyymmdd.zip
29 # to a clean directory (the option to create directories should be enabled).
30 # A sub directory sdcc is created (referenced as PKGDIR in continuation).
31 # - copy files sdcc/support/scripts/sdcc.ico and sdcc/support/scripts/sdcc.nsi
32 # (this file) from the sdcc Subversion snapshot to the PKGDIR directory
33 # - copy file COPYING from the sdcc Subversion snapshot to the PKGDIR directory,
34 # rename it to COPYING.TXT and convert file COPYING to DOS format:
35 # unix2dos COPYING.TXT
36 # - run NSIS installer from PKGDIR directory:
37 # "c:\Program Files\NSIS\makensis.exe" sdcc.nsi
38 # - A setup file setup.exe is created in PKGDIR directory.
39 # Rename it to sdcc_yyyymmdd_setup.exe and upload it
40 # to sdcc download repository at sourceforge.net
43 # How to upload secc setup.exe tosourceforge.net
45 # Execute following commands from the cmd prompt:
46 # - sftp sdcc.sourceforge.net
47 # - cd /home/groups/s/sd/sdcc/htdocs/snapshots/i586-mingw32msvc-setup
48 # - put sdcc_yyyymmdd_setup.exe
54 SetCompressor /SOLID lzma
58 !define DEV_ROOT "${SDCC_ROOT}"
60 !system "unix2dos ${SDCC_ROOT}\doc\ChangeLog_head.txt" = 0
61 !system "unix2dos ${SDCC_ROOT}\doc\README.TXT" = 0
63 InstType "Full (Bin, ucSim, SDCDB, Doc, Lib, Src)"
64 InstType "Medium (Bin, ucSim, SDCDB, Doc, Lib)"
65 InstType "Compact (Bin, ucSim, SDCDB, Doc)"
67 ;--------------------------------
70 Var MUI_STARTMENUPAGE_VARIABLE
72 ;--------------------------------
73 !define MUI_ABORTWARNING
75 !insertmacro MUI_PAGE_WELCOME
76 !insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.TXT"
77 !define MUI_STARTMENUPAGE_DEFAULTFOLDER "SDCC"
78 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
79 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC"
80 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
81 !define MUI_STARTMENUPAGE_NODISABLE
82 !insertmacro MUI_PAGE_STARTMENU Application $MUI_STARTMENUPAGE_VARIABLE
83 !insertmacro MUI_PAGE_COMPONENTS
84 !insertmacro MUI_PAGE_DIRECTORY
85 !insertmacro MUI_PAGE_INSTFILES
86 !insertmacro MUI_PAGE_FINISH
88 !insertmacro MUI_UNPAGE_INSTFILES
90 !insertmacro MUI_LANGUAGE "English"
95 InstallDir "$PROGRAMFILES\SDCC"
97 ShowUnInstDetails show
100 ;Uninstall the old version, if present
101 ReadRegStr $R0 HKLM \
102 "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" \
106 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
107 "$(^Name) is already installed. $\n$\nClick 'OK' to remove the \
108 previous version or 'Cancel' to cancel this upgrade." \
113 ; Run the uninstaller
115 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
117 ;IfErrors no_remove_uninstaller
118 ; ;You can either use Delete /REBOOTOK in the uninstaller or add some code
119 ; ;here to remove to remove the uninstaller. Use a registry key to check
120 ; ;whether the user has chosen to uninstall. If you are using an uninstaller
121 ; ;components page, make sure all sections are uninstalled.
122 ;no_remove_uninstaller:
127 ; Install the new version
128 MessageBox MB_YESNO|MB_ICONQUESTION "This will install $(^Name). Do you wish to continue?" IDYES +2
135 SetOutPath "$INSTDIR"
137 File "${SDCC_ROOT}\COPYING.TXT"
140 Section "SDCC application files"
142 SetOutPath "$INSTDIR\bin"
143 File "${SDCC_ROOT}\bin\as-gbz80.exe"
144 File "${SDCC_ROOT}\bin\as-hc08.exe"
145 File "${SDCC_ROOT}\bin\as-z80.exe"
146 File "${SDCC_ROOT}\bin\asx8051.exe"
147 File "${SDCC_ROOT}\bin\aslink.exe"
148 File "${SDCC_ROOT}\bin\link-gbz80.exe"
149 File "${SDCC_ROOT}\bin\link-hc08.exe"
150 File "${SDCC_ROOT}\bin\link-z80.exe"
151 File "${SDCC_ROOT}\bin\makebin.exe"
152 File "${SDCC_ROOT}\bin\packihx.exe"
153 File "${SDCC_ROOT}\bin\sdcc.exe"
154 File "${SDCC_ROOT}\bin\sdcclib.exe"
155 File "${SDCC_ROOT}\bin\sdcpp.exe"
158 Section "ucSim application files"
160 SetOutPath "$INSTDIR\bin"
161 File "${SDCC_ROOT}\bin\s51.exe"
162 File "${SDCC_ROOT}\bin\savr.exe"
163 File "${SDCC_ROOT}\bin\shc08.exe"
164 File "${SDCC_ROOT}\bin\sz80.exe"
167 Section "SDCDB files"
169 File "${SDCC_ROOT}\bin\sdcdb.exe"
170 File "${SDCC_ROOT}\bin\sdcdb.el"
171 File "${SDCC_ROOT}\bin\sdcdbsrc.el"
174 Section "SDCC documentation"
176 SetOutPath "$INSTDIR\doc"
178 File /r "${SDCC_ROOT}\doc\*"
180 File "${SDCC_ROOT}\doc\ChangeLog_head.txt"
181 File "${SDCC_ROOT}\doc\README.TXT"
185 Section "SDCC include files"
187 SetOutPath "$INSTDIR\include\asm\default"
188 File "${DEV_ROOT}\include\asm\default\features.h"
189 SetOutPath "$INSTDIR\include\asm\ds390"
190 File "${DEV_ROOT}\include\asm\ds390\features.h"
191 SetOutPath "$INSTDIR\include\asm\gbz80"
192 File "${DEV_ROOT}\include\asm\gbz80\features.h"
193 SetOutPath "$INSTDIR\include\asm\mcs51"
194 File "${DEV_ROOT}\include\asm\mcs51\features.h"
195 SetOutPath "$INSTDIR\include\asm\pic"
196 File "${DEV_ROOT}\include\asm\pic\features.h"
197 SetOutPath "$INSTDIR\include\asm\pic16"
198 File "${DEV_ROOT}\include\asm\pic16\features.h"
199 SetOutPath "$INSTDIR\include\asm\z80"
200 File "${DEV_ROOT}\include\asm\z80\features.h"
201 SetOutPath "$INSTDIR\include\hc08"
202 File "${DEV_ROOT}\include\hc08\*.h"
203 SetOutPath "$INSTDIR\include\mcs51"
204 File "${DEV_ROOT}\include\mcs51\*.h"
205 SetOutPath "$INSTDIR\include\pic"
206 File "${DEV_ROOT}\include\pic\*.h"
207 File "${DEV_ROOT}\include\pic\*.txt"
208 File "${DEV_ROOT}\include\pic\*.inc"
209 SetOutPath "$INSTDIR\include\pic16"
210 File "${DEV_ROOT}\include\pic16\*.h"
211 SetOutPath "$INSTDIR\include\z80"
212 File "${DEV_ROOT}\include\z80\*.h"
213 SetOutPath "$INSTDIR\include"
214 File "${DEV_ROOT}\include\*.h"
217 Section "SDCC DS390 library"
219 SetOutPath "$INSTDIR\lib\ds390"
220 File "${DEV_ROOT}\lib\ds390\*.rel"
221 File "${DEV_ROOT}\lib\ds390\*.lib"
224 Section "SDCC DS400 library"
226 SetOutPath "$INSTDIR\lib\ds400"
227 File "${DEV_ROOT}\lib\ds400\*.rel"
228 File "${DEV_ROOT}\lib\ds400\*.lib"
231 Section "SDCC GBZ80 library"
233 SetOutPath "$INSTDIR\lib\gbz80"
234 File "${DEV_ROOT}\lib\gbz80\*.o"
235 File "${DEV_ROOT}\lib\gbz80\*.lib"
238 Section "SDCC Z80 library"
240 SetOutPath "$INSTDIR\lib\z80"
241 File "${DEV_ROOT}\lib\z80\*.o"
242 File "${DEV_ROOT}\lib\z80\*.lib"
245 Section "SDCC small model library"
247 SetOutPath "$INSTDIR\lib\small"
248 File "${DEV_ROOT}\lib\small\*.rel"
249 File "${DEV_ROOT}\lib\small\*.lib"
252 Section "SDCC medium model library"
254 SetOutPath "$INSTDIR\lib\medium"
255 File "${DEV_ROOT}\lib\medium\*.rel"
256 File "${DEV_ROOT}\lib\medium\*.lib"
259 Section "SDCC large model library"
261 SetOutPath "$INSTDIR\lib\large"
262 File "${DEV_ROOT}\lib\large\*.rel"
263 File "${DEV_ROOT}\lib\large\*.lib"
266 Section "SDCC small-stack-auto model library"
268 SetOutPath "$INSTDIR\lib\small-stack-auto"
269 File "${DEV_ROOT}\lib\small-stack-auto\*.rel"
270 File "${DEV_ROOT}\lib\small-stack-auto\*.lib"
273 Section "SDCC HC08 library"
275 SetOutPath "$INSTDIR\lib\hc08"
276 File "${DEV_ROOT}\lib\hc08\*.rel"
277 File "${DEV_ROOT}\lib\hc08\*.lib"
280 Section "SDCC PIC16 library"
282 SetOutPath "$INSTDIR\lib\pic16"
283 File "${DEV_ROOT}\lib\pic16\*.o"
284 File "${DEV_ROOT}\lib\pic16\*.lib"
287 Section "SDCC PIC library"
289 SetOutPath "$INSTDIR\lib\pic"
290 File "${DEV_ROOT}\lib\pic\*.lib"
293 Section "SDCC library sources"
295 SetOutPath "$INSTDIR\lib\src\ds390\examples"
296 File "${DEV_ROOT}\lib\src\ds390\examples\MOVED"
298 SetOutPath "$INSTDIR\lib\src\ds390"
299 File "${DEV_ROOT}\lib\src\ds390\*.c"
300 # File "${DEV_ROOT}\lib\src\ds390\Makefile"
302 SetOutPath "$INSTDIR\lib\src\ds400"
303 File "${DEV_ROOT}\lib\src\ds400\*.c"
304 # File "${DEV_ROOT}\lib\src\ds400\Makefile"
306 SetOutPath "$INSTDIR\lib\src\gbz80"
307 File "${DEV_ROOT}\lib\src\gbz80\*.c"
308 File "${DEV_ROOT}\lib\src\gbz80\*.s"
309 # File "${DEV_ROOT}\lib\src\gbz80\Makefile"
311 SetOutPath "$INSTDIR\lib\src\z80"
312 File "${DEV_ROOT}\lib\src\z80\*.c"
313 File "${DEV_ROOT}\lib\src\z80\*.s"
314 # File "${DEV_ROOT}\lib\src\z80\Makefile"
316 SetOutPath "$INSTDIR\lib\src\hc08"
317 File "${DEV_ROOT}\lib\src\hc08\*.c"
318 # File "${DEV_ROOT}\lib\src\hc08\Makefile"
320 SetOutPath "$INSTDIR\lib\src\mcs51"
321 File "${DEV_ROOT}\lib\src\mcs51\*.asm"
322 # File "${DEV_ROOT}\lib\src\mcs51\Makefile"
324 SetOutPath "$INSTDIR\lib\src\small"
325 # File "${DEV_ROOT}\lib\src\small\Makefile"
327 SetOutPath "$INSTDIR\lib\src\medium"
328 # File "${DEV_ROOT}\lib\src\medium\Makefile"
330 SetOutPath "$INSTDIR\lib\src\large"
331 # File "${DEV_ROOT}\lib\src\large\Makefile"
333 SetOutPath "$INSTDIR\lib\src\pic"
334 # File "${DEV_ROOT}\lib\src\pic\configure"
335 # File "${DEV_ROOT}\lib\src\pic\configure.in"
336 # File "${DEV_ROOT}\lib\src\pic\GPL"
337 # File "${DEV_ROOT}\lib\src\pic\LGPL"
338 # File "${DEV_ROOT}\lib\src\pic\Makefile"
339 # File "${DEV_ROOT}\lib\src\pic\Makefile.common"
340 # File "${DEV_ROOT}\lib\src\pic\Makefile.common.in"
341 # File "${DEV_ROOT}\lib\src\pic\Makefile.rules"
342 # File "${DEV_ROOT}\lib\src\pic\Makefile.subdir"
343 # File "${DEV_ROOT}\lib\src\pic\NEWS"
344 # File "${DEV_ROOT}\lib\src\pic\README"
345 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.c"
346 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.S"
348 SetOutPath "$INSTDIR\lib\src\pic\libsdcc"
349 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.c"
350 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.S"
351 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.inc"
352 # File "${DEV_ROOT}\lib\src\pic\libsdcc\Makefile"
354 SetOutPath "$INSTDIR\lib\src\pic\libdev"
355 File "${DEV_ROOT}\lib\src\pic\libdev\*.c"
356 # File "${DEV_ROOT}\lib\src\pic\libdev\Makefile"
358 SetOutPath "$INSTDIR\lib\src\pic\libm"
359 File "${DEV_ROOT}\lib\src\pic\libm\*.c"
361 SetOutPath "$INSTDIR\lib\src\pic16"
362 # File "${DEV_ROOT}\lib\src\pic16\configure"
363 # File "${DEV_ROOT}\lib\src\pic16\configure.in"
364 # File "${DEV_ROOT}\lib\src\pic16\COPYING"
365 # File "${DEV_ROOT}\lib\src\pic16\Makefile"
366 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common"
367 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common.in"
368 # File "${DEV_ROOT}\lib\src\pic16\Makefile.rules"
369 # File "${DEV_ROOT}\lib\src\pic16\Makefile.subdir"
370 # File "${DEV_ROOT}\lib\src\pic16\pics.all"
371 # File "${DEV_ROOT}\lib\src\pic16\pics.build"
372 # File "${DEV_ROOT}\lib\src\pic16\README"
374 SetOutPath "$INSTDIR\lib\src\pic16\debug"
375 # File "${DEV_ROOT}\lib\src\pic16\debug\Makefile"
377 SetOutPath "$INSTDIR\lib\src\pic16\debug\gstack"
378 # File "${DEV_ROOT}\lib\src\pic16\debug\gstack\Makefile"
379 File "${DEV_ROOT}\lib\src\pic16\debug\gstack\*.c"
381 SetOutPath "$INSTDIR\lib\src\pic16\libc"
382 # File "${DEV_ROOT}\lib\src\pic16\libc\Makefile"
384 SetOutPath "$INSTDIR\lib\src\pic16\libc\ctype"
385 File "${DEV_ROOT}\lib\src\pic16\libc\ctype\*.c"
386 # File "${DEV_ROOT}\lib\src\pic16\libc\ctype\Makefile"
388 SetOutPath "$INSTDIR\lib\src\pic16\libc\delay"
389 File "${DEV_ROOT}\lib\src\pic16\libc\delay\*.S"
390 # File "${DEV_ROOT}\lib\src\pic16\libc\delay\Makefile"
392 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdio"
393 File "${DEV_ROOT}\lib\src\pic16\libc\stdio\*.c"
394 # File "${DEV_ROOT}\lib\src\pic16\libc\stdio\Makefile"
396 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdlib"
397 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.c"
398 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.S"
399 # File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\Makefile"
401 SetOutPath "$INSTDIR\lib\src\pic16\libc\string"
402 File "${DEV_ROOT}\lib\src\pic16\libc\string\*.c"
403 # File "${DEV_ROOT}\lib\src\pic16\libc\string\Makefile"
405 SetOutPath "$INSTDIR\lib\src\pic16\libc\utils"
406 File "${DEV_ROOT}\lib\src\pic16\libc\utils\*.S"
407 # File "${DEV_ROOT}\lib\src\pic16\libc\utils\Makefile"
409 SetOutPath "$INSTDIR\lib\src\pic16\libdev"
410 File "${DEV_ROOT}\lib\src\pic16\libdev\*.c"
411 # File "${DEV_ROOT}\lib\src\pic16\libdev\Makefile"
413 SetOutPath "$INSTDIR\lib\src\pic16\libio"
414 File "${DEV_ROOT}\lib\src\pic16\libio\*.ignore"
415 # File "${DEV_ROOT}\lib\src\pic16\libio\Makefile"
417 SetOutPath "$INSTDIR\lib\src\pic16\libio\adc"
418 File "${DEV_ROOT}\lib\src\pic16\libio\adc\*.c"
419 # File "${DEV_ROOT}\lib\src\pic16\libio\adc\Makefile"
421 SetOutPath "$INSTDIR\lib\src\pic16\libio\i2c"
422 File "${DEV_ROOT}\lib\src\pic16\libio\i2c\*.c"
423 # File "${DEV_ROOT}\lib\src\pic16\libio\i2c\Makefile"
425 SetOutPath "$INSTDIR\lib\src\pic16\libio\usart"
426 File "${DEV_ROOT}\lib\src\pic16\libio\usart\*.c"
427 # File "${DEV_ROOT}\lib\src\pic16\libio\usart\Makefile"
429 SetOutPath "$INSTDIR\lib\src\pic16\libm"
430 File "${DEV_ROOT}\lib\src\pic16\libm\*.c"
431 # File "${DEV_ROOT}\lib\src\pic16\libm\Makefile"
433 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc"
434 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\Makefile"
436 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\char"
437 File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\*.c"
438 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\Makefile"
440 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\fixed16x16"
441 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.c"
442 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.S"
443 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\Makefile"
445 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\float"
446 File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\*.c"
447 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\Makefile"
449 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\gptr"
450 File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\*.c"
451 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\Makefile"
453 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\int"
454 File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\*.c"
455 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\Makefile"
457 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\long"
458 File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\*.c"
459 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\Makefile"
461 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\lregs"
462 File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\*.c"
463 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\Makefile"
465 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\stack"
466 File "${DEV_ROOT}\lib\src\pic16\libsdcc\stack\*.S"
468 SetOutPath "$INSTDIR\lib\src\pic16\startup"
469 File "${DEV_ROOT}\lib\src\pic16\startup\*.c"
470 # File "${DEV_ROOT}\lib\src\pic16\startup\Makefile"
471 # File "${DEV_ROOT}\lib\src\pic16\startup\README"
473 SetOutPath "$INSTDIR\lib\src"
474 File "${DEV_ROOT}\lib\src\*.c"
478 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
479 CreateDirectory "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
480 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" "$INSTDIR\sdcc.url"
481 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" "$INSTDIR\uninstall.exe"
482 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" ""
483 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog_head.txt" "" "$INSTDIR\sdcc.ico" "" "" "" ""
484 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.TXT"
485 !insertmacro MUI_STARTMENU_WRITE_END
489 WriteIniStr "$INSTDIR\sdcc.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/"
493 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "DisplayName" "SDCC"
494 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "UninstallString" "$INSTDIR\uninstall.exe"
495 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "Publisher" "sdcc.sourceforge.net"
496 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "URLInfoAbout" "http://sdcc.sourceforge.net/"
497 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "HelpLink" "http://sdcc.sourceforge.net/"
498 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "URLUpdateInfo" "http://sdcc.sourceforge.net/"
499 WriteUninstaller "$INSTDIR\uninstall.exe"
503 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you want to add $INSTDIR\bin to the PATH?" IDNO +3
509 ;;;; Uninstaller code ;;;;
512 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
516 Function un.onUninstSuccess
518 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
522 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_STARTMENUPAGE_VARIABLE
524 Delete "$INSTDIR\sdcc.url"
526 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "NSIS:StartMenuDir"
527 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC"
529 Delete "$INSTDIR\uninstall.exe"
530 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk"
531 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk"
532 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk"
533 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk"
534 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk"
536 Delete "$INSTDIR\lib\src\large\Makefile"
538 Delete "$INSTDIR\lib\src\medium\Makefile"
540 Delete "$INSTDIR\lib\src\small\Makefile"
542 Delete "$INSTDIR\lib\src\mcs51\*.asm"
543 Delete "$INSTDIR\lib\src\mcs51\Makefile"
544 Delete "$INSTDIR\lib\src\mcs51\README"
546 Delete "$INSTDIR\lib\src\hc08\*.c"
547 Delete "$INSTDIR\lib\src\hc08\hc08.lib"
548 Delete "$INSTDIR\lib\src\hc08\Makefile"
550 Delete "$INSTDIR\lib\src\z80\*.c"
551 Delete "$INSTDIR\lib\src\z80\*.s"
552 Delete "$INSTDIR\lib\src\z80\z80.lib"
553 Delete "$INSTDIR\lib\src\z80\README"
554 Delete "$INSTDIR\lib\src\z80\Makefile"
556 Delete "$INSTDIR\lib\src\gbz80\*.c"
557 Delete "$INSTDIR\lib\src\gbz80\*.s"
558 Delete "$INSTDIR\lib\src\gbz80\gbz80.lib"
559 Delete "$INSTDIR\lib\src\gbz80\README"
560 Delete "$INSTDIR\lib\src\gbz80\Makefile"
562 Delete "$INSTDIR\lib\src\ds390\*.c"
563 Delete "$INSTDIR\lib\src\ds390\libds390.lib"
564 Delete "$INSTDIR\lib\src\ds390\Makefile.dep"
565 Delete "$INSTDIR\lib\src\ds390\Makefile"
566 Delete "$INSTDIR\lib\src\ds390\examples\MOVED"
568 Delete "$INSTDIR\lib\src\ds400\*.c"
569 Delete "$INSTDIR\lib\src\ds400\libds400.lib"
570 Delete "$INSTDIR\lib\src\ds400\Makefile.dep"
571 Delete "$INSTDIR\lib\src\ds400\Makefile"
573 Delete "$INSTDIR\lib\src\*.c"
575 Delete "$INSTDIR\lib\pic\*.o"
576 Delete "$INSTDIR\lib\pic\*.lib"
578 Delete "$INSTDIR\lib\pic16\*.o"
579 Delete "$INSTDIR\lib\pic16\*.lib"
581 Delete "$INSTDIR\lib\hc08\*.rel"
582 Delete "$INSTDIR\lib\hc08\*.lib"
584 Delete "$INSTDIR\lib\z80\*.o"
585 Delete "$INSTDIR\lib\z80\*.lib"
587 Delete "$INSTDIR\lib\small\*.rel"
588 Delete "$INSTDIR\lib\small\*.lib"
590 Delete "$INSTDIR\lib\medium\*.rel"
591 Delete "$INSTDIR\lib\medium\*.lib"
593 Delete "$INSTDIR\lib\large\*.rel"
594 Delete "$INSTDIR\lib\large\*.lib"
596 Delete "$INSTDIR\lib\small-stack-auto\*.rel"
597 Delete "$INSTDIR\lib\small-stack-auto\*.lib"
599 Delete "$INSTDIR\lib\gbz80\*.o"
600 Delete "$INSTDIR\lib\gbz80\*.lib"
602 Delete "$INSTDIR\lib\ds390\*.rel"
603 Delete "$INSTDIR\lib\ds390\*.lib"
605 Delete "$INSTDIR\lib\ds400\*.rel"
606 Delete "$INSTDIR\lib\ds400\*.lib"
608 Delete "$INSTDIR\include\asm\z80\*.h"
609 Delete "$INSTDIR\include\asm\pic16\*.h"
610 Delete "$INSTDIR\include\asm\pic\*.h"
611 Delete "$INSTDIR\include\asm\mcs51\*.h"
612 Delete "$INSTDIR\include\asm\gbz80\*.h"
613 Delete "$INSTDIR\include\asm\ds390\*.h"
614 Delete "$INSTDIR\include\asm\default\*.h"
615 Delete "$INSTDIR\include\z80\*.h"
616 Delete "$INSTDIR\include\pic\*.h"
617 Delete "$INSTDIR\include\pic\*.txt"
618 Delete "$INSTDIR\include\pic\*.inc"
619 Delete "$INSTDIR\include\pic16\*.h"
620 Delete "$INSTDIR\include\mcs51\*.h"
621 Delete "$INSTDIR\include\hc08\*.h"
622 Delete "$INSTDIR\include\*.h"
625 Delete "$INSTDIR\doc\README.TXT"
626 Delete "$INSTDIR\doc\ChangeLog_head.txt"
629 Delete "$INSTDIR\bin\as-gbz80.exe"
630 Delete "$INSTDIR\bin\as-hc08.exe"
631 Delete "$INSTDIR\bin\as-z80.exe"
632 Delete "$INSTDIR\bin\asx8051.exe"
633 Delete "$INSTDIR\bin\aslink.exe"
634 Delete "$INSTDIR\bin\link-gbz80.exe"
635 Delete "$INSTDIR\bin\link-hc08.exe"
636 Delete "$INSTDIR\bin\link-z80.exe"
637 Delete "$INSTDIR\bin\makebin.exe"
638 Delete "$INSTDIR\bin\packihx.exe"
639 Delete "$INSTDIR\bin\sdcc.exe"
640 Delete "$INSTDIR\bin\sdcclib.exe"
641 Delete "$INSTDIR\bin\sdcpp.exe"
643 Delete "$INSTDIR\bin\s51.exe"
644 Delete "$INSTDIR\bin\savr.exe"
645 Delete "$INSTDIR\bin\shc08.exe"
646 Delete "$INSTDIR\bin\sz80.exe"
648 Delete "$INSTDIR\bin\sdcdb.exe"
649 Delete "$INSTDIR\bin\sdcdb.el"
650 Delete "$INSTDIR\bin\sdcdbsrc.el"
652 Delete "$INSTDIR\COPYING.TXT"
653 Delete "$INSTDIR\sdcc.ico"
655 RMDir "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
657 RMDir /r "$INSTDIR\lib\src\pic"
658 RMDir /r "$INSTDIR\lib\src\pic16"
659 RMDir "$INSTDIR\lib\src\small"
660 RMDir "$INSTDIR\lib\src\medium"
661 RMDir "$INSTDIR\lib\src\large"
662 RMDir "$INSTDIR\lib\src\mcs51"
663 RMDir "$INSTDIR\lib\src\z80"
664 RMDir "$INSTDIR\lib\src\gbz80"
665 RMDir "$INSTDIR\lib\src\ds390\examples"
666 RMDir "$INSTDIR\lib\src\ds390"
667 RMDir "$INSTDIR\lib\src\ds400"
668 RMDir "$INSTDIR\lib\src\hc08"
669 RMDir "$INSTDIR\lib\src"
671 RMDir "$INSTDIR\lib\pic"
672 RMDir "$INSTDIR\lib\pic16"
673 RMDir "$INSTDIR\lib\z80"
674 RMDir "$INSTDIR\lib\small"
675 RMDir "$INSTDIR\lib\medium"
676 RMDir "$INSTDIR\lib\large"
677 RMDir "$INSTDIR\lib\small-stack-auto"
678 RMDir "$INSTDIR\lib\gbz80"
679 RMDir "$INSTDIR\lib\ds390"
680 RMDir "$INSTDIR\lib\ds400"
681 RMDir "$INSTDIR\lib\hc08"
684 RMDir "$INSTDIR\include\asm\z80"
685 RMDir "$INSTDIR\include\asm\pic16"
686 RMDir "$INSTDIR\include\asm\pic"
687 RMDir "$INSTDIR\include\asm\mcs51"
688 RMDir "$INSTDIR\include\asm\gbz80"
689 RMDir "$INSTDIR\include\asm\ds390"
690 RMDir "$INSTDIR\include\asm\default"
691 RMDir "$INSTDIR\include\asm"
692 RMDir "$INSTDIR\include\z80"
693 RMDir "$INSTDIR\include\pic"
694 RMDir "$INSTDIR\include\pic16"
695 RMDir "$INSTDIR\include\mcs51"
696 RMDir "$INSTDIR\include\hc08"
697 RMDir "$INSTDIR\include"
700 RMDir /r "$INSTDIR\doc"
710 Call un.RemoveFromPath
715 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
716 ; Path Manipulation functions ;
717 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
720 !include "WinMessages.nsh"
723 ; AddToPath - Adds the given dir to the search path.
724 ; Input - head of the stack
725 ; Note - Win9x systems requires reboot
734 ; don't add if the path doesn't exist
735 IfFileExists $0 "" AddToPath_done
740 ; Not on NT: read PATH from environment variable
743 ; On NT: read PATH from registry
744 ReadRegStr $1 HKCU "Environment" "PATH"
749 StrCmp $2 "" "" AddToPath_done
754 StrCmp $2 "" "" AddToPath_done
755 GetFullPathName /SHORT $3 $0
760 StrCmp $2 "" "" AddToPath_done
765 StrCmp $2 "" "" AddToPath_done
767 StrCmp $4 1 AddToPath_NT
770 FileOpen $1 "$1\autoexec.bat" a
773 IntCmp $2 26 0 +2 +2 ; DOS EOF
774 FileSeek $1 -1 END ; write over EOF
775 FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
781 ReadRegStr $1 HKCU "Environment" "PATH"
782 StrCpy $2 $1 1 -1 ; copy last char
783 StrCmp $2 ";" 0 +2 ; if last char == ;
784 StrCpy $1 $1 -1 ; remove last char
785 StrCmp $1 "" AddToPath_NTdoIt
788 WriteRegExpandStr HKCU "Environment" "PATH" $0
789 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
799 ; RemoveFromPath - Remove a given dir from the path
800 ; Input: head of the stack
802 Function un.RemoveFromPath
811 IntFmt $6 "%c" 26 ; DOS EOF
815 StrCmp $1 1 unRemoveFromPath_NT
818 FileOpen $1 "$1\autoexec.bat" r
821 GetFullPathName /SHORT $0 $0
822 StrCpy $0 "SET PATH=%PATH%;$0"
823 Goto unRemoveFromPath_dosLoop
825 unRemoveFromPath_dosLoop:
827 StrCpy $5 $3 1 -1 ; read last char
828 StrCmp $5 $6 0 +2 ; if DOS EOF
829 StrCpy $3 $3 -1 ; remove DOS EOF so we can compare
830 StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
831 StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
832 StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
833 StrCmp $3 "" unRemoveFromPath_dosLoopEnd
835 Goto unRemoveFromPath_dosLoop
836 unRemoveFromPath_dosLoopRemoveLine:
838 Goto unRemoveFromPath_dosLoop
840 unRemoveFromPath_dosLoopEnd:
844 Delete "$1\autoexec.bat"
845 CopyFiles /SILENT $4 "$1\autoexec.bat"
847 Goto unRemoveFromPath_done
850 ReadRegStr $1 HKCU "Environment" "PATH"
851 StrCpy $5 $1 1 -1 ; copy last char
852 StrCmp $5 ";" +2 ; if last char != ;
853 StrCpy $1 "$1;" ; append ;
856 Call un.StrStr ; Find `$0;` in $1
857 Pop $2 ; pos of our dir
858 StrCmp $2 "" unRemoveFromPath_done
859 ; else, it is in path
864 StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
865 StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
868 StrCpy $5 $3 1 -1 ; copy last char
869 StrCmp $5 ";" 0 +2 ; if last char == ;
870 StrCpy $3 $3 -1 ; remove last char
873 ; New PATH not empty: update the registry
874 WriteRegExpandStr HKCU "Environment" "PATH" $3
876 ; New PATH empty: remove from the registry
877 DeleteRegValue HKCU "Environment" "PATH"
878 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
880 unRemoveFromPath_done:
890 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
891 ; Utility Functions ;
892 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
896 ; output, top of the stack = 1 if NT or 0 if not
901 ; ($R0 at this point is 1 or 0)
906 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
907 StrCmp $0 "" 0 IsNT_yes
920 !insertmacro IsNT "un."
923 ; input, top of stack = string to search for
924 ; top of stack-1 = string to search in
925 ; output, top of stack (replaces with the portion of the string remaining)
926 ; modifies no other variables.
929 ; Push "this is a long ass string"
933 ; ($R0 at this point is "ass string")
937 Exch $R1 ; st=haystack,old$R1, $R1=needle
938 Exch ; st=old$R1,haystack
939 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
951 StrCpy $R5 $R2 $R3 $R4
957 StrCpy $R1 $R2 "" $R4
965 !insertmacro StrStr ""
966 !insertmacro StrStr "un."