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-rrrr.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 # - copy readline5.dll to PKGDIR/bin/readline5.dll
37 # - run NSIS installer from PKGDIR directory:
38 # "c:\Program Files\NSIS\makensis.exe" sdcc.nsi
39 # - A setup file setup.exe is created in PKGDIR directory.
40 # Rename it to sdcc-yyyymmdd-rrrr-setup.exe and upload it
41 # to sdcc download repository at sourceforge.net
44 # How to create WIN32 release setup.exe package
46 # - unpack WIN32 mingw daily snapshot sdcc-snapshot-i586-mingw32msvc-yyyymmdd-rrrr.zip
47 # to a clean directory (the option to create directories should be enabled).
48 # A sub directory sdcc is created (referenced as PKGDIR in continuation).
49 # - remove the PKGDIR/doc/README.TXT file
50 # - unpack sdcc-doc-yyyymmdd-rrrr.zip to the PKGDIR/doc directory
51 # - copy files sdcc/support/scripts/sdcc.ico and sdcc/support/scripts/sdcc.nsi
52 # (this file) from the sdcc Subversion snapshot to the PKGDIR directory
53 # - copy file COPYING from the sdcc Subversion snapshot to the PKGDIR directory,
54 # rename it to COPYING.TXT and convert file COPYING to DOS format:
55 # unix2dos COPYING.TXT
56 # - copy readline5.dll to PKGDIR/bin/readline5.dll
57 # - run NSIS installer from PKGDIR directory:
58 # "c:\Program Files\NSIS\makensis.exe" -DFULL_DOC sdcc.nsi
59 # - A setup file setup.exe is created in PKGDIR directory.
60 # Rename it to sdcc-x.x.x-setup.exe and upload it
61 # to sdcc download repository at sourceforge.net
63 # How to upload secc setup.exe tosourceforge.net
65 # Execute following commands from the cmd prompt:
66 # - sftp sdcc.sourceforge.net
67 # - cd /home/groups/s/sd/sdcc/htdocs/snapshots/i586-mingw32msvc-setup
68 # - put sdcc_yyyymmdd_setup.exe
74 SetCompressor /SOLID lzma
78 !define DEV_ROOT "${SDCC_ROOT}"
80 !system "unix2dos ${SDCC_ROOT}\doc\ChangeLog_head.txt" = 0
81 !system "unix2dos ${SDCC_ROOT}\doc\README.TXT" = 0
83 InstType "Full (Bin, ucSim, SDCDB, Doc, Lib, Src)"
84 InstType "Medium (Bin, ucSim, SDCDB, Doc, Lib)"
85 InstType "Compact (Bin, ucSim, SDCDB, Doc)"
87 ;--------------------------------
90 Var MUI_STARTMENUPAGE_VARIABLE
92 ;--------------------------------
93 !define MUI_ABORTWARNING
95 !insertmacro MUI_PAGE_WELCOME
96 !insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.TXT"
97 !define MUI_STARTMENUPAGE_DEFAULTFOLDER "SDCC"
98 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
99 !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC"
100 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
101 !define MUI_STARTMENUPAGE_NODISABLE
102 !insertmacro MUI_PAGE_STARTMENU Application $MUI_STARTMENUPAGE_VARIABLE
103 !insertmacro MUI_PAGE_COMPONENTS
104 !insertmacro MUI_PAGE_DIRECTORY
105 !insertmacro MUI_PAGE_INSTFILES
106 !insertmacro MUI_PAGE_FINISH
108 !insertmacro MUI_UNPAGE_INSTFILES
110 !insertmacro MUI_LANGUAGE "English"
115 InstallDir "$PROGRAMFILES\SDCC"
117 ShowUnInstDetails show
120 ;Uninstall the old version, if present
121 ReadRegStr $R0 HKLM \
122 "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" \
126 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
127 "$(^Name) is already installed. $\n$\nClick 'OK' to remove the \
128 previous version or 'Cancel' to cancel this upgrade." \
133 ; Run the uninstaller
135 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
137 ;IfErrors no_remove_uninstaller
138 ; ;You can either use Delete /REBOOTOK in the uninstaller or add some code
139 ; ;here to remove to remove the uninstaller. Use a registry key to check
140 ; ;whether the user has chosen to uninstall. If you are using an uninstaller
141 ; ;components page, make sure all sections are uninstalled.
142 ;no_remove_uninstaller:
147 ; Install the new version
148 MessageBox MB_YESNO|MB_ICONQUESTION "This will install $(^Name). Do you wish to continue?" IDYES +2
155 SetOutPath "$INSTDIR"
157 File "${SDCC_ROOT}\COPYING.TXT"
160 Section "SDCC application files"
162 SetOutPath "$INSTDIR\bin"
163 File "${SDCC_ROOT}\bin\as-gbz80.exe"
164 File "${SDCC_ROOT}\bin\as-hc08.exe"
165 File "${SDCC_ROOT}\bin\as-z80.exe"
166 File "${SDCC_ROOT}\bin\asx8051.exe"
167 File "${SDCC_ROOT}\bin\aslink.exe"
168 File "${SDCC_ROOT}\bin\link-gbz80.exe"
169 File "${SDCC_ROOT}\bin\link-hc08.exe"
170 File "${SDCC_ROOT}\bin\link-z80.exe"
171 File "${SDCC_ROOT}\bin\makebin.exe"
172 File "${SDCC_ROOT}\bin\packihx.exe"
173 File "${SDCC_ROOT}\bin\sdcc.exe"
174 File "${SDCC_ROOT}\bin\sdcclib.exe"
175 File "${SDCC_ROOT}\bin\sdcpp.exe"
176 File "${SDCC_ROOT}\bin\readline5.dll"
179 Section "ucSim application files"
181 SetOutPath "$INSTDIR\bin"
182 File "${SDCC_ROOT}\bin\s51.exe"
183 File "${SDCC_ROOT}\bin\savr.exe"
184 File "${SDCC_ROOT}\bin\shc08.exe"
185 File "${SDCC_ROOT}\bin\sz80.exe"
188 Section "SDCDB files"
190 File "${SDCC_ROOT}\bin\sdcdb.exe"
191 File "${SDCC_ROOT}\bin\sdcdb.el"
192 File "${SDCC_ROOT}\bin\sdcdbsrc.el"
195 Section "SDCC documentation"
197 SetOutPath "$INSTDIR\doc"
199 File /r "${SDCC_ROOT}\doc\*"
201 File "${SDCC_ROOT}\doc\ChangeLog_head.txt"
202 File "${SDCC_ROOT}\doc\README.TXT"
206 Section "SDCC include files"
208 SetOutPath "$INSTDIR\include\asm\default"
209 File "${DEV_ROOT}\include\asm\default\features.h"
210 SetOutPath "$INSTDIR\include\asm\ds390"
211 File "${DEV_ROOT}\include\asm\ds390\features.h"
212 SetOutPath "$INSTDIR\include\asm\gbz80"
213 File "${DEV_ROOT}\include\asm\gbz80\features.h"
214 SetOutPath "$INSTDIR\include\asm\mcs51"
215 File "${DEV_ROOT}\include\asm\mcs51\features.h"
216 SetOutPath "$INSTDIR\include\asm\pic"
217 File "${DEV_ROOT}\include\asm\pic\features.h"
218 SetOutPath "$INSTDIR\include\asm\pic16"
219 File "${DEV_ROOT}\include\asm\pic16\features.h"
220 SetOutPath "$INSTDIR\include\asm\z80"
221 File "${DEV_ROOT}\include\asm\z80\features.h"
222 SetOutPath "$INSTDIR\include\hc08"
223 File "${DEV_ROOT}\include\hc08\*.h"
224 SetOutPath "$INSTDIR\include\mcs51"
225 File "${DEV_ROOT}\include\mcs51\*.h"
226 SetOutPath "$INSTDIR\include\pic"
227 File "${DEV_ROOT}\include\pic\*.h"
228 File "${DEV_ROOT}\include\pic\*.txt"
229 File "${DEV_ROOT}\include\pic\*.inc"
230 SetOutPath "$INSTDIR\include\pic16"
231 File "${DEV_ROOT}\include\pic16\*.h"
232 SetOutPath "$INSTDIR\include\z80"
233 File "${DEV_ROOT}\include\z80\*.h"
234 SetOutPath "$INSTDIR\include"
235 File "${DEV_ROOT}\include\*.h"
238 Section "SDCC DS390 library"
240 SetOutPath "$INSTDIR\lib\ds390"
241 File "${DEV_ROOT}\lib\ds390\*.rel"
242 File "${DEV_ROOT}\lib\ds390\*.lib"
245 Section "SDCC DS400 library"
247 SetOutPath "$INSTDIR\lib\ds400"
248 File "${DEV_ROOT}\lib\ds400\*.rel"
249 File "${DEV_ROOT}\lib\ds400\*.lib"
252 Section "SDCC GBZ80 library"
254 SetOutPath "$INSTDIR\lib\gbz80"
255 File "${DEV_ROOT}\lib\gbz80\*.o"
256 File "${DEV_ROOT}\lib\gbz80\*.lib"
259 Section "SDCC Z80 library"
261 SetOutPath "$INSTDIR\lib\z80"
262 File "${DEV_ROOT}\lib\z80\*.o"
263 File "${DEV_ROOT}\lib\z80\*.lib"
266 Section "SDCC small model library"
268 SetOutPath "$INSTDIR\lib\small"
269 File "${DEV_ROOT}\lib\small\*.rel"
270 File "${DEV_ROOT}\lib\small\*.lib"
273 Section "SDCC medium model library"
275 SetOutPath "$INSTDIR\lib\medium"
276 File "${DEV_ROOT}\lib\medium\*.rel"
277 File "${DEV_ROOT}\lib\medium\*.lib"
280 Section "SDCC large model library"
282 SetOutPath "$INSTDIR\lib\large"
283 File "${DEV_ROOT}\lib\large\*.rel"
284 File "${DEV_ROOT}\lib\large\*.lib"
287 Section "SDCC small-stack-auto model library"
289 SetOutPath "$INSTDIR\lib\small-stack-auto"
290 File "${DEV_ROOT}\lib\small-stack-auto\*.rel"
291 File "${DEV_ROOT}\lib\small-stack-auto\*.lib"
294 Section "SDCC HC08 library"
296 SetOutPath "$INSTDIR\lib\hc08"
297 File "${DEV_ROOT}\lib\hc08\*.rel"
298 File "${DEV_ROOT}\lib\hc08\*.lib"
301 Section "SDCC PIC16 library"
303 SetOutPath "$INSTDIR\lib\pic16"
304 File "${DEV_ROOT}\lib\pic16\*.o"
305 File "${DEV_ROOT}\lib\pic16\*.lib"
308 Section "SDCC PIC library"
310 SetOutPath "$INSTDIR\lib\pic"
311 File "${DEV_ROOT}\lib\pic\*.lib"
314 Section "SDCC library sources"
316 SetOutPath "$INSTDIR\lib\src\ds390\examples"
317 File "${DEV_ROOT}\lib\src\ds390\examples\MOVED"
319 SetOutPath "$INSTDIR\lib\src\ds390"
320 File "${DEV_ROOT}\lib\src\ds390\*.c"
321 # File "${DEV_ROOT}\lib\src\ds390\Makefile"
323 SetOutPath "$INSTDIR\lib\src\ds400"
324 File "${DEV_ROOT}\lib\src\ds400\*.c"
325 # File "${DEV_ROOT}\lib\src\ds400\Makefile"
327 SetOutPath "$INSTDIR\lib\src\gbz80"
328 File "${DEV_ROOT}\lib\src\gbz80\*.c"
329 File "${DEV_ROOT}\lib\src\gbz80\*.s"
330 # File "${DEV_ROOT}\lib\src\gbz80\Makefile"
332 SetOutPath "$INSTDIR\lib\src\z80"
333 File "${DEV_ROOT}\lib\src\z80\*.c"
334 File "${DEV_ROOT}\lib\src\z80\*.s"
335 # File "${DEV_ROOT}\lib\src\z80\Makefile"
337 SetOutPath "$INSTDIR\lib\src\hc08"
338 File "${DEV_ROOT}\lib\src\hc08\*.c"
339 # File "${DEV_ROOT}\lib\src\hc08\Makefile"
341 SetOutPath "$INSTDIR\lib\src\mcs51"
342 File "${DEV_ROOT}\lib\src\mcs51\*.asm"
343 # File "${DEV_ROOT}\lib\src\mcs51\Makefile"
345 SetOutPath "$INSTDIR\lib\src\small"
346 # File "${DEV_ROOT}\lib\src\small\Makefile"
348 SetOutPath "$INSTDIR\lib\src\medium"
349 # File "${DEV_ROOT}\lib\src\medium\Makefile"
351 SetOutPath "$INSTDIR\lib\src\large"
352 # File "${DEV_ROOT}\lib\src\large\Makefile"
354 SetOutPath "$INSTDIR\lib\src\pic"
355 # File "${DEV_ROOT}\lib\src\pic\configure"
356 # File "${DEV_ROOT}\lib\src\pic\configure.in"
357 # File "${DEV_ROOT}\lib\src\pic\GPL"
358 # File "${DEV_ROOT}\lib\src\pic\LGPL"
359 # File "${DEV_ROOT}\lib\src\pic\Makefile"
360 # File "${DEV_ROOT}\lib\src\pic\Makefile.common"
361 # File "${DEV_ROOT}\lib\src\pic\Makefile.common.in"
362 # File "${DEV_ROOT}\lib\src\pic\Makefile.rules"
363 # File "${DEV_ROOT}\lib\src\pic\Makefile.subdir"
364 # File "${DEV_ROOT}\lib\src\pic\NEWS"
365 # File "${DEV_ROOT}\lib\src\pic\README"
366 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.c"
367 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.S"
369 SetOutPath "$INSTDIR\lib\src\pic\libsdcc"
370 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.c"
371 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.S"
372 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.inc"
373 # File "${DEV_ROOT}\lib\src\pic\libsdcc\Makefile"
375 SetOutPath "$INSTDIR\lib\src\pic\libdev"
376 File "${DEV_ROOT}\lib\src\pic\libdev\*.c"
377 # File "${DEV_ROOT}\lib\src\pic\libdev\Makefile"
379 SetOutPath "$INSTDIR\lib\src\pic\libm"
380 File "${DEV_ROOT}\lib\src\pic\libm\*.c"
382 SetOutPath "$INSTDIR\lib\src\pic16"
383 # File "${DEV_ROOT}\lib\src\pic16\configure"
384 # File "${DEV_ROOT}\lib\src\pic16\configure.in"
385 # File "${DEV_ROOT}\lib\src\pic16\COPYING"
386 # File "${DEV_ROOT}\lib\src\pic16\Makefile"
387 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common"
388 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common.in"
389 # File "${DEV_ROOT}\lib\src\pic16\Makefile.rules"
390 # File "${DEV_ROOT}\lib\src\pic16\Makefile.subdir"
391 # File "${DEV_ROOT}\lib\src\pic16\pics.all"
392 # File "${DEV_ROOT}\lib\src\pic16\pics.build"
393 # File "${DEV_ROOT}\lib\src\pic16\README"
395 SetOutPath "$INSTDIR\lib\src\pic16\debug"
396 # File "${DEV_ROOT}\lib\src\pic16\debug\Makefile"
398 SetOutPath "$INSTDIR\lib\src\pic16\debug\gstack"
399 # File "${DEV_ROOT}\lib\src\pic16\debug\gstack\Makefile"
400 File "${DEV_ROOT}\lib\src\pic16\debug\gstack\*.c"
402 SetOutPath "$INSTDIR\lib\src\pic16\libc"
403 # File "${DEV_ROOT}\lib\src\pic16\libc\Makefile"
405 SetOutPath "$INSTDIR\lib\src\pic16\libc\ctype"
406 File "${DEV_ROOT}\lib\src\pic16\libc\ctype\*.c"
407 # File "${DEV_ROOT}\lib\src\pic16\libc\ctype\Makefile"
409 SetOutPath "$INSTDIR\lib\src\pic16\libc\delay"
410 File "${DEV_ROOT}\lib\src\pic16\libc\delay\*.S"
411 # File "${DEV_ROOT}\lib\src\pic16\libc\delay\Makefile"
413 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdio"
414 File "${DEV_ROOT}\lib\src\pic16\libc\stdio\*.c"
415 # File "${DEV_ROOT}\lib\src\pic16\libc\stdio\Makefile"
417 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdlib"
418 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.c"
419 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.S"
420 # File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\Makefile"
422 SetOutPath "$INSTDIR\lib\src\pic16\libc\string"
423 File "${DEV_ROOT}\lib\src\pic16\libc\string\*.c"
424 # File "${DEV_ROOT}\lib\src\pic16\libc\string\Makefile"
426 SetOutPath "$INSTDIR\lib\src\pic16\libc\utils"
427 File "${DEV_ROOT}\lib\src\pic16\libc\utils\*.S"
428 # File "${DEV_ROOT}\lib\src\pic16\libc\utils\Makefile"
430 SetOutPath "$INSTDIR\lib\src\pic16\libdev"
431 File "${DEV_ROOT}\lib\src\pic16\libdev\*.c"
432 # File "${DEV_ROOT}\lib\src\pic16\libdev\Makefile"
434 SetOutPath "$INSTDIR\lib\src\pic16\libio"
435 File "${DEV_ROOT}\lib\src\pic16\libio\*.ignore"
436 # File "${DEV_ROOT}\lib\src\pic16\libio\Makefile"
438 SetOutPath "$INSTDIR\lib\src\pic16\libio\adc"
439 File "${DEV_ROOT}\lib\src\pic16\libio\adc\*.c"
440 # File "${DEV_ROOT}\lib\src\pic16\libio\adc\Makefile"
442 SetOutPath "$INSTDIR\lib\src\pic16\libio\i2c"
443 File "${DEV_ROOT}\lib\src\pic16\libio\i2c\*.c"
444 # File "${DEV_ROOT}\lib\src\pic16\libio\i2c\Makefile"
446 SetOutPath "$INSTDIR\lib\src\pic16\libio\usart"
447 File "${DEV_ROOT}\lib\src\pic16\libio\usart\*.c"
448 # File "${DEV_ROOT}\lib\src\pic16\libio\usart\Makefile"
450 SetOutPath "$INSTDIR\lib\src\pic16\libm"
451 File "${DEV_ROOT}\lib\src\pic16\libm\*.c"
452 # File "${DEV_ROOT}\lib\src\pic16\libm\Makefile"
454 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc"
455 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\Makefile"
457 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\char"
458 File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\*.c"
459 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\Makefile"
461 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\fixed16x16"
462 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.c"
463 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.S"
464 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\Makefile"
466 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\float"
467 File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\*.c"
468 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\Makefile"
470 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\gptr"
471 File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\*.c"
472 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\Makefile"
474 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\int"
475 File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\*.c"
476 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\Makefile"
478 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\long"
479 File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\*.c"
480 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\Makefile"
482 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\lregs"
483 File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\*.c"
484 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\Makefile"
486 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\stack"
487 File "${DEV_ROOT}\lib\src\pic16\libsdcc\stack\*.S"
489 SetOutPath "$INSTDIR\lib\src\pic16\startup"
490 File "${DEV_ROOT}\lib\src\pic16\startup\*.c"
491 # File "${DEV_ROOT}\lib\src\pic16\startup\Makefile"
492 # File "${DEV_ROOT}\lib\src\pic16\startup\README"
494 SetOutPath "$INSTDIR\lib\src"
495 File "${DEV_ROOT}\lib\src\*.c"
499 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
500 CreateDirectory "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
501 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" "$INSTDIR\sdcc.url"
502 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" "$INSTDIR\uninstall.exe"
503 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" ""
504 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog_head.txt" "" "$INSTDIR\sdcc.ico" "" "" "" ""
505 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.TXT"
506 !insertmacro MUI_STARTMENU_WRITE_END
510 WriteIniStr "$INSTDIR\sdcc.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/"
514 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "DisplayName" "SDCC"
515 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "UninstallString" "$INSTDIR\uninstall.exe"
516 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "Publisher" "sdcc.sourceforge.net"
517 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "URLInfoAbout" "http://sdcc.sourceforge.net/"
518 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "HelpLink" "http://sdcc.sourceforge.net/"
519 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "URLUpdateInfo" "http://sdcc.sourceforge.net/"
520 WriteUninstaller "$INSTDIR\uninstall.exe"
524 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Do you want to add $INSTDIR\bin to the PATH?" IDNO +3
530 ;;;; Uninstaller code ;;;;
533 MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
537 Function un.onUninstSuccess
539 MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
543 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_STARTMENUPAGE_VARIABLE
545 Delete "$INSTDIR\sdcc.url"
547 DeleteRegValue HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC" "NSIS:StartMenuDir"
548 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\SDCC"
550 Delete "$INSTDIR\uninstall.exe"
551 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk"
552 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk"
553 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk"
554 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk"
555 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk"
557 Delete "$INSTDIR\lib\src\large\Makefile"
559 Delete "$INSTDIR\lib\src\medium\Makefile"
561 Delete "$INSTDIR\lib\src\small\Makefile"
563 Delete "$INSTDIR\lib\src\mcs51\*.asm"
564 Delete "$INSTDIR\lib\src\mcs51\Makefile"
565 Delete "$INSTDIR\lib\src\mcs51\README"
567 Delete "$INSTDIR\lib\src\hc08\*.c"
568 Delete "$INSTDIR\lib\src\hc08\hc08.lib"
569 Delete "$INSTDIR\lib\src\hc08\Makefile"
571 Delete "$INSTDIR\lib\src\z80\*.c"
572 Delete "$INSTDIR\lib\src\z80\*.s"
573 Delete "$INSTDIR\lib\src\z80\z80.lib"
574 Delete "$INSTDIR\lib\src\z80\README"
575 Delete "$INSTDIR\lib\src\z80\Makefile"
577 Delete "$INSTDIR\lib\src\gbz80\*.c"
578 Delete "$INSTDIR\lib\src\gbz80\*.s"
579 Delete "$INSTDIR\lib\src\gbz80\gbz80.lib"
580 Delete "$INSTDIR\lib\src\gbz80\README"
581 Delete "$INSTDIR\lib\src\gbz80\Makefile"
583 Delete "$INSTDIR\lib\src\ds390\*.c"
584 Delete "$INSTDIR\lib\src\ds390\libds390.lib"
585 Delete "$INSTDIR\lib\src\ds390\Makefile.dep"
586 Delete "$INSTDIR\lib\src\ds390\Makefile"
587 Delete "$INSTDIR\lib\src\ds390\examples\MOVED"
589 Delete "$INSTDIR\lib\src\ds400\*.c"
590 Delete "$INSTDIR\lib\src\ds400\libds400.lib"
591 Delete "$INSTDIR\lib\src\ds400\Makefile.dep"
592 Delete "$INSTDIR\lib\src\ds400\Makefile"
594 Delete "$INSTDIR\lib\src\*.c"
596 Delete "$INSTDIR\lib\pic\*.o"
597 Delete "$INSTDIR\lib\pic\*.lib"
599 Delete "$INSTDIR\lib\pic16\*.o"
600 Delete "$INSTDIR\lib\pic16\*.lib"
602 Delete "$INSTDIR\lib\hc08\*.rel"
603 Delete "$INSTDIR\lib\hc08\*.lib"
605 Delete "$INSTDIR\lib\z80\*.o"
606 Delete "$INSTDIR\lib\z80\*.lib"
608 Delete "$INSTDIR\lib\small\*.rel"
609 Delete "$INSTDIR\lib\small\*.lib"
611 Delete "$INSTDIR\lib\medium\*.rel"
612 Delete "$INSTDIR\lib\medium\*.lib"
614 Delete "$INSTDIR\lib\large\*.rel"
615 Delete "$INSTDIR\lib\large\*.lib"
617 Delete "$INSTDIR\lib\small-stack-auto\*.rel"
618 Delete "$INSTDIR\lib\small-stack-auto\*.lib"
620 Delete "$INSTDIR\lib\gbz80\*.o"
621 Delete "$INSTDIR\lib\gbz80\*.lib"
623 Delete "$INSTDIR\lib\ds390\*.rel"
624 Delete "$INSTDIR\lib\ds390\*.lib"
626 Delete "$INSTDIR\lib\ds400\*.rel"
627 Delete "$INSTDIR\lib\ds400\*.lib"
629 Delete "$INSTDIR\include\asm\z80\*.h"
630 Delete "$INSTDIR\include\asm\pic16\*.h"
631 Delete "$INSTDIR\include\asm\pic\*.h"
632 Delete "$INSTDIR\include\asm\mcs51\*.h"
633 Delete "$INSTDIR\include\asm\gbz80\*.h"
634 Delete "$INSTDIR\include\asm\ds390\*.h"
635 Delete "$INSTDIR\include\asm\default\*.h"
636 Delete "$INSTDIR\include\z80\*.h"
637 Delete "$INSTDIR\include\pic\*.h"
638 Delete "$INSTDIR\include\pic\*.txt"
639 Delete "$INSTDIR\include\pic\*.inc"
640 Delete "$INSTDIR\include\pic16\*.h"
641 Delete "$INSTDIR\include\mcs51\*.h"
642 Delete "$INSTDIR\include\hc08\*.h"
643 Delete "$INSTDIR\include\*.h"
646 Delete "$INSTDIR\doc\README.TXT"
647 Delete "$INSTDIR\doc\ChangeLog_head.txt"
650 Delete "$INSTDIR\bin\as-gbz80.exe"
651 Delete "$INSTDIR\bin\as-hc08.exe"
652 Delete "$INSTDIR\bin\as-z80.exe"
653 Delete "$INSTDIR\bin\asx8051.exe"
654 Delete "$INSTDIR\bin\aslink.exe"
655 Delete "$INSTDIR\bin\link-gbz80.exe"
656 Delete "$INSTDIR\bin\link-hc08.exe"
657 Delete "$INSTDIR\bin\link-z80.exe"
658 Delete "$INSTDIR\bin\makebin.exe"
659 Delete "$INSTDIR\bin\packihx.exe"
660 Delete "$INSTDIR\bin\sdcc.exe"
661 Delete "$INSTDIR\bin\sdcclib.exe"
662 Delete "$INSTDIR\bin\sdcpp.exe"
663 Delete "$INSTDIR\bin\readline5.dll"
666 Delete "$INSTDIR\bin\s51.exe"
667 Delete "$INSTDIR\bin\savr.exe"
668 Delete "$INSTDIR\bin\shc08.exe"
669 Delete "$INSTDIR\bin\sz80.exe"
671 Delete "$INSTDIR\bin\sdcdb.exe"
672 Delete "$INSTDIR\bin\sdcdb.el"
673 Delete "$INSTDIR\bin\sdcdbsrc.el"
675 Delete "$INSTDIR\COPYING.TXT"
676 Delete "$INSTDIR\sdcc.ico"
678 RMDir "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
680 RMDir /r "$INSTDIR\lib\src\pic"
681 RMDir /r "$INSTDIR\lib\src\pic16"
682 RMDir "$INSTDIR\lib\src\small"
683 RMDir "$INSTDIR\lib\src\medium"
684 RMDir "$INSTDIR\lib\src\large"
685 RMDir "$INSTDIR\lib\src\mcs51"
686 RMDir "$INSTDIR\lib\src\z80"
687 RMDir "$INSTDIR\lib\src\gbz80"
688 RMDir "$INSTDIR\lib\src\ds390\examples"
689 RMDir "$INSTDIR\lib\src\ds390"
690 RMDir "$INSTDIR\lib\src\ds400"
691 RMDir "$INSTDIR\lib\src\hc08"
692 RMDir "$INSTDIR\lib\src"
694 RMDir "$INSTDIR\lib\pic"
695 RMDir "$INSTDIR\lib\pic16"
696 RMDir "$INSTDIR\lib\z80"
697 RMDir "$INSTDIR\lib\small"
698 RMDir "$INSTDIR\lib\medium"
699 RMDir "$INSTDIR\lib\large"
700 RMDir "$INSTDIR\lib\small-stack-auto"
701 RMDir "$INSTDIR\lib\gbz80"
702 RMDir "$INSTDIR\lib\ds390"
703 RMDir "$INSTDIR\lib\ds400"
704 RMDir "$INSTDIR\lib\hc08"
707 RMDir "$INSTDIR\include\asm\z80"
708 RMDir "$INSTDIR\include\asm\pic16"
709 RMDir "$INSTDIR\include\asm\pic"
710 RMDir "$INSTDIR\include\asm\mcs51"
711 RMDir "$INSTDIR\include\asm\gbz80"
712 RMDir "$INSTDIR\include\asm\ds390"
713 RMDir "$INSTDIR\include\asm\default"
714 RMDir "$INSTDIR\include\asm"
715 RMDir "$INSTDIR\include\z80"
716 RMDir "$INSTDIR\include\pic"
717 RMDir "$INSTDIR\include\pic16"
718 RMDir "$INSTDIR\include\mcs51"
719 RMDir "$INSTDIR\include\hc08"
720 RMDir "$INSTDIR\include"
723 RMDir /r "$INSTDIR\doc"
733 Call un.RemoveFromPath
738 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
739 ; Path Manipulation functions ;
740 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
743 !include "WinMessages.nsh"
746 ; AddToPath - Adds the given dir to the search path.
747 ; Input - head of the stack
748 ; Note - Win9x systems requires reboot
757 ; don't add if the path doesn't exist
758 IfFileExists $0 "" AddToPath_done
763 ; Not on NT: read PATH from environment variable
766 ; On NT: read PATH from registry
767 ReadRegStr $1 HKCU "Environment" "PATH"
772 StrCmp $2 "" "" AddToPath_done
777 StrCmp $2 "" "" AddToPath_done
778 GetFullPathName /SHORT $3 $0
783 StrCmp $2 "" "" AddToPath_done
788 StrCmp $2 "" "" AddToPath_done
790 StrCmp $4 1 AddToPath_NT
793 FileOpen $1 "$1\autoexec.bat" a
796 IntCmp $2 26 0 +2 +2 ; DOS EOF
797 FileSeek $1 -1 END ; write over EOF
798 FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
804 ReadRegStr $1 HKCU "Environment" "PATH"
805 StrCpy $2 $1 1 -1 ; copy last char
806 StrCmp $2 ";" 0 +2 ; if last char == ;
807 StrCpy $1 $1 -1 ; remove last char
808 StrCmp $1 "" AddToPath_NTdoIt
811 WriteRegExpandStr HKCU "Environment" "PATH" $0
812 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
822 ; RemoveFromPath - Remove a given dir from the path
823 ; Input: head of the stack
825 Function un.RemoveFromPath
834 IntFmt $6 "%c" 26 ; DOS EOF
838 StrCmp $1 1 unRemoveFromPath_NT
841 FileOpen $1 "$1\autoexec.bat" r
844 GetFullPathName /SHORT $0 $0
845 StrCpy $0 "SET PATH=%PATH%;$0"
846 Goto unRemoveFromPath_dosLoop
848 unRemoveFromPath_dosLoop:
850 StrCpy $5 $3 1 -1 ; read last char
851 StrCmp $5 $6 0 +2 ; if DOS EOF
852 StrCpy $3 $3 -1 ; remove DOS EOF so we can compare
853 StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
854 StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
855 StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
856 StrCmp $3 "" unRemoveFromPath_dosLoopEnd
858 Goto unRemoveFromPath_dosLoop
859 unRemoveFromPath_dosLoopRemoveLine:
861 Goto unRemoveFromPath_dosLoop
863 unRemoveFromPath_dosLoopEnd:
867 Delete "$1\autoexec.bat"
868 CopyFiles /SILENT $4 "$1\autoexec.bat"
870 Goto unRemoveFromPath_done
873 ReadRegStr $1 HKCU "Environment" "PATH"
874 StrCpy $5 $1 1 -1 ; copy last char
875 StrCmp $5 ";" +2 ; if last char != ;
876 StrCpy $1 "$1;" ; append ;
879 Call un.StrStr ; Find `$0;` in $1
880 Pop $2 ; pos of our dir
881 StrCmp $2 "" unRemoveFromPath_done
882 ; else, it is in path
887 StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
888 StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
891 StrCpy $5 $3 1 -1 ; copy last char
892 StrCmp $5 ";" 0 +2 ; if last char == ;
893 StrCpy $3 $3 -1 ; remove last char
896 ; New PATH not empty: update the registry
897 WriteRegExpandStr HKCU "Environment" "PATH" $3
899 ; New PATH empty: remove from the registry
900 DeleteRegValue HKCU "Environment" "PATH"
901 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
903 unRemoveFromPath_done:
913 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
914 ; Utility Functions ;
915 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
919 ; output, top of the stack = 1 if NT or 0 if not
924 ; ($R0 at this point is 1 or 0)
929 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
930 StrCmp $0 "" 0 IsNT_yes
943 !insertmacro IsNT "un."
946 ; input, top of stack = string to search for
947 ; top of stack-1 = string to search in
948 ; output, top of stack (replaces with the portion of the string remaining)
949 ; modifies no other variables.
952 ; Push "this is a long ass string"
956 ; ($R0 at this point is "ass string")
960 Exch $R1 ; st=haystack,old$R1, $R1=needle
961 Exch ; st=old$R1,haystack
962 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
974 StrCpy $R5 $R2 $R3 $R4
980 StrCpy $R1 $R2 "" $R4
988 !insertmacro StrStr ""
989 !insertmacro StrStr "un."