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 ;--------------------------------
89 !define SDCC.PushStr "!insertmacro MACRO_SDCC_PushStr"
90 !macro MACRO_SDCC_PushStr NAME
91 StrCpy $SDCC.StrStack4 $SDCC.StrStack3
92 StrCpy $SDCC.StrStack3 $SDCC.StrStack2
93 StrCpy $SDCC.StrStack2 $SDCC.StrStack1
94 StrCpy $SDCC.StrStack1 $SDCC.StrStack0
95 StrCpy $SDCC.StrStack0 $SDCC.FunctionName
96 StrCpy $SDCC.FunctionName ${NAME}
99 !define SDCC.PopStr "!insertmacro MACRO_SDCC_PopStr"
100 !macro MACRO_SDCC_PopStr
101 StrCpy $SDCC.FunctionName $SDCC.StrStack0
102 StrCpy $SDCC.StrStack0 $SDCC.StrStack1
103 StrCpy $SDCC.StrStack1 $SDCC.StrStack2
104 StrCpy $SDCC.StrStack2 $SDCC.StrStack3
105 StrCpy $SDCC.StrStack3 $SDCC.StrStack4
109 !define DebugMsg "!insertmacro MACRO_SDCC_DebugMsg"
110 !macro MACRO_SDCC_DebugMsg MSG
112 MessageBox MB_OK "*** $SDCC.FunctionName: ${MSG} ***"
116 !define Function "!insertmacro MACRO_SDCC_Function"
117 !macro MACRO_SDCC_Function NAME
120 ${SDCC.PushStr} ${NAME}
124 !define FunctionEnd "!insertmacro MACRO_SDCC_FunctionEnd"
125 !macro MACRO_SDCC_FunctionEnd
133 !define PRODUCT_NAME "SDCC"
136 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
137 !define PRODUCT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}"
139 !define PRODUCT_VERSION "XX.XX"
142 SetCompressor /SOLID lzma
144 !define SDCC_ROOT "."
146 !define DEV_ROOT "${SDCC_ROOT}"
148 !system "unix2dos ${SDCC_ROOT}\doc\ChangeLog_head.txt" = 0
149 !system "unix2dos ${SDCC_ROOT}\doc\README.TXT" = 0
151 InstType "Full (Bin, ucSim, SDCDB, Doc, Lib, Src)"
152 InstType "Medium (Bin, ucSim, SDCDB, Doc, Lib)"
153 InstType "Compact (Bin, ucSim, SDCDB, Doc)"
155 ;--------------------------------
159 !include WordFunc.nsh
164 ;--------------------------------
167 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
168 !insertmacro VersionCompare
171 ;--------------------------------
174 Var SDCC.PathToRemove
176 ;--------------------------------
179 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
182 !define MUI_ABORTWARNING
185 !insertmacro MUI_PAGE_WELCOME
188 !insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.TXT"
190 ; Uninstall/reinstall page
191 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
192 Page custom SDCC.PageReinstall SDCC.PageLeaveReinstall
196 !define MUI_STARTMENUPAGE_DEFAULTFOLDER ${PRODUCT_NAME}
197 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
198 !define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
199 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
200 !define MUI_STARTMENUPAGE_NODISABLE
201 Var MUI_STARTMENUPAGE_VARIABLE
202 !insertmacro MUI_PAGE_STARTMENU Application $MUI_STARTMENUPAGE_VARIABLE
205 !define MUI_COMPONENTSPAGE_SMALLDESC
206 !insertmacro MUI_PAGE_COMPONENTS
209 !insertmacro MUI_PAGE_DIRECTORY
212 !define MUI_PAGE_CUSTOMFUNCTION_LEAVE "SDCC.InstFilesLeave"
213 !insertmacro MUI_PAGE_INSTFILES
215 ${Function} SDCC.InstFilesLeave
216 ; Remove old path if reinstallation
217 ${If} $SDCC.PathToRemove != ""
218 ${DebugMsg} "removing path $SDCC.PathToRemove"
219 Push $SDCC.PathToRemove
220 Call SDCC.RemoveFromPath
225 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Add $INSTDIR\bin to the PATH"
226 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION SDCC.AddBinToPath
227 !define MUI_FINISHPAGE_SHOWREADME
228 !insertmacro MUI_PAGE_FINISH
230 ${Function} SDCC.AddBinToPath
232 ${DebugMsg} "adding path $INSTDIR\bin"
238 !insertmacro MUI_UNPAGE_CONFIRM
239 !insertmacro MUI_UNPAGE_INSTFILES
242 !insertmacro MUI_LANGUAGE "English"
244 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
247 InstallDir "$PROGRAMFILES\SDCC"
248 ;;;;ShowInstDetails show
249 ;;;;ShowUnInstDetails show
253 ${DebugMsg} "Pre INSTDIR = $INSTDIR"
255 !ifndef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
256 ; Old unistallation method
257 ; Uninstall the old version, if present
258 ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
261 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
262 "$(^Name) is already installed. $\n$\nClick 'OK' to remove the \
263 previous version or 'Cancel' to cancel this upgrade." \
268 ; Run the uninstaller
270 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
275 ; Install the new version
276 MessageBox MB_YESNO|MB_ICONQUESTION "This will install $(^Name). Do you wish to continue?" IDYES +2
281 ; If the registry key exists it is an uninstallation or reinstallation:
282 ; take the old installation directory
285 ReadRegStr $R2 HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation"
288 StrCpy $SDCC.PathToRemove "$INSTDIR\bin"
293 ${DebugMsg} "Post INSTDIR = $INSTDIR"
296 ${Function} un.onInit
298 ${DebugMsg} "Pre INSTDIR = $INSTDIR"
301 ReadRegStr $R2 HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation"
307 ${DebugMsg} "Post INSTDIR = $INSTDIR"
312 SetOutPath "$INSTDIR"
314 File "${SDCC_ROOT}\COPYING.TXT"
317 Section "SDCC application files" SEC01
319 SetOutPath "$INSTDIR\bin"
320 File "${SDCC_ROOT}\bin\as-gbz80.exe"
321 File "${SDCC_ROOT}\bin\as-hc08.exe"
322 File "${SDCC_ROOT}\bin\as-z80.exe"
323 File "${SDCC_ROOT}\bin\asx8051.exe"
324 File "${SDCC_ROOT}\bin\aslink.exe"
325 File "${SDCC_ROOT}\bin\link-gbz80.exe"
326 File "${SDCC_ROOT}\bin\link-hc08.exe"
327 File "${SDCC_ROOT}\bin\link-z80.exe"
328 File "${SDCC_ROOT}\bin\makebin.exe"
329 File "${SDCC_ROOT}\bin\packihx.exe"
330 File "${SDCC_ROOT}\bin\sdcc.exe"
331 File "${SDCC_ROOT}\bin\sdcclib.exe"
332 File "${SDCC_ROOT}\bin\sdcpp.exe"
333 File "${SDCC_ROOT}\bin\readline5.dll"
336 Section "ucSim application files" SEC02
338 SetOutPath "$INSTDIR\bin"
339 File "${SDCC_ROOT}\bin\s51.exe"
340 File "${SDCC_ROOT}\bin\savr.exe"
341 File "${SDCC_ROOT}\bin\shc08.exe"
342 File "${SDCC_ROOT}\bin\sz80.exe"
345 Section "SDCDB files" SEC03
347 File "${SDCC_ROOT}\bin\sdcdb.exe"
348 File "${SDCC_ROOT}\bin\sdcdb.el"
349 File "${SDCC_ROOT}\bin\sdcdbsrc.el"
352 Section "SDCC documentation" SEC04
354 SetOutPath "$INSTDIR\doc"
356 File /r "${SDCC_ROOT}\doc\*"
358 File "${SDCC_ROOT}\doc\ChangeLog_head.txt"
359 File "${SDCC_ROOT}\doc\README.TXT"
363 Section "SDCC include files" SEC05
365 SetOutPath "$INSTDIR\include\asm\default"
366 File "${DEV_ROOT}\include\asm\default\features.h"
367 SetOutPath "$INSTDIR\include\asm\ds390"
368 File "${DEV_ROOT}\include\asm\ds390\features.h"
369 SetOutPath "$INSTDIR\include\asm\gbz80"
370 File "${DEV_ROOT}\include\asm\gbz80\features.h"
371 SetOutPath "$INSTDIR\include\asm\mcs51"
372 File "${DEV_ROOT}\include\asm\mcs51\features.h"
373 SetOutPath "$INSTDIR\include\asm\pic"
374 File "${DEV_ROOT}\include\asm\pic\features.h"
375 SetOutPath "$INSTDIR\include\asm\pic16"
376 File "${DEV_ROOT}\include\asm\pic16\features.h"
377 SetOutPath "$INSTDIR\include\asm\z80"
378 File "${DEV_ROOT}\include\asm\z80\features.h"
379 SetOutPath "$INSTDIR\include\hc08"
380 File "${DEV_ROOT}\include\hc08\*.h"
381 SetOutPath "$INSTDIR\include\mcs51"
382 File "${DEV_ROOT}\include\mcs51\*.h"
383 SetOutPath "$INSTDIR\include\pic"
384 File "${DEV_ROOT}\include\pic\*.h"
385 File "${DEV_ROOT}\include\pic\*.txt"
386 File "${DEV_ROOT}\include\pic\*.inc"
387 SetOutPath "$INSTDIR\include\pic16"
388 File "${DEV_ROOT}\include\pic16\*.h"
389 SetOutPath "$INSTDIR\include\z80"
390 File "${DEV_ROOT}\include\z80\*.h"
391 SetOutPath "$INSTDIR\include"
392 File "${DEV_ROOT}\include\*.h"
395 Section "SDCC DS390 library" SEC06
397 SetOutPath "$INSTDIR\lib\ds390"
398 File "${DEV_ROOT}\lib\ds390\*.rel"
399 File "${DEV_ROOT}\lib\ds390\*.lib"
402 Section "SDCC DS400 library" SEC07
404 SetOutPath "$INSTDIR\lib\ds400"
405 File "${DEV_ROOT}\lib\ds400\*.rel"
406 File "${DEV_ROOT}\lib\ds400\*.lib"
409 Section "SDCC GBZ80 library" SEC08
411 SetOutPath "$INSTDIR\lib\gbz80"
412 File "${DEV_ROOT}\lib\gbz80\*.o"
413 File "${DEV_ROOT}\lib\gbz80\*.lib"
416 Section "SDCC Z80 library" SEC09
418 SetOutPath "$INSTDIR\lib\z80"
419 File "${DEV_ROOT}\lib\z80\*.o"
420 File "${DEV_ROOT}\lib\z80\*.lib"
423 Section "SDCC small model library" SEC10
425 SetOutPath "$INSTDIR\lib\small"
426 File "${DEV_ROOT}\lib\small\*.rel"
427 File "${DEV_ROOT}\lib\small\*.lib"
430 Section "SDCC medium model library" SEC11
432 SetOutPath "$INSTDIR\lib\medium"
433 File "${DEV_ROOT}\lib\medium\*.rel"
434 File "${DEV_ROOT}\lib\medium\*.lib"
437 Section "SDCC large model library" SEC12
439 SetOutPath "$INSTDIR\lib\large"
440 File "${DEV_ROOT}\lib\large\*.rel"
441 File "${DEV_ROOT}\lib\large\*.lib"
444 Section "SDCC small-stack-auto model library" SEC13
446 SetOutPath "$INSTDIR\lib\small-stack-auto"
447 File "${DEV_ROOT}\lib\small-stack-auto\*.rel"
448 File "${DEV_ROOT}\lib\small-stack-auto\*.lib"
451 Section "SDCC HC08 library" SEC14
453 SetOutPath "$INSTDIR\lib\hc08"
454 File "${DEV_ROOT}\lib\hc08\*.rel"
455 File "${DEV_ROOT}\lib\hc08\*.lib"
458 Section "SDCC PIC16 library" SEC15
460 SetOutPath "$INSTDIR\lib\pic16"
461 File "${DEV_ROOT}\lib\pic16\*.o"
462 File "${DEV_ROOT}\lib\pic16\*.lib"
465 Section "SDCC PIC library" SEC16
467 SetOutPath "$INSTDIR\lib\pic"
468 File "${DEV_ROOT}\lib\pic\*.lib"
471 Section "SDCC library sources" SEC17
473 SetOutPath "$INSTDIR\lib\src\ds390\examples"
474 File "${DEV_ROOT}\lib\src\ds390\examples\MOVED"
476 SetOutPath "$INSTDIR\lib\src\ds390"
477 File "${DEV_ROOT}\lib\src\ds390\*.c"
478 # File "${DEV_ROOT}\lib\src\ds390\Makefile"
480 SetOutPath "$INSTDIR\lib\src\ds400"
481 File "${DEV_ROOT}\lib\src\ds400\*.c"
482 # File "${DEV_ROOT}\lib\src\ds400\Makefile"
484 SetOutPath "$INSTDIR\lib\src\gbz80"
485 File "${DEV_ROOT}\lib\src\gbz80\*.c"
486 File "${DEV_ROOT}\lib\src\gbz80\*.s"
487 # File "${DEV_ROOT}\lib\src\gbz80\Makefile"
489 SetOutPath "$INSTDIR\lib\src\z80"
490 File "${DEV_ROOT}\lib\src\z80\*.c"
491 File "${DEV_ROOT}\lib\src\z80\*.s"
492 # File "${DEV_ROOT}\lib\src\z80\Makefile"
494 SetOutPath "$INSTDIR\lib\src\hc08"
495 File "${DEV_ROOT}\lib\src\hc08\*.c"
496 # File "${DEV_ROOT}\lib\src\hc08\Makefile"
498 SetOutPath "$INSTDIR\lib\src\mcs51"
499 File "${DEV_ROOT}\lib\src\mcs51\*.asm"
500 # File "${DEV_ROOT}\lib\src\mcs51\Makefile"
502 SetOutPath "$INSTDIR\lib\src\small"
503 # File "${DEV_ROOT}\lib\src\small\Makefile"
505 SetOutPath "$INSTDIR\lib\src\medium"
506 # File "${DEV_ROOT}\lib\src\medium\Makefile"
508 SetOutPath "$INSTDIR\lib\src\large"
509 # File "${DEV_ROOT}\lib\src\large\Makefile"
511 SetOutPath "$INSTDIR\lib\src\pic"
512 # File "${DEV_ROOT}\lib\src\pic\configure"
513 # File "${DEV_ROOT}\lib\src\pic\configure.in"
514 # File "${DEV_ROOT}\lib\src\pic\GPL"
515 # File "${DEV_ROOT}\lib\src\pic\LGPL"
516 # File "${DEV_ROOT}\lib\src\pic\Makefile"
517 # File "${DEV_ROOT}\lib\src\pic\Makefile.common"
518 # File "${DEV_ROOT}\lib\src\pic\Makefile.common.in"
519 # File "${DEV_ROOT}\lib\src\pic\Makefile.rules"
520 # File "${DEV_ROOT}\lib\src\pic\Makefile.subdir"
521 # File "${DEV_ROOT}\lib\src\pic\NEWS"
522 # File "${DEV_ROOT}\lib\src\pic\README"
523 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.c"
524 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.S"
526 SetOutPath "$INSTDIR\lib\src\pic\libsdcc"
527 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.c"
528 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.S"
529 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.inc"
530 # File "${DEV_ROOT}\lib\src\pic\libsdcc\Makefile"
532 SetOutPath "$INSTDIR\lib\src\pic\libdev"
533 File "${DEV_ROOT}\lib\src\pic\libdev\*.c"
534 # File "${DEV_ROOT}\lib\src\pic\libdev\Makefile"
536 SetOutPath "$INSTDIR\lib\src\pic\libm"
537 File "${DEV_ROOT}\lib\src\pic\libm\*.c"
539 SetOutPath "$INSTDIR\lib\src\pic16"
540 # File "${DEV_ROOT}\lib\src\pic16\configure"
541 # File "${DEV_ROOT}\lib\src\pic16\configure.in"
542 # File "${DEV_ROOT}\lib\src\pic16\COPYING"
543 # File "${DEV_ROOT}\lib\src\pic16\Makefile"
544 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common"
545 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common.in"
546 # File "${DEV_ROOT}\lib\src\pic16\Makefile.rules"
547 # File "${DEV_ROOT}\lib\src\pic16\Makefile.subdir"
548 # File "${DEV_ROOT}\lib\src\pic16\pics.all"
549 # File "${DEV_ROOT}\lib\src\pic16\pics.build"
550 # File "${DEV_ROOT}\lib\src\pic16\README"
552 SetOutPath "$INSTDIR\lib\src\pic16\debug"
553 # File "${DEV_ROOT}\lib\src\pic16\debug\Makefile"
555 SetOutPath "$INSTDIR\lib\src\pic16\debug\gstack"
556 # File "${DEV_ROOT}\lib\src\pic16\debug\gstack\Makefile"
557 File "${DEV_ROOT}\lib\src\pic16\debug\gstack\*.c"
559 SetOutPath "$INSTDIR\lib\src\pic16\libc"
560 # File "${DEV_ROOT}\lib\src\pic16\libc\Makefile"
562 SetOutPath "$INSTDIR\lib\src\pic16\libc\ctype"
563 File "${DEV_ROOT}\lib\src\pic16\libc\ctype\*.c"
564 # File "${DEV_ROOT}\lib\src\pic16\libc\ctype\Makefile"
566 SetOutPath "$INSTDIR\lib\src\pic16\libc\delay"
567 File "${DEV_ROOT}\lib\src\pic16\libc\delay\*.S"
568 # File "${DEV_ROOT}\lib\src\pic16\libc\delay\Makefile"
570 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdio"
571 File "${DEV_ROOT}\lib\src\pic16\libc\stdio\*.c"
572 # File "${DEV_ROOT}\lib\src\pic16\libc\stdio\Makefile"
574 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdlib"
575 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.c"
576 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.S"
577 # File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\Makefile"
579 SetOutPath "$INSTDIR\lib\src\pic16\libc\string"
580 File "${DEV_ROOT}\lib\src\pic16\libc\string\*.c"
581 # File "${DEV_ROOT}\lib\src\pic16\libc\string\Makefile"
583 SetOutPath "$INSTDIR\lib\src\pic16\libc\utils"
584 File "${DEV_ROOT}\lib\src\pic16\libc\utils\*.S"
585 # File "${DEV_ROOT}\lib\src\pic16\libc\utils\Makefile"
587 SetOutPath "$INSTDIR\lib\src\pic16\libdev"
588 File "${DEV_ROOT}\lib\src\pic16\libdev\*.c"
589 # File "${DEV_ROOT}\lib\src\pic16\libdev\Makefile"
591 SetOutPath "$INSTDIR\lib\src\pic16\libio"
592 File "${DEV_ROOT}\lib\src\pic16\libio\*.ignore"
593 # File "${DEV_ROOT}\lib\src\pic16\libio\Makefile"
595 SetOutPath "$INSTDIR\lib\src\pic16\libio\adc"
596 File "${DEV_ROOT}\lib\src\pic16\libio\adc\*.c"
597 # File "${DEV_ROOT}\lib\src\pic16\libio\adc\Makefile"
599 SetOutPath "$INSTDIR\lib\src\pic16\libio\i2c"
600 File "${DEV_ROOT}\lib\src\pic16\libio\i2c\*.c"
601 # File "${DEV_ROOT}\lib\src\pic16\libio\i2c\Makefile"
603 SetOutPath "$INSTDIR\lib\src\pic16\libio\usart"
604 File "${DEV_ROOT}\lib\src\pic16\libio\usart\*.c"
605 # File "${DEV_ROOT}\lib\src\pic16\libio\usart\Makefile"
607 SetOutPath "$INSTDIR\lib\src\pic16\libm"
608 File "${DEV_ROOT}\lib\src\pic16\libm\*.c"
609 # File "${DEV_ROOT}\lib\src\pic16\libm\Makefile"
611 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc"
612 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\Makefile"
614 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\char"
615 File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\*.c"
616 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\Makefile"
618 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\fixed16x16"
619 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.c"
620 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.S"
621 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\Makefile"
623 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\float"
624 File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\*.c"
625 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\Makefile"
627 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\gptr"
628 File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\*.c"
629 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\Makefile"
631 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\int"
632 File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\*.c"
633 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\Makefile"
635 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\long"
636 File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\*.c"
637 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\Makefile"
639 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\lregs"
640 File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\*.c"
641 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\Makefile"
643 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\stack"
644 File "${DEV_ROOT}\lib\src\pic16\libsdcc\stack\*.S"
646 SetOutPath "$INSTDIR\lib\src\pic16\startup"
647 File "${DEV_ROOT}\lib\src\pic16\startup\*.c"
648 # File "${DEV_ROOT}\lib\src\pic16\startup\Makefile"
649 # File "${DEV_ROOT}\lib\src\pic16\startup\README"
651 SetOutPath "$INSTDIR\lib\src"
652 File "${DEV_ROOT}\lib\src\*.c"
655 ;--------------------------------
659 LangString DESC_SEC01 ${LANG_ENGLISH} "SDCC application files"
660 LangString DESC_SEC02 ${LANG_ENGLISH} "ucSim application files"
661 LangString DESC_SEC03 ${LANG_ENGLISH} "SDCDB files"
662 LangString DESC_SEC04 ${LANG_ENGLISH} "SDCC documentation"
663 LangString DESC_SEC05 ${LANG_ENGLISH} "SDCC include files"
664 LangString DESC_SEC06 ${LANG_ENGLISH} "SDCC DS390 library"
665 LangString DESC_SEC07 ${LANG_ENGLISH} "SDCC DS400 library"
666 LangString DESC_SEC08 ${LANG_ENGLISH} "SDCC GBZ80 library"
667 LangString DESC_SEC09 ${LANG_ENGLISH} "SDCC Z80 library"
668 LangString DESC_SEC10 ${LANG_ENGLISH} "SDCC small model library"
669 LangString DESC_SEC11 ${LANG_ENGLISH} "SDCC medium model library"
670 LangString DESC_SEC12 ${LANG_ENGLISH} "SDCC large model library"
671 LangString DESC_SEC13 ${LANG_ENGLISH} "SDCC small-stack-auto model library"
672 LangString DESC_SEC14 ${LANG_ENGLISH} "SDCC HC08 library"
673 LangString DESC_SEC15 ${LANG_ENGLISH} "SDCC PIC16 library"
674 LangString DESC_SEC16 ${LANG_ENGLISH} "SDCC PIC library"
675 LangString DESC_SEC17 ${LANG_ENGLISH} "SDCC library sources"
677 ;Assign language strings to sections
678 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
679 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC01)
680 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC02)
681 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC03)
682 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC04)
683 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC05)
684 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $(DESC_SEC06)
685 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $(DESC_SEC07)
686 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $(DESC_SEC08)
687 !insertmacro MUI_DESCRIPTION_TEXT ${SEC09} $(DESC_SEC09)
688 !insertmacro MUI_DESCRIPTION_TEXT ${SEC10} $(DESC_SEC10)
689 !insertmacro MUI_DESCRIPTION_TEXT ${SEC11} $(DESC_SEC11)
690 !insertmacro MUI_DESCRIPTION_TEXT ${SEC12} $(DESC_SEC12)
691 !insertmacro MUI_DESCRIPTION_TEXT ${SEC13} $(DESC_SEC13)
692 !insertmacro MUI_DESCRIPTION_TEXT ${SEC14} $(DESC_SEC14)
693 !insertmacro MUI_DESCRIPTION_TEXT ${SEC15} $(DESC_SEC15)
694 !insertmacro MUI_DESCRIPTION_TEXT ${SEC16} $(DESC_SEC16)
695 !insertmacro MUI_DESCRIPTION_TEXT ${SEC17} $(DESC_SEC17)
696 !insertmacro MUI_FUNCTION_DESCRIPTION_END
697 ;--------------------------------
700 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
701 CreateDirectory "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
702 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" "$INSTDIR\sdcc.url"
703 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" "$INSTDIR\uninstall.exe"
704 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" ""
705 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog_head.txt" "" "$INSTDIR\sdcc.ico" "" "" "" ""
706 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.TXT"
707 !insertmacro MUI_STARTMENU_WRITE_END
711 WriteIniStr "$INSTDIR\sdcc.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/"
715 WriteRegStr HKLM "Software\${PRODUCT_NAME}" "" $INSTDIR
716 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
717 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMajor" "${VER_MAJOR}"
718 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMinor" "${VER_MINOR}"
719 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionRevision" "${VER_REVISION}"
720 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionBuild" "${VER_BUILD}"
723 WriteRegExpandStr HKLM "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninstall.exe"
724 WriteRegExpandStr HKLM "${PRODUCT_UNINST_KEY}" "InstallLocation" "$INSTDIR"
725 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "DisplayName" "${PRODUCT_NAME}"
726 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "Publisher" "sdcc.sourceforge.net"
727 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "http://sdcc.sourceforge.net/"
728 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "HelpLink" "http://sdcc.sourceforge.net/"
729 WriteRegStr HKLM "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "http://sdcc.sourceforge.net/"
731 WriteUninstaller "$INSTDIR\uninstall.exe"
735 ;;;; Uninstaller code ;;;;
738 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_STARTMENUPAGE_VARIABLE
740 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk"
741 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk"
742 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk"
743 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk"
744 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk"
746 RMDir "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
748 Delete "$INSTDIR\lib\src\large\Makefile"
750 Delete "$INSTDIR\lib\src\medium\Makefile"
752 Delete "$INSTDIR\lib\src\small\Makefile"
754 Delete "$INSTDIR\lib\src\mcs51\*.asm"
755 Delete "$INSTDIR\lib\src\mcs51\Makefile"
756 Delete "$INSTDIR\lib\src\mcs51\README"
758 Delete "$INSTDIR\lib\src\hc08\*.c"
759 Delete "$INSTDIR\lib\src\hc08\hc08.lib"
760 Delete "$INSTDIR\lib\src\hc08\Makefile"
762 Delete "$INSTDIR\lib\src\z80\*.c"
763 Delete "$INSTDIR\lib\src\z80\*.s"
764 Delete "$INSTDIR\lib\src\z80\z80.lib"
765 Delete "$INSTDIR\lib\src\z80\README"
766 Delete "$INSTDIR\lib\src\z80\Makefile"
768 Delete "$INSTDIR\lib\src\gbz80\*.c"
769 Delete "$INSTDIR\lib\src\gbz80\*.s"
770 Delete "$INSTDIR\lib\src\gbz80\gbz80.lib"
771 Delete "$INSTDIR\lib\src\gbz80\README"
772 Delete "$INSTDIR\lib\src\gbz80\Makefile"
774 Delete "$INSTDIR\lib\src\ds390\*.c"
775 Delete "$INSTDIR\lib\src\ds390\libds390.lib"
776 Delete "$INSTDIR\lib\src\ds390\Makefile.dep"
777 Delete "$INSTDIR\lib\src\ds390\Makefile"
778 Delete "$INSTDIR\lib\src\ds390\examples\MOVED"
780 Delete "$INSTDIR\lib\src\ds400\*.c"
781 Delete "$INSTDIR\lib\src\ds400\libds400.lib"
782 Delete "$INSTDIR\lib\src\ds400\Makefile.dep"
783 Delete "$INSTDIR\lib\src\ds400\Makefile"
785 Delete "$INSTDIR\lib\src\*.c"
787 Delete "$INSTDIR\lib\pic\*.o"
788 Delete "$INSTDIR\lib\pic\*.lib"
790 Delete "$INSTDIR\lib\pic16\*.o"
791 Delete "$INSTDIR\lib\pic16\*.lib"
793 Delete "$INSTDIR\lib\hc08\*.rel"
794 Delete "$INSTDIR\lib\hc08\*.lib"
796 Delete "$INSTDIR\lib\z80\*.o"
797 Delete "$INSTDIR\lib\z80\*.lib"
799 Delete "$INSTDIR\lib\small\*.rel"
800 Delete "$INSTDIR\lib\small\*.lib"
802 Delete "$INSTDIR\lib\medium\*.rel"
803 Delete "$INSTDIR\lib\medium\*.lib"
805 Delete "$INSTDIR\lib\large\*.rel"
806 Delete "$INSTDIR\lib\large\*.lib"
808 Delete "$INSTDIR\lib\small-stack-auto\*.rel"
809 Delete "$INSTDIR\lib\small-stack-auto\*.lib"
811 Delete "$INSTDIR\lib\gbz80\*.o"
812 Delete "$INSTDIR\lib\gbz80\*.lib"
814 Delete "$INSTDIR\lib\ds390\*.rel"
815 Delete "$INSTDIR\lib\ds390\*.lib"
817 Delete "$INSTDIR\lib\ds400\*.rel"
818 Delete "$INSTDIR\lib\ds400\*.lib"
820 Delete "$INSTDIR\include\asm\z80\*.h"
821 Delete "$INSTDIR\include\asm\pic16\*.h"
822 Delete "$INSTDIR\include\asm\pic\*.h"
823 Delete "$INSTDIR\include\asm\mcs51\*.h"
824 Delete "$INSTDIR\include\asm\gbz80\*.h"
825 Delete "$INSTDIR\include\asm\ds390\*.h"
826 Delete "$INSTDIR\include\asm\default\*.h"
827 Delete "$INSTDIR\include\z80\*.h"
828 Delete "$INSTDIR\include\pic\*.h"
829 Delete "$INSTDIR\include\pic\*.txt"
830 Delete "$INSTDIR\include\pic\*.inc"
831 Delete "$INSTDIR\include\pic16\*.h"
832 Delete "$INSTDIR\include\mcs51\*.h"
833 Delete "$INSTDIR\include\hc08\*.h"
834 Delete "$INSTDIR\include\*.h"
837 Delete "$INSTDIR\doc\README.TXT"
838 Delete "$INSTDIR\doc\ChangeLog_head.txt"
841 Delete "$INSTDIR\bin\as-gbz80.exe"
842 Delete "$INSTDIR\bin\as-hc08.exe"
843 Delete "$INSTDIR\bin\as-z80.exe"
844 Delete "$INSTDIR\bin\asx8051.exe"
845 Delete "$INSTDIR\bin\aslink.exe"
846 Delete "$INSTDIR\bin\link-gbz80.exe"
847 Delete "$INSTDIR\bin\link-hc08.exe"
848 Delete "$INSTDIR\bin\link-z80.exe"
849 Delete "$INSTDIR\bin\makebin.exe"
850 Delete "$INSTDIR\bin\packihx.exe"
851 Delete "$INSTDIR\bin\sdcc.exe"
852 Delete "$INSTDIR\bin\sdcclib.exe"
853 Delete "$INSTDIR\bin\sdcpp.exe"
854 Delete "$INSTDIR\bin\readline5.dll"
857 Delete "$INSTDIR\bin\s51.exe"
858 Delete "$INSTDIR\bin\savr.exe"
859 Delete "$INSTDIR\bin\shc08.exe"
860 Delete "$INSTDIR\bin\sz80.exe"
862 Delete "$INSTDIR\bin\sdcdb.exe"
863 Delete "$INSTDIR\bin\sdcdb.el"
864 Delete "$INSTDIR\bin\sdcdbsrc.el"
866 Delete "$INSTDIR\COPYING.TXT"
867 Delete "$INSTDIR\sdcc.ico"
868 Delete "$INSTDIR\sdcc.url"
869 Delete "$INSTDIR\uninstall.exe"
871 RMDir /r "$INSTDIR\lib\src\pic"
872 RMDir /r "$INSTDIR\lib\src\pic16"
873 RMDir "$INSTDIR\lib\src\small"
874 RMDir "$INSTDIR\lib\src\medium"
875 RMDir "$INSTDIR\lib\src\large"
876 RMDir "$INSTDIR\lib\src\mcs51"
877 RMDir "$INSTDIR\lib\src\z80"
878 RMDir "$INSTDIR\lib\src\gbz80"
879 RMDir "$INSTDIR\lib\src\ds390\examples"
880 RMDir "$INSTDIR\lib\src\ds390"
881 RMDir "$INSTDIR\lib\src\ds400"
882 RMDir "$INSTDIR\lib\src\hc08"
883 RMDir "$INSTDIR\lib\src"
885 RMDir "$INSTDIR\lib\pic"
886 RMDir "$INSTDIR\lib\pic16"
887 RMDir "$INSTDIR\lib\z80"
888 RMDir "$INSTDIR\lib\small"
889 RMDir "$INSTDIR\lib\medium"
890 RMDir "$INSTDIR\lib\large"
891 RMDir "$INSTDIR\lib\small-stack-auto"
892 RMDir "$INSTDIR\lib\gbz80"
893 RMDir "$INSTDIR\lib\ds390"
894 RMDir "$INSTDIR\lib\ds400"
895 RMDir "$INSTDIR\lib\hc08"
898 RMDir "$INSTDIR\include\asm\z80"
899 RMDir "$INSTDIR\include\asm\pic16"
900 RMDir "$INSTDIR\include\asm\pic"
901 RMDir "$INSTDIR\include\asm\mcs51"
902 RMDir "$INSTDIR\include\asm\gbz80"
903 RMDir "$INSTDIR\include\asm\ds390"
904 RMDir "$INSTDIR\include\asm\default"
905 RMDir "$INSTDIR\include\asm"
906 RMDir "$INSTDIR\include\z80"
907 RMDir "$INSTDIR\include\pic"
908 RMDir "$INSTDIR\include\pic16"
909 RMDir "$INSTDIR\include\mcs51"
910 RMDir "$INSTDIR\include\hc08"
911 RMDir "$INSTDIR\include"
914 RMDir /r "$INSTDIR\doc"
923 ${DebugMsg} "removing path $INSTDIR\bin"
925 Call un.SDCC.RemoveFromPath
928 DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
929 DeleteRegKey HKLM "Software\${PRODUCT_NAME}"
930 ;;;; SetAutoClose true
933 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
934 ; Path Manipulation functions ;
935 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
938 !include "WinMessages.nsh"
941 ; AddToPath - Adds the given dir to the search path.
942 ; Input - head of the stack
943 ; Note - Win9x systems requires reboot
945 ${Function} SDCC.AddToPath
952 ; don't add if the path doesn't exist
953 ${If} ${FileExists} $0
957 ; Not on NT: read PATH from environment variable
960 ; On NT: read PATH from registry
961 ReadRegStr $1 HKCU "Environment" "PATH"
964 ${StrStr} $2 "$1;" "$0;"
966 ${StrStr} $2 "$1;" "$0\;"
968 GetFullPathName /SHORT $3 $0
969 ${StrStr} $2 "$1;" "$3;"
971 ${StrStr} $2 "$1;" "$03\;"
976 FileOpen $1 "$1\autoexec.bat" a
979 ${If} $2 = 26 ; DOS EOF
980 FileSeek $1 -1 END ; write over EOF
982 FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
986 ;System PATH variable is at:
987 ;HKLM "/SYSTEM/CurrentControlSet/Control/Session Manager/Environment" "Path"
988 ReadRegStr $1 HKCU "Environment" "PATH"
989 StrCpy $2 $1 1 -1 ; copy last char
990 ${If} $2 == ";" ; if last char == ;
991 StrCpy $1 $1 -1 ; remove last char
996 WriteRegExpandStr HKCU "Environment" "PATH" $0
997 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
1012 ; RemoveFromPath - Remove a given dir from the path
1013 ; Input: head of the stack
1015 !macro SDCC.RemoveFromPath un
1016 ${Function} ${un}SDCC.RemoveFromPath
1025 IntFmt $6 "%c" 26 ; DOS EOF
1032 FileOpen $1 "$1\autoexec.bat" r
1035 GetFullPathName /SHORT $0 $0
1036 StrCpy $0 "SET PATH=%PATH%;$0"
1039 ; copy all lines except the line containing "SET PATH=%PATH%;$0"
1040 ; from autoexec.bat to the temporary file
1044 StrCpy $5 $3 1 -1 ; read last char
1045 ${If} $5 == $6 ; if DOS EOF
1046 StrCpy $3 $3 -1 ; remove DOS EOF so we can compare
1048 ${If} $3 != "$0$\r$\n"
1049 ${AndIf} $3 != "$0$\n"
1054 ; This is the line I'm looking for:
1064 Delete "$1\autoexec.bat"
1065 CopyFiles /SILENT $4 "$1\autoexec.bat"
1068 ;System PATH variable is at:
1069 ;HKLM "/SYSTEM/CurrentControlSet/Control/Session Manager/Environment" "Path"
1070 ReadRegStr $1 HKCU "Environment" "PATH"
1071 StrCpy $5 $1 1 -1 ; copy last char
1072 ${If} $5 != ";" ; if last char != ;
1073 StrCpy $1 "$1;" ; append ;
1077 Call ${un}StrStr ; Find `$0;` in $1
1078 Pop $2 ; pos of our dir
1085 StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
1086 StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
1089 StrCpy $5 $3 1 -1 ; copy last char
1090 ${If} $5 == ";" ; if last char == ;
1091 StrCpy $3 $3 -1 ; remove last char
1094 ; New PATH not empty: update the registry
1095 WriteRegExpandStr HKCU "Environment" "PATH" $3
1097 ; New PATH empty: remove from the registry
1098 DeleteRegValue HKCU "Environment" "PATH"
1100 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
1113 !insertmacro SDCC.RemoveFromPath ""
1114 !insertmacro SDCC.RemoveFromPath "un."
1116 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1117 ; Utility Functions ;
1118 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1122 ; output, top of the stack = 1 if NT or 0 if not
1127 ; ($R0 at this point is 1 or 0)
1130 ${Function} ${un}SDCC.IsNT
1132 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
1144 !insertmacro SDCC.IsNT ""
1145 !insertmacro SDCC.IsNT "un."
1147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1148 ; Uninstall/Reinstall page functions ;
1149 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1151 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
1153 Var ReinstallPageCheck
1155 ${Function} SDCC.PageReinstall
1157 ReadRegStr $R0 HKLM "Software\${PRODUCT_NAME}" ""
1160 ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
1166 ReadRegDWORD $R0 HKLM "Software\${PRODUCT_NAME}" "VersionMajor"
1167 ReadRegDWORD $R1 HKLM "Software\${PRODUCT_NAME}" "VersionMinor"
1168 ReadRegDWORD $R2 HKLM "Software\${PRODUCT_NAME}" "VersionRevision"
1169 ReadRegDWORD $R3 HKLM "Software\${PRODUCT_NAME}" "VersionBuild"
1170 StrCpy $R0 $R0.$R1.$R2.$R3
1172 ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
1174 StrCpy $R1 "${PRODUCT_NAME} ${PRODUCT_VERSION} is already installed. Select the operation you want to perform and click Next to continue."
1175 StrCpy $R2 "Add/Reinstall components"
1176 StrCpy $R3 "Uninstall ${PRODUCT_NAME}"
1177 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
1180 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."
1181 StrCpy $R2 "Uninstall before installing"
1182 StrCpy $R3 "Do not uninstall"
1183 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1186 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."
1187 StrCpy $R2 "Uninstall before installing"
1188 StrCpy $R3 "Do not uninstall"
1189 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1195 nsDialogs::Create /NOUNLOAD 1018
1197 ${NSD_CreateLabel} 0 0 100% 24u $R1
1200 ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
1202 ${NSD_OnClick} $R2 SDCC.PageReinstallUpdateSelection
1204 ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3
1206 ${NSD_OnClick} $R3 SDCC.PageReinstallUpdateSelection
1208 ${If} $ReinstallPageCheck != 2
1209 SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0
1211 SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0
1218 ${Function} SDCC.PageReinstallUpdateSelection
1222 ${NSD_GetState} $R2 $R1
1224 ${If} $R1 == ${BST_CHECKED}
1225 StrCpy $ReinstallPageCheck 1
1227 StrCpy $ReinstallPageCheck 2
1232 ${Function} SDCC.PageLeaveReinstall
1234 ${NSD_GetState} $R2 $R1
1236 ${DebugMsg} "R0 = $R0, R1 = $R1, R2 = $R2"
1248 ReadRegStr $R1 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
1254 ExecWait '$R1 _?=$INSTDIR'
1257 ${AndIfNot} ${FileExists} "$INSTDIR\bin\${PRODUCT_NAME}.exe"
1258 ${DebugMsg} "deleting file $R1 and directory $INSTDIR"
1273 !endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD