1 # sdcc.nsi - NSIS installer script for SDCC
3 # Copyright (c) 2003-2008 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 it 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" -DVER_MAJOR=<SDCC_VER_MAJOR> -DVER_MINOR=<SDCC_VER_MINOR> -DVER_REVISION=<SDCC_VER_DEVEL> -DVER_BUILD=<SDCC_REVISION> sdcc.nsi
39 # replace <VER_XXX> with the appropriate values, for example for SDCC 2.7.4:
40 # <SDCC_VER_MAJOR> = 2
41 # <SDCC_VER_MINOR> = 7
42 # <SDCC_VER_DEVEL> = 4
43 # replace <SDCC_REVISION> with the current svn revision number
44 # - A setup file setup.exe is created in PKGDIR directory.
45 # Rename it to sdcc-yyyymmdd-rrrr-setup.exe and upload it
46 # to sdcc download repository at sourceforge.net
49 # How to create WIN32 release setup.exe package
51 # - unpack WIN32 mingw daily snapshot sdcc-snapshot-i586-mingw32msvc-yyyymmdd-rrrr.zip
52 # to a clean directory (the option to create directories should be enabled).
53 # A sub directory sdcc is created (referenced as PKGDIR in continuation).
54 # - remove the PKGDIR/doc/README.TXT file
55 # - unpack sdcc-doc-yyyymmdd-rrrr.zip to the PKGDIR/doc directory
56 # - copy files sdcc/support/scripts/sdcc.ico and sdcc/support/scripts/sdcc.nsi
57 # (this file) from the sdcc Subversion snapshot to the PKGDIR directory
58 # - copy file COPYING from the sdcc Subversion snapshot to the PKGDIR directory,
59 # rename it to COPYING.TXT and it to DOS format:
60 # unix2dos COPYING.TXT
61 # - copy readline5.dll to PKGDIR/bin/readline5.dll
62 # - run NSIS installer from PKGDIR directory:
63 # "c:\Program Files\NSIS\makensis.exe" -DFULL_DOC -DVER_MAJOR=<VER_MAJOR> -DVER_MINOR=<VER_MINOR> -DVER_REVISION=<VER_PATCH> -DVER_BUILD=<REVISION> sdcc.nsi
64 # - A setup file setup.exe is created in PKGDIR directory.
65 # Rename it to sdcc-x.x.x-setup.exe and upload it
66 # to sdcc download repository at sourceforge.net
68 # How to upload secc setup.exe tosourceforge.net
70 # Execute following commands from the cmd prompt:
71 # - sftp sdcc.sourceforge.net
72 # - cd /home/groups/s/sd/sdcc/htdocs/snapshots/i586-mingw32msvc-setup
73 # - put sdcc_yyyymmdd_setup.exe
76 # For debugging define -DSDCC.DEBUG command line option
78 ;--------------------------------
85 !define DebugMsg "!insertmacro MACRO_SDCC_DebugMsg"
86 !macro MACRO_SDCC_DebugMsg MSG
88 MessageBox MB_OK "*** $SDCC.FunctionName: ${MSG} ***"
92 !define Function "!insertmacro MACRO_SDCC_Function"
93 !macro MACRO_SDCC_Function NAME
96 StrCpy $SDCC.FunctionName ${NAME}
100 !define FunctionEnd "!insertmacro MACRO_SDCC_FunctionEnd"
101 !macro MACRO_SDCC_FunctionEnd
103 StrCpy $SDCC.FunctionName ""
109 !define PRODUCT_NAME "SDCC"
112 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
113 !define PRODUCT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}"
115 !define PRODUCT_VERSION "XX.XX"
118 SetCompressor /SOLID lzma
120 !define SDCC_ROOT "."
122 !define DEV_ROOT "${SDCC_ROOT}"
124 !system "unix2dos ${SDCC_ROOT}\doc\ChangeLog_head.txt" = 0
125 !system "unix2dos ${SDCC_ROOT}\doc\README.TXT" = 0
127 InstType "Full (Bin, ucSim, SDCDB, Doc, Lib, Src)"
128 InstType "Medium (Bin, ucSim, SDCDB, Doc, Lib)"
129 InstType "Compact (Bin, ucSim, SDCDB, Doc)"
131 ;--------------------------------
135 !include WordFunc.nsh
140 ;--------------------------------
143 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
144 !insertmacro VersionCompare
147 ;--------------------------------
150 Var SDCC.PathToRemove
152 ;--------------------------------
155 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
158 !define MUI_ABORTWARNING
161 !insertmacro MUI_PAGE_WELCOME
164 !insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.TXT"
166 ; Uninstall/reinstall page
167 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
168 Page custom SDCC.PageReinstall SDCC.PageLeaveReinstall
172 !define MUI_STARTMENUPAGE_DEFAULTFOLDER ${PRODUCT_NAME}
173 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
174 !define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
175 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
176 !define MUI_STARTMENUPAGE_NODISABLE
177 Var MUI_STARTMENUPAGE_VARIABLE
178 !insertmacro MUI_PAGE_STARTMENU Application $MUI_STARTMENUPAGE_VARIABLE
181 !define MUI_COMPONENTSPAGE_SMALLDESC
182 !insertmacro MUI_PAGE_COMPONENTS
185 !insertmacro MUI_PAGE_DIRECTORY
188 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE "SDCC.InstFilesLeave"
189 !insertmacro MUI_PAGE_INSTFILES
191 ${Function} SDCC.InstFilesLeave
192 ; Remove old path if reinstallation
193 ${If} $SDCC.PathToRemove != ""
194 ${DebugMsg} "removing path $SDCC.PathToRemove"
195 Push $SDCC.PathToRemove
196 Call SDCC.RemoveFromPath
201 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Add $INSTDIR\bin to the PATH"
202 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION SDCC.AddBinToPath
203 !define MUI_FINISHPAGE_SHOWREADME
204 !insertmacro MUI_PAGE_FINISH
206 ${Function} SDCC.AddBinToPath
208 ${DebugMsg} "adding path $INSTDIR\bin"
214 !insertmacro MUI_UNPAGE_CONFIRM
215 !insertmacro MUI_UNPAGE_INSTFILES
218 !insertmacro MUI_LANGUAGE "English"
220 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
223 InstallDir "$PROGRAMFILES\SDCC"
224 ;;;;ShowInstDetails show
225 ;;;;ShowUnInstDetails show
229 ${DebugMsg} "Pre INSTDIR = $INSTDIR"
231 !ifndef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
232 ; Old unistallation method
233 ; Uninstall the old version, if present
234 ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
237 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
238 "$(^Name) is already installed. $\n$\nClick 'OK' to remove the \
239 previous version or 'Cancel' to cancel this upgrade." \
244 ; Run the uninstaller
246 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
251 ; Install the new version
252 MessageBox MB_YESNO|MB_ICONQUESTION "This will install $(^Name). Do you wish to continue?" IDYES +2
257 ; If the registry key exists it is an uninstallation or reinstallation:
258 ; take the old installation directory
261 ReadRegStr $R2 HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation"
264 StrCpy $SDCC.PathToRemove "$INSTDIR\bin"
269 ${DebugMsg} "Post INSTDIR = $INSTDIR"
272 ${Function} un.onInit
274 ${DebugMsg} "Pre INSTDIR = $INSTDIR"
277 ReadRegStr $R2 HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation"
283 ${DebugMsg} "Post INSTDIR = $INSTDIR"
288 SetOutPath "$INSTDIR"
290 File "${SDCC_ROOT}\COPYING.TXT"
293 Section "SDCC application files" SEC01
295 SetOutPath "$INSTDIR\bin"
296 File "${SDCC_ROOT}\bin\as-gbz80.exe"
297 File "${SDCC_ROOT}\bin\as-hc08.exe"
298 File "${SDCC_ROOT}\bin\as-z80.exe"
299 File "${SDCC_ROOT}\bin\asx8051.exe"
300 File "${SDCC_ROOT}\bin\aslink.exe"
301 File "${SDCC_ROOT}\bin\link-gbz80.exe"
302 File "${SDCC_ROOT}\bin\link-hc08.exe"
303 File "${SDCC_ROOT}\bin\link-z80.exe"
304 File "${SDCC_ROOT}\bin\makebin.exe"
305 File "${SDCC_ROOT}\bin\packihx.exe"
306 File "${SDCC_ROOT}\bin\sdcc.exe"
307 File "${SDCC_ROOT}\bin\sdcclib.exe"
308 File "${SDCC_ROOT}\bin\sdcpp.exe"
309 File "${SDCC_ROOT}\bin\readline5.dll"
312 Section "ucSim application files" SEC02
314 SetOutPath "$INSTDIR\bin"
315 File "${SDCC_ROOT}\bin\s51.exe"
316 File "${SDCC_ROOT}\bin\savr.exe"
317 File "${SDCC_ROOT}\bin\shc08.exe"
318 File "${SDCC_ROOT}\bin\sz80.exe"
321 Section "SDCDB files" SEC03
323 File "${SDCC_ROOT}\bin\sdcdb.exe"
324 File "${SDCC_ROOT}\bin\sdcdb.el"
325 File "${SDCC_ROOT}\bin\sdcdbsrc.el"
328 Section "SDCC documentation" SEC04
330 SetOutPath "$INSTDIR\doc"
332 File /r "${SDCC_ROOT}\doc\*"
334 File "${SDCC_ROOT}\doc\ChangeLog_head.txt"
335 File "${SDCC_ROOT}\doc\README.TXT"
339 Section "SDCC include files" SEC05
341 SetOutPath "$INSTDIR\include\asm\default"
342 File "${DEV_ROOT}\include\asm\default\features.h"
343 SetOutPath "$INSTDIR\include\asm\ds390"
344 File "${DEV_ROOT}\include\asm\ds390\features.h"
345 SetOutPath "$INSTDIR\include\asm\gbz80"
346 File "${DEV_ROOT}\include\asm\gbz80\features.h"
347 SetOutPath "$INSTDIR\include\asm\mcs51"
348 File "${DEV_ROOT}\include\asm\mcs51\features.h"
349 SetOutPath "$INSTDIR\include\asm\pic"
350 File "${DEV_ROOT}\include\asm\pic\features.h"
351 SetOutPath "$INSTDIR\include\asm\pic16"
352 File "${DEV_ROOT}\include\asm\pic16\features.h"
353 SetOutPath "$INSTDIR\include\asm\z80"
354 File "${DEV_ROOT}\include\asm\z80\features.h"
355 SetOutPath "$INSTDIR\include\hc08"
356 File "${DEV_ROOT}\include\hc08\*.h"
357 SetOutPath "$INSTDIR\include\mcs51"
358 File "${DEV_ROOT}\include\mcs51\*.h"
359 SetOutPath "$INSTDIR\include\pic"
360 File "${DEV_ROOT}\include\pic\*.h"
361 File "${DEV_ROOT}\include\pic\*.txt"
362 File "${DEV_ROOT}\include\pic\*.inc"
363 SetOutPath "$INSTDIR\include\pic16"
364 File "${DEV_ROOT}\include\pic16\*.h"
365 SetOutPath "$INSTDIR\include\z80"
366 File "${DEV_ROOT}\include\z80\*.h"
367 SetOutPath "$INSTDIR\include"
368 File "${DEV_ROOT}\include\*.h"
371 Section "SDCC DS390 library" SEC06
373 SetOutPath "$INSTDIR\lib\ds390"
374 File "${DEV_ROOT}\lib\ds390\*.rel"
375 File "${DEV_ROOT}\lib\ds390\*.lib"
378 Section "SDCC DS400 library" SEC07
380 SetOutPath "$INSTDIR\lib\ds400"
381 File "${DEV_ROOT}\lib\ds400\*.rel"
382 File "${DEV_ROOT}\lib\ds400\*.lib"
385 Section "SDCC GBZ80 library" SEC08
387 SetOutPath "$INSTDIR\lib\gbz80"
388 File "${DEV_ROOT}\lib\gbz80\*.o"
389 File "${DEV_ROOT}\lib\gbz80\*.lib"
392 Section "SDCC Z80 library" SEC09
394 SetOutPath "$INSTDIR\lib\z80"
395 File "${DEV_ROOT}\lib\z80\*.o"
396 File "${DEV_ROOT}\lib\z80\*.lib"
399 Section "SDCC small model library" SEC10
401 SetOutPath "$INSTDIR\lib\small"
402 File "${DEV_ROOT}\lib\small\*.rel"
403 File "${DEV_ROOT}\lib\small\*.lib"
406 Section "SDCC medium model library" SEC11
408 SetOutPath "$INSTDIR\lib\medium"
409 File "${DEV_ROOT}\lib\medium\*.rel"
410 File "${DEV_ROOT}\lib\medium\*.lib"
413 Section "SDCC large model library" SEC12
415 SetOutPath "$INSTDIR\lib\large"
416 File "${DEV_ROOT}\lib\large\*.rel"
417 File "${DEV_ROOT}\lib\large\*.lib"
420 Section "SDCC small-stack-auto model library" SEC13
422 SetOutPath "$INSTDIR\lib\small-stack-auto"
423 File "${DEV_ROOT}\lib\small-stack-auto\*.rel"
424 File "${DEV_ROOT}\lib\small-stack-auto\*.lib"
427 Section "SDCC HC08 library" SEC14
429 SetOutPath "$INSTDIR\lib\hc08"
430 File "${DEV_ROOT}\lib\hc08\*.rel"
431 File "${DEV_ROOT}\lib\hc08\*.lib"
434 Section "SDCC PIC16 library" SEC15
436 SetOutPath "$INSTDIR\lib\pic16"
437 File "${DEV_ROOT}\lib\pic16\*.o"
438 File "${DEV_ROOT}\lib\pic16\*.lib"
441 Section "SDCC PIC library" SEC16
443 SetOutPath "$INSTDIR\lib\pic"
444 File "${DEV_ROOT}\lib\pic\*.lib"
447 Section "SDCC library sources" SEC17
449 SetOutPath "$INSTDIR\lib\src\ds390\examples"
450 File "${DEV_ROOT}\lib\src\ds390\examples\MOVED"
452 SetOutPath "$INSTDIR\lib\src\ds390"
453 File "${DEV_ROOT}\lib\src\ds390\*.c"
454 # File "${DEV_ROOT}\lib\src\ds390\Makefile"
456 SetOutPath "$INSTDIR\lib\src\ds400"
457 File "${DEV_ROOT}\lib\src\ds400\*.c"
458 # File "${DEV_ROOT}\lib\src\ds400\Makefile"
460 SetOutPath "$INSTDIR\lib\src\gbz80"
461 File "${DEV_ROOT}\lib\src\gbz80\*.c"
462 File "${DEV_ROOT}\lib\src\gbz80\*.s"
463 # File "${DEV_ROOT}\lib\src\gbz80\Makefile"
465 SetOutPath "$INSTDIR\lib\src\z80"
466 File "${DEV_ROOT}\lib\src\z80\*.c"
467 File "${DEV_ROOT}\lib\src\z80\*.s"
468 # File "${DEV_ROOT}\lib\src\z80\Makefile"
470 SetOutPath "$INSTDIR\lib\src\hc08"
471 File "${DEV_ROOT}\lib\src\hc08\*.c"
472 # File "${DEV_ROOT}\lib\src\hc08\Makefile"
474 SetOutPath "$INSTDIR\lib\src\mcs51"
475 File "${DEV_ROOT}\lib\src\mcs51\*.asm"
476 # File "${DEV_ROOT}\lib\src\mcs51\Makefile"
478 SetOutPath "$INSTDIR\lib\src\small"
479 # File "${DEV_ROOT}\lib\src\small\Makefile"
481 SetOutPath "$INSTDIR\lib\src\medium"
482 # File "${DEV_ROOT}\lib\src\medium\Makefile"
484 SetOutPath "$INSTDIR\lib\src\large"
485 # File "${DEV_ROOT}\lib\src\large\Makefile"
487 SetOutPath "$INSTDIR\lib\src\pic"
488 # File "${DEV_ROOT}\lib\src\pic\configure"
489 # File "${DEV_ROOT}\lib\src\pic\configure.in"
490 # File "${DEV_ROOT}\lib\src\pic\GPL"
491 # File "${DEV_ROOT}\lib\src\pic\LGPL"
492 # File "${DEV_ROOT}\lib\src\pic\Makefile"
493 # File "${DEV_ROOT}\lib\src\pic\Makefile.common"
494 # File "${DEV_ROOT}\lib\src\pic\Makefile.common.in"
495 # File "${DEV_ROOT}\lib\src\pic\Makefile.rules"
496 # File "${DEV_ROOT}\lib\src\pic\Makefile.subdir"
497 # File "${DEV_ROOT}\lib\src\pic\NEWS"
498 # File "${DEV_ROOT}\lib\src\pic\README"
499 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.c"
500 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.S"
502 SetOutPath "$INSTDIR\lib\src\pic\libsdcc"
503 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.c"
504 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.S"
505 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.inc"
506 # File "${DEV_ROOT}\lib\src\pic\libsdcc\Makefile"
508 SetOutPath "$INSTDIR\lib\src\pic\libdev"
509 File "${DEV_ROOT}\lib\src\pic\libdev\*.c"
510 # File "${DEV_ROOT}\lib\src\pic\libdev\Makefile"
512 SetOutPath "$INSTDIR\lib\src\pic\libm"
513 File "${DEV_ROOT}\lib\src\pic\libm\*.c"
515 SetOutPath "$INSTDIR\lib\src\pic16"
516 # File "${DEV_ROOT}\lib\src\pic16\configure"
517 # File "${DEV_ROOT}\lib\src\pic16\configure.in"
518 # File "${DEV_ROOT}\lib\src\pic16\COPYING"
519 # File "${DEV_ROOT}\lib\src\pic16\Makefile"
520 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common"
521 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common.in"
522 # File "${DEV_ROOT}\lib\src\pic16\Makefile.rules"
523 # File "${DEV_ROOT}\lib\src\pic16\Makefile.subdir"
524 # File "${DEV_ROOT}\lib\src\pic16\pics.all"
525 # File "${DEV_ROOT}\lib\src\pic16\pics.build"
526 # File "${DEV_ROOT}\lib\src\pic16\README"
528 SetOutPath "$INSTDIR\lib\src\pic16\debug"
529 # File "${DEV_ROOT}\lib\src\pic16\debug\Makefile"
531 SetOutPath "$INSTDIR\lib\src\pic16\debug\gstack"
532 # File "${DEV_ROOT}\lib\src\pic16\debug\gstack\Makefile"
533 File "${DEV_ROOT}\lib\src\pic16\debug\gstack\*.c"
535 SetOutPath "$INSTDIR\lib\src\pic16\libc"
536 # File "${DEV_ROOT}\lib\src\pic16\libc\Makefile"
538 SetOutPath "$INSTDIR\lib\src\pic16\libc\ctype"
539 File "${DEV_ROOT}\lib\src\pic16\libc\ctype\*.c"
540 # File "${DEV_ROOT}\lib\src\pic16\libc\ctype\Makefile"
542 SetOutPath "$INSTDIR\lib\src\pic16\libc\delay"
543 File "${DEV_ROOT}\lib\src\pic16\libc\delay\*.S"
544 # File "${DEV_ROOT}\lib\src\pic16\libc\delay\Makefile"
546 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdio"
547 File "${DEV_ROOT}\lib\src\pic16\libc\stdio\*.c"
548 # File "${DEV_ROOT}\lib\src\pic16\libc\stdio\Makefile"
550 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdlib"
551 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.c"
552 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.S"
553 # File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\Makefile"
555 SetOutPath "$INSTDIR\lib\src\pic16\libc\string"
556 File "${DEV_ROOT}\lib\src\pic16\libc\string\*.c"
557 # File "${DEV_ROOT}\lib\src\pic16\libc\string\Makefile"
559 SetOutPath "$INSTDIR\lib\src\pic16\libc\utils"
560 File "${DEV_ROOT}\lib\src\pic16\libc\utils\*.S"
561 # File "${DEV_ROOT}\lib\src\pic16\libc\utils\Makefile"
563 SetOutPath "$INSTDIR\lib\src\pic16\libdev"
564 File "${DEV_ROOT}\lib\src\pic16\libdev\*.c"
565 # File "${DEV_ROOT}\lib\src\pic16\libdev\Makefile"
567 SetOutPath "$INSTDIR\lib\src\pic16\libio"
568 File "${DEV_ROOT}\lib\src\pic16\libio\*.ignore"
569 # File "${DEV_ROOT}\lib\src\pic16\libio\Makefile"
571 SetOutPath "$INSTDIR\lib\src\pic16\libio\adc"
572 File "${DEV_ROOT}\lib\src\pic16\libio\adc\*.c"
573 # File "${DEV_ROOT}\lib\src\pic16\libio\adc\Makefile"
575 SetOutPath "$INSTDIR\lib\src\pic16\libio\i2c"
576 File "${DEV_ROOT}\lib\src\pic16\libio\i2c\*.c"
577 # File "${DEV_ROOT}\lib\src\pic16\libio\i2c\Makefile"
579 SetOutPath "$INSTDIR\lib\src\pic16\libio\usart"
580 File "${DEV_ROOT}\lib\src\pic16\libio\usart\*.c"
581 # File "${DEV_ROOT}\lib\src\pic16\libio\usart\Makefile"
583 SetOutPath "$INSTDIR\lib\src\pic16\libm"
584 File "${DEV_ROOT}\lib\src\pic16\libm\*.c"
585 # File "${DEV_ROOT}\lib\src\pic16\libm\Makefile"
587 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc"
588 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\Makefile"
590 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\char"
591 File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\*.c"
592 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\Makefile"
594 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\fixed16x16"
595 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.c"
596 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.S"
597 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\Makefile"
599 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\float"
600 File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\*.c"
601 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\Makefile"
603 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\gptr"
604 File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\*.c"
605 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\Makefile"
607 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\int"
608 File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\*.c"
609 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\Makefile"
611 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\long"
612 File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\*.c"
613 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\Makefile"
615 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\lregs"
616 File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\*.c"
617 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\Makefile"
619 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\stack"
620 File "${DEV_ROOT}\lib\src\pic16\libsdcc\stack\*.S"
622 SetOutPath "$INSTDIR\lib\src\pic16\startup"
623 File "${DEV_ROOT}\lib\src\pic16\startup\*.c"
624 # File "${DEV_ROOT}\lib\src\pic16\startup\Makefile"
625 # File "${DEV_ROOT}\lib\src\pic16\startup\README"
627 SetOutPath "$INSTDIR\lib\src"
628 File "${DEV_ROOT}\lib\src\*.c"
631 ;--------------------------------
635 LangString DESC_SEC01 ${LANG_ENGLISH} "SDCC application files"
636 LangString DESC_SEC02 ${LANG_ENGLISH} "ucSim application files"
637 LangString DESC_SEC03 ${LANG_ENGLISH} "SDCDB files"
638 LangString DESC_SEC04 ${LANG_ENGLISH} "SDCC documentation"
639 LangString DESC_SEC05 ${LANG_ENGLISH} "SDCC include files"
640 LangString DESC_SEC06 ${LANG_ENGLISH} "SDCC DS390 library"
641 LangString DESC_SEC07 ${LANG_ENGLISH} "SDCC DS400 library"
642 LangString DESC_SEC08 ${LANG_ENGLISH} "SDCC GBZ80 library"
643 LangString DESC_SEC09 ${LANG_ENGLISH} "SDCC Z80 library"
644 LangString DESC_SEC10 ${LANG_ENGLISH} "SDCC small model library"
645 LangString DESC_SEC11 ${LANG_ENGLISH} "SDCC medium model library"
646 LangString DESC_SEC12 ${LANG_ENGLISH} "SDCC large model library"
647 LangString DESC_SEC13 ${LANG_ENGLISH} "SDCC small-stack-auto model library"
648 LangString DESC_SEC14 ${LANG_ENGLISH} "SDCC HC08 library"
649 LangString DESC_SEC15 ${LANG_ENGLISH} "SDCC PIC16 library"
650 LangString DESC_SEC16 ${LANG_ENGLISH} "SDCC PIC library"
651 LangString DESC_SEC17 ${LANG_ENGLISH} "SDCC library sources"
653 ;Assign language strings to sections
654 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
655 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC01)
656 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC02)
657 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC03)
658 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC04)
659 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC05)
660 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $(DESC_SEC06)
661 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $(DESC_SEC07)
662 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $(DESC_SEC08)
663 !insertmacro MUI_DESCRIPTION_TEXT ${SEC09} $(DESC_SEC09)
664 !insertmacro MUI_DESCRIPTION_TEXT ${SEC10} $(DESC_SEC10)
665 !insertmacro MUI_DESCRIPTION_TEXT ${SEC11} $(DESC_SEC11)
666 !insertmacro MUI_DESCRIPTION_TEXT ${SEC12} $(DESC_SEC12)
667 !insertmacro MUI_DESCRIPTION_TEXT ${SEC13} $(DESC_SEC13)
668 !insertmacro MUI_DESCRIPTION_TEXT ${SEC14} $(DESC_SEC14)
669 !insertmacro MUI_DESCRIPTION_TEXT ${SEC15} $(DESC_SEC15)
670 !insertmacro MUI_DESCRIPTION_TEXT ${SEC16} $(DESC_SEC16)
671 !insertmacro MUI_DESCRIPTION_TEXT ${SEC17} $(DESC_SEC17)
672 !insertmacro MUI_FUNCTION_DESCRIPTION_END
673 ;--------------------------------
676 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
677 CreateDirectory "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
678 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" "$INSTDIR\sdcc.url"
679 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" "$INSTDIR\uninstall.exe"
680 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" ""
681 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog_head.txt" "" "$INSTDIR\sdcc.ico" "" "" "" ""
682 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.TXT"
683 !insertmacro MUI_STARTMENU_WRITE_END
687 WriteIniStr "$INSTDIR\sdcc.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/"
691 WriteRegStr HKLM "Software\${PRODUCT_NAME}" "" $INSTDIR
692 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
693 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMajor" "${VER_MAJOR}"
694 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMinor" "${VER_MINOR}"
695 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionRevision" "${VER_REVISION}"
696 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionBuild" "${VER_BUILD}"
699 WriteRegExpandStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninstall.exe"
700 WriteRegExpandStr HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
701 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME}"
702 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "Publisher" "sdcc.sourceforge.net"
703 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "http://sdcc.sourceforge.net/"
704 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "HelpLink" "http://sdcc.sourceforge.net/"
705 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "http://sdcc.sourceforge.net/"
707 WriteUninstaller "$INSTDIR\uninstall.exe"
711 ;;;; Uninstaller code ;;;;
714 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_STARTMENUPAGE_VARIABLE
716 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk"
717 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk"
718 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk"
719 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk"
720 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk"
722 RMDir "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
724 Delete "$INSTDIR\lib\src\large\Makefile"
726 Delete "$INSTDIR\lib\src\medium\Makefile"
728 Delete "$INSTDIR\lib\src\small\Makefile"
730 Delete "$INSTDIR\lib\src\mcs51\*.asm"
731 Delete "$INSTDIR\lib\src\mcs51\Makefile"
732 Delete "$INSTDIR\lib\src\mcs51\README"
734 Delete "$INSTDIR\lib\src\hc08\*.c"
735 Delete "$INSTDIR\lib\src\hc08\hc08.lib"
736 Delete "$INSTDIR\lib\src\hc08\Makefile"
738 Delete "$INSTDIR\lib\src\z80\*.c"
739 Delete "$INSTDIR\lib\src\z80\*.s"
740 Delete "$INSTDIR\lib\src\z80\z80.lib"
741 Delete "$INSTDIR\lib\src\z80\README"
742 Delete "$INSTDIR\lib\src\z80\Makefile"
744 Delete "$INSTDIR\lib\src\gbz80\*.c"
745 Delete "$INSTDIR\lib\src\gbz80\*.s"
746 Delete "$INSTDIR\lib\src\gbz80\gbz80.lib"
747 Delete "$INSTDIR\lib\src\gbz80\README"
748 Delete "$INSTDIR\lib\src\gbz80\Makefile"
750 Delete "$INSTDIR\lib\src\ds390\*.c"
751 Delete "$INSTDIR\lib\src\ds390\libds390.lib"
752 Delete "$INSTDIR\lib\src\ds390\Makefile.dep"
753 Delete "$INSTDIR\lib\src\ds390\Makefile"
754 Delete "$INSTDIR\lib\src\ds390\examples\MOVED"
756 Delete "$INSTDIR\lib\src\ds400\*.c"
757 Delete "$INSTDIR\lib\src\ds400\libds400.lib"
758 Delete "$INSTDIR\lib\src\ds400\Makefile.dep"
759 Delete "$INSTDIR\lib\src\ds400\Makefile"
761 Delete "$INSTDIR\lib\src\*.c"
763 Delete "$INSTDIR\lib\pic\*.o"
764 Delete "$INSTDIR\lib\pic\*.lib"
766 Delete "$INSTDIR\lib\pic16\*.o"
767 Delete "$INSTDIR\lib\pic16\*.lib"
769 Delete "$INSTDIR\lib\hc08\*.rel"
770 Delete "$INSTDIR\lib\hc08\*.lib"
772 Delete "$INSTDIR\lib\z80\*.o"
773 Delete "$INSTDIR\lib\z80\*.lib"
775 Delete "$INSTDIR\lib\small\*.rel"
776 Delete "$INSTDIR\lib\small\*.lib"
778 Delete "$INSTDIR\lib\medium\*.rel"
779 Delete "$INSTDIR\lib\medium\*.lib"
781 Delete "$INSTDIR\lib\large\*.rel"
782 Delete "$INSTDIR\lib\large\*.lib"
784 Delete "$INSTDIR\lib\small-stack-auto\*.rel"
785 Delete "$INSTDIR\lib\small-stack-auto\*.lib"
787 Delete "$INSTDIR\lib\gbz80\*.o"
788 Delete "$INSTDIR\lib\gbz80\*.lib"
790 Delete "$INSTDIR\lib\ds390\*.rel"
791 Delete "$INSTDIR\lib\ds390\*.lib"
793 Delete "$INSTDIR\lib\ds400\*.rel"
794 Delete "$INSTDIR\lib\ds400\*.lib"
796 Delete "$INSTDIR\include\asm\z80\*.h"
797 Delete "$INSTDIR\include\asm\pic16\*.h"
798 Delete "$INSTDIR\include\asm\pic\*.h"
799 Delete "$INSTDIR\include\asm\mcs51\*.h"
800 Delete "$INSTDIR\include\asm\gbz80\*.h"
801 Delete "$INSTDIR\include\asm\ds390\*.h"
802 Delete "$INSTDIR\include\asm\default\*.h"
803 Delete "$INSTDIR\include\z80\*.h"
804 Delete "$INSTDIR\include\pic\*.h"
805 Delete "$INSTDIR\include\pic\*.txt"
806 Delete "$INSTDIR\include\pic\*.inc"
807 Delete "$INSTDIR\include\pic16\*.h"
808 Delete "$INSTDIR\include\mcs51\*.h"
809 Delete "$INSTDIR\include\hc08\*.h"
810 Delete "$INSTDIR\include\*.h"
813 Delete "$INSTDIR\doc\README.TXT"
814 Delete "$INSTDIR\doc\ChangeLog_head.txt"
817 Delete "$INSTDIR\bin\as-gbz80.exe"
818 Delete "$INSTDIR\bin\as-hc08.exe"
819 Delete "$INSTDIR\bin\as-z80.exe"
820 Delete "$INSTDIR\bin\asx8051.exe"
821 Delete "$INSTDIR\bin\aslink.exe"
822 Delete "$INSTDIR\bin\link-gbz80.exe"
823 Delete "$INSTDIR\bin\link-hc08.exe"
824 Delete "$INSTDIR\bin\link-z80.exe"
825 Delete "$INSTDIR\bin\makebin.exe"
826 Delete "$INSTDIR\bin\packihx.exe"
827 Delete "$INSTDIR\bin\sdcc.exe"
828 Delete "$INSTDIR\bin\sdcclib.exe"
829 Delete "$INSTDIR\bin\sdcpp.exe"
830 Delete "$INSTDIR\bin\readline5.dll"
833 Delete "$INSTDIR\bin\s51.exe"
834 Delete "$INSTDIR\bin\savr.exe"
835 Delete "$INSTDIR\bin\shc08.exe"
836 Delete "$INSTDIR\bin\sz80.exe"
838 Delete "$INSTDIR\bin\sdcdb.exe"
839 Delete "$INSTDIR\bin\sdcdb.el"
840 Delete "$INSTDIR\bin\sdcdbsrc.el"
842 Delete "$INSTDIR\COPYING.TXT"
843 Delete "$INSTDIR\sdcc.ico"
844 Delete "$INSTDIR\sdcc.url"
845 Delete "$INSTDIR\uninstall.exe"
847 RMDir /r "$INSTDIR\lib\src\pic"
848 RMDir /r "$INSTDIR\lib\src\pic16"
849 RMDir "$INSTDIR\lib\src\small"
850 RMDir "$INSTDIR\lib\src\medium"
851 RMDir "$INSTDIR\lib\src\large"
852 RMDir "$INSTDIR\lib\src\mcs51"
853 RMDir "$INSTDIR\lib\src\z80"
854 RMDir "$INSTDIR\lib\src\gbz80"
855 RMDir "$INSTDIR\lib\src\ds390\examples"
856 RMDir "$INSTDIR\lib\src\ds390"
857 RMDir "$INSTDIR\lib\src\ds400"
858 RMDir "$INSTDIR\lib\src\hc08"
859 RMDir "$INSTDIR\lib\src"
861 RMDir "$INSTDIR\lib\pic"
862 RMDir "$INSTDIR\lib\pic16"
863 RMDir "$INSTDIR\lib\z80"
864 RMDir "$INSTDIR\lib\small"
865 RMDir "$INSTDIR\lib\medium"
866 RMDir "$INSTDIR\lib\large"
867 RMDir "$INSTDIR\lib\small-stack-auto"
868 RMDir "$INSTDIR\lib\gbz80"
869 RMDir "$INSTDIR\lib\ds390"
870 RMDir "$INSTDIR\lib\ds400"
871 RMDir "$INSTDIR\lib\hc08"
874 RMDir "$INSTDIR\include\asm\z80"
875 RMDir "$INSTDIR\include\asm\pic16"
876 RMDir "$INSTDIR\include\asm\pic"
877 RMDir "$INSTDIR\include\asm\mcs51"
878 RMDir "$INSTDIR\include\asm\gbz80"
879 RMDir "$INSTDIR\include\asm\ds390"
880 RMDir "$INSTDIR\include\asm\default"
881 RMDir "$INSTDIR\include\asm"
882 RMDir "$INSTDIR\include\z80"
883 RMDir "$INSTDIR\include\pic"
884 RMDir "$INSTDIR\include\pic16"
885 RMDir "$INSTDIR\include\mcs51"
886 RMDir "$INSTDIR\include\hc08"
887 RMDir "$INSTDIR\include"
890 RMDir /r "$INSTDIR\doc"
899 ${DebugMsg} "removing path $INSTDIR\bin"
901 Call un.SDCC.RemoveFromPath
904 DeleteRegValue HKLM "${PRODUCT_UNINST_KEY}" "NSIS:StartMenuDir"
905 DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
906 DeleteRegKey HKLM "Software\${PRODUCT_NAME}"
907 ;;;; SetAutoClose true
910 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
911 ; Path Manipulation functions ;
912 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
915 !include "WinMessages.nsh"
918 ; AddToPath - Adds the given dir to the search path.
919 ; Input - head of the stack
920 ; Note - Win9x systems requires reboot
922 ${Function} SDCC.AddToPath
929 ; don't add if the path doesn't exist
930 IfFileExists $0 "" AddToPath_done
935 ; Not on NT: read PATH from environment variable
938 ; On NT: read PATH from registry
939 ReadRegStr $1 HKCU "Environment" "PATH"
940 ${StrStr} $2 "$1;" "$0;"
941 StrCmp $2 "" "" AddToPath_done
943 ${StrStr} $2 "$1;" "$0\;"
944 StrCmp $2 "" "" AddToPath_done
946 GetFullPathName /SHORT $3 $0
947 ${StrStr} $2 "$1;" "$3;"
948 StrCmp $2 "" "" AddToPath_done
950 ${StrStr} $2 "$1;" "$03\;"
951 StrCmp $2 "" "" AddToPath_done
953 StrCmp $4 1 AddToPath_NT
956 FileOpen $1 "$1\autoexec.bat" a
959 IntCmp $2 26 0 +2 +2 ; DOS EOF
960 FileSeek $1 -1 END ; write over EOF
961 FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
967 ;System PATH variable is at:
968 ;HKLM "/SYSTEM/CurrentControlSet/Control/Session Manager/Environment" "Path"
969 ReadRegStr $1 HKCU "Environment" "PATH"
970 StrCpy $2 $1 1 -1 ; copy last char
971 StrCmp $2 ";" 0 +2 ; if last char == ;
972 StrCpy $1 $1 -1 ; remove last char
973 StrCmp $1 "" AddToPath_NTdoIt
976 WriteRegExpandStr HKCU "Environment" "PATH" $0
977 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
987 ; RemoveFromPath - Remove a given dir from the path
988 ; Input: head of the stack
990 !macro SDCC.RemoveFromPath un
991 ${Function} ${un}SDCC.RemoveFromPath
1000 IntFmt $6 "%c" 26 ; DOS EOF
1004 StrCmp $1 1 unRemoveFromPath_NT
1007 FileOpen $1 "$1\autoexec.bat" r
1010 GetFullPathName /SHORT $0 $0
1011 StrCpy $0 "SET PATH=%PATH%;$0"
1012 Goto unRemoveFromPath_dosLoop
1014 unRemoveFromPath_dosLoop:
1016 StrCpy $5 $3 1 -1 ; read last char
1017 StrCmp $5 $6 0 +2 ; if DOS EOF
1018 StrCpy $3 $3 -1 ; remove DOS EOF so we can compare
1019 StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
1020 StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
1021 StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
1022 StrCmp $3 "" unRemoveFromPath_dosLoopEnd
1024 Goto unRemoveFromPath_dosLoop
1025 unRemoveFromPath_dosLoopRemoveLine:
1027 Goto unRemoveFromPath_dosLoop
1029 unRemoveFromPath_dosLoopEnd:
1033 Delete "$1\autoexec.bat"
1034 CopyFiles /SILENT $4 "$1\autoexec.bat"
1036 Goto unRemoveFromPath_done
1038 unRemoveFromPath_NT:
1039 ;System PATH variable is at:
1040 ;HKLM "/SYSTEM/CurrentControlSet/Control/Session Manager/Environment" "Path"
1041 ReadRegStr $1 HKCU "Environment" "PATH"
1042 StrCpy $5 $1 1 -1 ; copy last char
1043 StrCmp $5 ";" +2 ; if last char != ;
1044 StrCpy $1 "$1;" ; append ;
1047 Call ${un}StrStr ; Find `$0;` in $1
1048 Pop $2 ; pos of our dir
1049 StrCmp $2 "" unRemoveFromPath_done
1050 ; else, it is in path
1055 StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
1056 StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
1059 StrCpy $5 $3 1 -1 ; copy last char
1060 StrCmp $5 ";" 0 +2 ; if last char == ;
1061 StrCpy $3 $3 -1 ; remove last char
1064 ; New PATH not empty: update the registry
1065 WriteRegExpandStr HKCU "Environment" "PATH" $3
1067 ; New PATH empty: remove from the registry
1068 DeleteRegValue HKCU "Environment" "PATH"
1069 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
1071 unRemoveFromPath_done:
1081 !insertmacro SDCC.RemoveFromPath ""
1082 !insertmacro SDCC.RemoveFromPath "un."
1084 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1085 ; Utility Functions ;
1086 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1090 ; output, top of the stack = 1 if NT or 0 if not
1095 ; ($R0 at this point is 1 or 0)
1098 ${Function} ${un}SDCC.IsNT
1100 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
1112 !insertmacro SDCC.IsNT ""
1113 !insertmacro SDCC.IsNT "un."
1115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1116 ; Uninstall/Reinstall page functions ;
1117 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1119 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
1121 Var ReinstallPageCheck
1123 ${Function} SDCC.PageReinstall
1125 ReadRegStr $R0 HKLM "Software\${PRODUCT_NAME}" ""
1128 ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
1134 ReadRegDWORD $R0 HKLM "Software\${PRODUCT_NAME}" "VersionMajor"
1135 ReadRegDWORD $R1 HKLM "Software\${PRODUCT_NAME}" "VersionMinor"
1136 ReadRegDWORD $R2 HKLM "Software\${PRODUCT_NAME}" "VersionRevision"
1137 ReadRegDWORD $R3 HKLM "Software\${PRODUCT_NAME}" "VersionBuild"
1138 StrCpy $R0 $R0.$R1.$R2.$R3
1140 ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
1142 StrCpy $R1 "${PRODUCT_NAME} ${PRODUCT_VERSION} is already installed. Select the operation you want to perform and click Next to continue."
1143 StrCpy $R2 "Add/Reinstall components"
1144 StrCpy $R3 "Uninstall ${PRODUCT_NAME}"
1145 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
1148 StrCpy $R1 "An older version of ${PRODUCT_NAME} is installed on your system. It's recommended that you uninstall the current version before installing. Select the operation you want to perform and click Next to continue."
1149 StrCpy $R2 "Uninstall before installing"
1150 StrCpy $R3 "Do not uninstall"
1151 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1154 StrCpy $R1 "A newer version of ${PRODUCT_NAME} is already installed! It is not recommended that you install an older version. If you really want to install this older version, it's better to uninstall the current version first. Select the operation you want to perform and click Next to continue."
1155 StrCpy $R2 "Uninstall before installing"
1156 StrCpy $R3 "Do not uninstall"
1157 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1163 nsDialogs::Create /NOUNLOAD 1018
1165 ${NSD_CreateLabel} 0 0 100% 24u $R1
1168 ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
1170 ${NSD_OnClick} $R2 SDCC.PageReinstallUpdateSelection
1172 ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3
1174 ${NSD_OnClick} $R3 SDCC.PageReinstallUpdateSelection
1176 ${If} $ReinstallPageCheck != 2
1177 SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0
1179 SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0
1186 ${Function} SDCC.PageReinstallUpdateSelection
1190 ${NSD_GetState} $R2 $R1
1192 ${If} $R1 == ${BST_CHECKED}
1193 StrCpy $ReinstallPageCheck 1
1195 StrCpy $ReinstallPageCheck 2
1200 ${Function} SDCC.PageLeaveReinstall
1202 ${NSD_GetState} $R2 $R1
1204 ${DebugMsg} "R0 = $R0, R1 = $R1, R2 = $R2"
1216 ReadRegStr $R1 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
1222 ExecWait '$R1 _?=$INSTDIR'
1225 ${AndIfNot} ${FileExists} "$INSTDIR\bin\${PRODUCT_NAME}.exe"
1226 ${DebugMsg} "deleting file $R1 and directory $INSTDIR"
1241 !endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD