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
77 !define PRODUCT_NAME "SDCC"
80 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
81 !define PRODUCT_VERSION "${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}"
83 !define PRODUCT_VERSION "XX.XX"
86 SetCompressor /SOLID lzma
90 !define DEV_ROOT "${SDCC_ROOT}"
92 !system "unix2dos ${SDCC_ROOT}\doc\ChangeLog_head.txt" = 0
93 !system "unix2dos ${SDCC_ROOT}\doc\README.TXT" = 0
95 InstType "Full (Bin, ucSim, SDCDB, Doc, Lib, Src)"
96 InstType "Medium (Bin, ucSim, SDCDB, Doc, Lib)"
97 InstType "Compact (Bin, ucSim, SDCDB, Doc)"
99 ;--------------------------------
103 !include "WordFunc.nsh"
105 ;--------------------------------
108 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
109 !insertmacro VersionCompare
112 ;--------------------------------
115 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
117 ;--------------------------------
121 !define MUI_ABORTWARNING
124 !insertmacro MUI_PAGE_WELCOME
127 !insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.TXT"
129 ; Uninstall/reinstall page
130 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
131 Page custom PageReinstall PageLeaveReinstall
135 !define MUI_STARTMENUPAGE_DEFAULTFOLDER ${PRODUCT_NAME}
136 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
137 !define MUI_STARTMENUPAGE_REGISTRY_KEY ${PRODUCT_UNINST_KEY}
138 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
139 !define MUI_STARTMENUPAGE_NODISABLE
140 Var MUI_STARTMENUPAGE_VARIABLE
141 !insertmacro MUI_PAGE_STARTMENU Application $MUI_STARTMENUPAGE_VARIABLE
144 !define MUI_COMPONENTSPAGE_SMALLDESC
145 !insertmacro MUI_PAGE_COMPONENTS
148 !insertmacro MUI_PAGE_DIRECTORY
151 !insertmacro MUI_PAGE_INSTFILES
154 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Add $INSTDIR\bin to the PATH"
155 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION AddBinToPath
156 !define MUI_FINISHPAGE_SHOWREADME
157 !insertmacro MUI_PAGE_FINISH
160 !insertmacro MUI_UNPAGE_CONFIRM
161 !insertmacro MUI_UNPAGE_INSTFILES
164 !insertmacro MUI_LANGUAGE "English"
166 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
169 InstallDir "$PROGRAMFILES\SDCC"
170 ;;;;ShowInstDetails show
171 ;;;;ShowUnInstDetails show
173 !ifndef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
174 ; Old unistallation method
176 ;Uninstall the old version, if present
177 ReadRegStr $R0 HKLM \
178 "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" \
182 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
183 "$(^Name) is already installed. $\n$\nClick 'OK' to remove the \
184 previous version or 'Cancel' to cancel this upgrade." \
189 ; Run the uninstaller
191 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
196 ; Install the new version
197 MessageBox MB_YESNO|MB_ICONQUESTION "This will install $(^Name). Do you wish to continue?" IDYES +2
205 SetOutPath "$INSTDIR"
207 File "${SDCC_ROOT}\COPYING.TXT"
210 Section "SDCC application files" SEC01
212 SetOutPath "$INSTDIR\bin"
213 File "${SDCC_ROOT}\bin\as-gbz80.exe"
214 File "${SDCC_ROOT}\bin\as-hc08.exe"
215 File "${SDCC_ROOT}\bin\as-z80.exe"
216 File "${SDCC_ROOT}\bin\asx8051.exe"
217 File "${SDCC_ROOT}\bin\aslink.exe"
218 File "${SDCC_ROOT}\bin\link-gbz80.exe"
219 File "${SDCC_ROOT}\bin\link-hc08.exe"
220 File "${SDCC_ROOT}\bin\link-z80.exe"
221 File "${SDCC_ROOT}\bin\makebin.exe"
222 File "${SDCC_ROOT}\bin\packihx.exe"
223 File "${SDCC_ROOT}\bin\sdcc.exe"
224 File "${SDCC_ROOT}\bin\sdcclib.exe"
225 File "${SDCC_ROOT}\bin\sdcpp.exe"
226 File "${SDCC_ROOT}\bin\readline5.dll"
229 Section "ucSim application files" SEC02
231 SetOutPath "$INSTDIR\bin"
232 File "${SDCC_ROOT}\bin\s51.exe"
233 File "${SDCC_ROOT}\bin\savr.exe"
234 File "${SDCC_ROOT}\bin\shc08.exe"
235 File "${SDCC_ROOT}\bin\sz80.exe"
238 Section "SDCDB files" SEC03
240 File "${SDCC_ROOT}\bin\sdcdb.exe"
241 File "${SDCC_ROOT}\bin\sdcdb.el"
242 File "${SDCC_ROOT}\bin\sdcdbsrc.el"
245 Section "SDCC documentation" SEC04
247 SetOutPath "$INSTDIR\doc"
249 File /r "${SDCC_ROOT}\doc\*"
251 File "${SDCC_ROOT}\doc\ChangeLog_head.txt"
252 File "${SDCC_ROOT}\doc\README.TXT"
256 Section "SDCC include files" SEC05
258 SetOutPath "$INSTDIR\include\asm\default"
259 File "${DEV_ROOT}\include\asm\default\features.h"
260 SetOutPath "$INSTDIR\include\asm\ds390"
261 File "${DEV_ROOT}\include\asm\ds390\features.h"
262 SetOutPath "$INSTDIR\include\asm\gbz80"
263 File "${DEV_ROOT}\include\asm\gbz80\features.h"
264 SetOutPath "$INSTDIR\include\asm\mcs51"
265 File "${DEV_ROOT}\include\asm\mcs51\features.h"
266 SetOutPath "$INSTDIR\include\asm\pic"
267 File "${DEV_ROOT}\include\asm\pic\features.h"
268 SetOutPath "$INSTDIR\include\asm\pic16"
269 File "${DEV_ROOT}\include\asm\pic16\features.h"
270 SetOutPath "$INSTDIR\include\asm\z80"
271 File "${DEV_ROOT}\include\asm\z80\features.h"
272 SetOutPath "$INSTDIR\include\hc08"
273 File "${DEV_ROOT}\include\hc08\*.h"
274 SetOutPath "$INSTDIR\include\mcs51"
275 File "${DEV_ROOT}\include\mcs51\*.h"
276 SetOutPath "$INSTDIR\include\pic"
277 File "${DEV_ROOT}\include\pic\*.h"
278 File "${DEV_ROOT}\include\pic\*.txt"
279 File "${DEV_ROOT}\include\pic\*.inc"
280 SetOutPath "$INSTDIR\include\pic16"
281 File "${DEV_ROOT}\include\pic16\*.h"
282 SetOutPath "$INSTDIR\include\z80"
283 File "${DEV_ROOT}\include\z80\*.h"
284 SetOutPath "$INSTDIR\include"
285 File "${DEV_ROOT}\include\*.h"
288 Section "SDCC DS390 library" SEC06
290 SetOutPath "$INSTDIR\lib\ds390"
291 File "${DEV_ROOT}\lib\ds390\*.rel"
292 File "${DEV_ROOT}\lib\ds390\*.lib"
295 Section "SDCC DS400 library" SEC07
297 SetOutPath "$INSTDIR\lib\ds400"
298 File "${DEV_ROOT}\lib\ds400\*.rel"
299 File "${DEV_ROOT}\lib\ds400\*.lib"
302 Section "SDCC GBZ80 library" SEC08
304 SetOutPath "$INSTDIR\lib\gbz80"
305 File "${DEV_ROOT}\lib\gbz80\*.o"
306 File "${DEV_ROOT}\lib\gbz80\*.lib"
309 Section "SDCC Z80 library" SEC09
311 SetOutPath "$INSTDIR\lib\z80"
312 File "${DEV_ROOT}\lib\z80\*.o"
313 File "${DEV_ROOT}\lib\z80\*.lib"
316 Section "SDCC small model library" SEC10
318 SetOutPath "$INSTDIR\lib\small"
319 File "${DEV_ROOT}\lib\small\*.rel"
320 File "${DEV_ROOT}\lib\small\*.lib"
323 Section "SDCC medium model library" SEC11
325 SetOutPath "$INSTDIR\lib\medium"
326 File "${DEV_ROOT}\lib\medium\*.rel"
327 File "${DEV_ROOT}\lib\medium\*.lib"
330 Section "SDCC large model library" SEC12
332 SetOutPath "$INSTDIR\lib\large"
333 File "${DEV_ROOT}\lib\large\*.rel"
334 File "${DEV_ROOT}\lib\large\*.lib"
337 Section "SDCC small-stack-auto model library" SEC13
339 SetOutPath "$INSTDIR\lib\small-stack-auto"
340 File "${DEV_ROOT}\lib\small-stack-auto\*.rel"
341 File "${DEV_ROOT}\lib\small-stack-auto\*.lib"
344 Section "SDCC HC08 library" SEC14
346 SetOutPath "$INSTDIR\lib\hc08"
347 File "${DEV_ROOT}\lib\hc08\*.rel"
348 File "${DEV_ROOT}\lib\hc08\*.lib"
351 Section "SDCC PIC16 library" SEC15
353 SetOutPath "$INSTDIR\lib\pic16"
354 File "${DEV_ROOT}\lib\pic16\*.o"
355 File "${DEV_ROOT}\lib\pic16\*.lib"
358 Section "SDCC PIC library" SEC16
360 SetOutPath "$INSTDIR\lib\pic"
361 File "${DEV_ROOT}\lib\pic\*.lib"
364 Section "SDCC library sources" SEC17
366 SetOutPath "$INSTDIR\lib\src\ds390\examples"
367 File "${DEV_ROOT}\lib\src\ds390\examples\MOVED"
369 SetOutPath "$INSTDIR\lib\src\ds390"
370 File "${DEV_ROOT}\lib\src\ds390\*.c"
371 # File "${DEV_ROOT}\lib\src\ds390\Makefile"
373 SetOutPath "$INSTDIR\lib\src\ds400"
374 File "${DEV_ROOT}\lib\src\ds400\*.c"
375 # File "${DEV_ROOT}\lib\src\ds400\Makefile"
377 SetOutPath "$INSTDIR\lib\src\gbz80"
378 File "${DEV_ROOT}\lib\src\gbz80\*.c"
379 File "${DEV_ROOT}\lib\src\gbz80\*.s"
380 # File "${DEV_ROOT}\lib\src\gbz80\Makefile"
382 SetOutPath "$INSTDIR\lib\src\z80"
383 File "${DEV_ROOT}\lib\src\z80\*.c"
384 File "${DEV_ROOT}\lib\src\z80\*.s"
385 # File "${DEV_ROOT}\lib\src\z80\Makefile"
387 SetOutPath "$INSTDIR\lib\src\hc08"
388 File "${DEV_ROOT}\lib\src\hc08\*.c"
389 # File "${DEV_ROOT}\lib\src\hc08\Makefile"
391 SetOutPath "$INSTDIR\lib\src\mcs51"
392 File "${DEV_ROOT}\lib\src\mcs51\*.asm"
393 # File "${DEV_ROOT}\lib\src\mcs51\Makefile"
395 SetOutPath "$INSTDIR\lib\src\small"
396 # File "${DEV_ROOT}\lib\src\small\Makefile"
398 SetOutPath "$INSTDIR\lib\src\medium"
399 # File "${DEV_ROOT}\lib\src\medium\Makefile"
401 SetOutPath "$INSTDIR\lib\src\large"
402 # File "${DEV_ROOT}\lib\src\large\Makefile"
404 SetOutPath "$INSTDIR\lib\src\pic"
405 # File "${DEV_ROOT}\lib\src\pic\configure"
406 # File "${DEV_ROOT}\lib\src\pic\configure.in"
407 # File "${DEV_ROOT}\lib\src\pic\GPL"
408 # File "${DEV_ROOT}\lib\src\pic\LGPL"
409 # File "${DEV_ROOT}\lib\src\pic\Makefile"
410 # File "${DEV_ROOT}\lib\src\pic\Makefile.common"
411 # File "${DEV_ROOT}\lib\src\pic\Makefile.common.in"
412 # File "${DEV_ROOT}\lib\src\pic\Makefile.rules"
413 # File "${DEV_ROOT}\lib\src\pic\Makefile.subdir"
414 # File "${DEV_ROOT}\lib\src\pic\NEWS"
415 # File "${DEV_ROOT}\lib\src\pic\README"
416 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.c"
417 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.S"
419 SetOutPath "$INSTDIR\lib\src\pic\libsdcc"
420 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.c"
421 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.S"
422 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.inc"
423 # File "${DEV_ROOT}\lib\src\pic\libsdcc\Makefile"
425 SetOutPath "$INSTDIR\lib\src\pic\libdev"
426 File "${DEV_ROOT}\lib\src\pic\libdev\*.c"
427 # File "${DEV_ROOT}\lib\src\pic\libdev\Makefile"
429 SetOutPath "$INSTDIR\lib\src\pic\libm"
430 File "${DEV_ROOT}\lib\src\pic\libm\*.c"
432 SetOutPath "$INSTDIR\lib\src\pic16"
433 # File "${DEV_ROOT}\lib\src\pic16\configure"
434 # File "${DEV_ROOT}\lib\src\pic16\configure.in"
435 # File "${DEV_ROOT}\lib\src\pic16\COPYING"
436 # File "${DEV_ROOT}\lib\src\pic16\Makefile"
437 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common"
438 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common.in"
439 # File "${DEV_ROOT}\lib\src\pic16\Makefile.rules"
440 # File "${DEV_ROOT}\lib\src\pic16\Makefile.subdir"
441 # File "${DEV_ROOT}\lib\src\pic16\pics.all"
442 # File "${DEV_ROOT}\lib\src\pic16\pics.build"
443 # File "${DEV_ROOT}\lib\src\pic16\README"
445 SetOutPath "$INSTDIR\lib\src\pic16\debug"
446 # File "${DEV_ROOT}\lib\src\pic16\debug\Makefile"
448 SetOutPath "$INSTDIR\lib\src\pic16\debug\gstack"
449 # File "${DEV_ROOT}\lib\src\pic16\debug\gstack\Makefile"
450 File "${DEV_ROOT}\lib\src\pic16\debug\gstack\*.c"
452 SetOutPath "$INSTDIR\lib\src\pic16\libc"
453 # File "${DEV_ROOT}\lib\src\pic16\libc\Makefile"
455 SetOutPath "$INSTDIR\lib\src\pic16\libc\ctype"
456 File "${DEV_ROOT}\lib\src\pic16\libc\ctype\*.c"
457 # File "${DEV_ROOT}\lib\src\pic16\libc\ctype\Makefile"
459 SetOutPath "$INSTDIR\lib\src\pic16\libc\delay"
460 File "${DEV_ROOT}\lib\src\pic16\libc\delay\*.S"
461 # File "${DEV_ROOT}\lib\src\pic16\libc\delay\Makefile"
463 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdio"
464 File "${DEV_ROOT}\lib\src\pic16\libc\stdio\*.c"
465 # File "${DEV_ROOT}\lib\src\pic16\libc\stdio\Makefile"
467 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdlib"
468 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.c"
469 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.S"
470 # File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\Makefile"
472 SetOutPath "$INSTDIR\lib\src\pic16\libc\string"
473 File "${DEV_ROOT}\lib\src\pic16\libc\string\*.c"
474 # File "${DEV_ROOT}\lib\src\pic16\libc\string\Makefile"
476 SetOutPath "$INSTDIR\lib\src\pic16\libc\utils"
477 File "${DEV_ROOT}\lib\src\pic16\libc\utils\*.S"
478 # File "${DEV_ROOT}\lib\src\pic16\libc\utils\Makefile"
480 SetOutPath "$INSTDIR\lib\src\pic16\libdev"
481 File "${DEV_ROOT}\lib\src\pic16\libdev\*.c"
482 # File "${DEV_ROOT}\lib\src\pic16\libdev\Makefile"
484 SetOutPath "$INSTDIR\lib\src\pic16\libio"
485 File "${DEV_ROOT}\lib\src\pic16\libio\*.ignore"
486 # File "${DEV_ROOT}\lib\src\pic16\libio\Makefile"
488 SetOutPath "$INSTDIR\lib\src\pic16\libio\adc"
489 File "${DEV_ROOT}\lib\src\pic16\libio\adc\*.c"
490 # File "${DEV_ROOT}\lib\src\pic16\libio\adc\Makefile"
492 SetOutPath "$INSTDIR\lib\src\pic16\libio\i2c"
493 File "${DEV_ROOT}\lib\src\pic16\libio\i2c\*.c"
494 # File "${DEV_ROOT}\lib\src\pic16\libio\i2c\Makefile"
496 SetOutPath "$INSTDIR\lib\src\pic16\libio\usart"
497 File "${DEV_ROOT}\lib\src\pic16\libio\usart\*.c"
498 # File "${DEV_ROOT}\lib\src\pic16\libio\usart\Makefile"
500 SetOutPath "$INSTDIR\lib\src\pic16\libm"
501 File "${DEV_ROOT}\lib\src\pic16\libm\*.c"
502 # File "${DEV_ROOT}\lib\src\pic16\libm\Makefile"
504 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc"
505 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\Makefile"
507 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\char"
508 File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\*.c"
509 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\Makefile"
511 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\fixed16x16"
512 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.c"
513 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.S"
514 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\Makefile"
516 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\float"
517 File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\*.c"
518 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\Makefile"
520 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\gptr"
521 File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\*.c"
522 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\Makefile"
524 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\int"
525 File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\*.c"
526 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\Makefile"
528 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\long"
529 File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\*.c"
530 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\Makefile"
532 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\lregs"
533 File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\*.c"
534 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\Makefile"
536 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\stack"
537 File "${DEV_ROOT}\lib\src\pic16\libsdcc\stack\*.S"
539 SetOutPath "$INSTDIR\lib\src\pic16\startup"
540 File "${DEV_ROOT}\lib\src\pic16\startup\*.c"
541 # File "${DEV_ROOT}\lib\src\pic16\startup\Makefile"
542 # File "${DEV_ROOT}\lib\src\pic16\startup\README"
544 SetOutPath "$INSTDIR\lib\src"
545 File "${DEV_ROOT}\lib\src\*.c"
548 ;--------------------------------
552 LangString DESC_SEC01 ${LANG_ENGLISH} "SDCC application files"
553 LangString DESC_SEC02 ${LANG_ENGLISH} "ucSim application files"
554 LangString DESC_SEC03 ${LANG_ENGLISH} "SDCDB files"
555 LangString DESC_SEC04 ${LANG_ENGLISH} "SDCC documentation"
556 LangString DESC_SEC05 ${LANG_ENGLISH} "SDCC include files"
557 LangString DESC_SEC06 ${LANG_ENGLISH} "SDCC DS390 library"
558 LangString DESC_SEC07 ${LANG_ENGLISH} "SDCC DS400 library"
559 LangString DESC_SEC08 ${LANG_ENGLISH} "SDCC GBZ80 library"
560 LangString DESC_SEC09 ${LANG_ENGLISH} "SDCC Z80 library"
561 LangString DESC_SEC10 ${LANG_ENGLISH} "SDCC small model library"
562 LangString DESC_SEC11 ${LANG_ENGLISH} "SDCC medium model library"
563 LangString DESC_SEC12 ${LANG_ENGLISH} "SDCC large model library"
564 LangString DESC_SEC13 ${LANG_ENGLISH} "SDCC small-stack-auto model library"
565 LangString DESC_SEC14 ${LANG_ENGLISH} "SDCC HC08 library"
566 LangString DESC_SEC15 ${LANG_ENGLISH} "SDCC PIC16 library"
567 LangString DESC_SEC16 ${LANG_ENGLISH} "SDCC PIC library"
568 LangString DESC_SEC17 ${LANG_ENGLISH} "SDCC library sources"
570 ;Assign language strings to sections
571 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
572 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC01)
573 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC02)
574 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC03)
575 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC04)
576 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC05)
577 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $(DESC_SEC06)
578 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $(DESC_SEC07)
579 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $(DESC_SEC08)
580 !insertmacro MUI_DESCRIPTION_TEXT ${SEC09} $(DESC_SEC09)
581 !insertmacro MUI_DESCRIPTION_TEXT ${SEC10} $(DESC_SEC10)
582 !insertmacro MUI_DESCRIPTION_TEXT ${SEC11} $(DESC_SEC11)
583 !insertmacro MUI_DESCRIPTION_TEXT ${SEC12} $(DESC_SEC12)
584 !insertmacro MUI_DESCRIPTION_TEXT ${SEC13} $(DESC_SEC13)
585 !insertmacro MUI_DESCRIPTION_TEXT ${SEC14} $(DESC_SEC14)
586 !insertmacro MUI_DESCRIPTION_TEXT ${SEC15} $(DESC_SEC15)
587 !insertmacro MUI_DESCRIPTION_TEXT ${SEC16} $(DESC_SEC16)
588 !insertmacro MUI_DESCRIPTION_TEXT ${SEC17} $(DESC_SEC17)
589 !insertmacro MUI_FUNCTION_DESCRIPTION_END
590 ;--------------------------------
593 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
594 CreateDirectory "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
595 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" "$INSTDIR\sdcc.url"
596 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" "$INSTDIR\uninstall.exe"
597 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" ""
598 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog_head.txt" "" "$INSTDIR\sdcc.ico" "" "" "" ""
599 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.TXT"
600 !insertmacro MUI_STARTMENU_WRITE_END
604 WriteIniStr "$INSTDIR\sdcc.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/"
608 WriteRegStr HKLM "Software\${PRODUCT_NAME}" "" $INSTDIR
609 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
610 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMajor" "${VER_MAJOR}"
611 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMinor" "${VER_MINOR}"
612 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionRevision" "${VER_REVISION}"
613 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionBuild" "${VER_BUILD}"
616 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "DisplayName" "${PRODUCT_NAME}"
617 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "UninstallString" "$INSTDIR\uninstall.exe"
618 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "Publisher" "sdcc.sourceforge.net"
619 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "URLInfoAbout" "http://sdcc.sourceforge.net/"
620 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "HelpLink" "http://sdcc.sourceforge.net/"
621 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "URLUpdateInfo" "http://sdcc.sourceforge.net/"
623 WriteUninstaller "$INSTDIR\uninstall.exe"
627 ;;;; Uninstaller code ;;;;
630 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_STARTMENUPAGE_VARIABLE
632 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk"
633 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk"
634 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk"
635 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk"
636 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk"
638 RMDir "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
640 Delete "$INSTDIR\lib\src\large\Makefile"
642 Delete "$INSTDIR\lib\src\medium\Makefile"
644 Delete "$INSTDIR\lib\src\small\Makefile"
646 Delete "$INSTDIR\lib\src\mcs51\*.asm"
647 Delete "$INSTDIR\lib\src\mcs51\Makefile"
648 Delete "$INSTDIR\lib\src\mcs51\README"
650 Delete "$INSTDIR\lib\src\hc08\*.c"
651 Delete "$INSTDIR\lib\src\hc08\hc08.lib"
652 Delete "$INSTDIR\lib\src\hc08\Makefile"
654 Delete "$INSTDIR\lib\src\z80\*.c"
655 Delete "$INSTDIR\lib\src\z80\*.s"
656 Delete "$INSTDIR\lib\src\z80\z80.lib"
657 Delete "$INSTDIR\lib\src\z80\README"
658 Delete "$INSTDIR\lib\src\z80\Makefile"
660 Delete "$INSTDIR\lib\src\gbz80\*.c"
661 Delete "$INSTDIR\lib\src\gbz80\*.s"
662 Delete "$INSTDIR\lib\src\gbz80\gbz80.lib"
663 Delete "$INSTDIR\lib\src\gbz80\README"
664 Delete "$INSTDIR\lib\src\gbz80\Makefile"
666 Delete "$INSTDIR\lib\src\ds390\*.c"
667 Delete "$INSTDIR\lib\src\ds390\libds390.lib"
668 Delete "$INSTDIR\lib\src\ds390\Makefile.dep"
669 Delete "$INSTDIR\lib\src\ds390\Makefile"
670 Delete "$INSTDIR\lib\src\ds390\examples\MOVED"
672 Delete "$INSTDIR\lib\src\ds400\*.c"
673 Delete "$INSTDIR\lib\src\ds400\libds400.lib"
674 Delete "$INSTDIR\lib\src\ds400\Makefile.dep"
675 Delete "$INSTDIR\lib\src\ds400\Makefile"
677 Delete "$INSTDIR\lib\src\*.c"
679 Delete "$INSTDIR\lib\pic\*.o"
680 Delete "$INSTDIR\lib\pic\*.lib"
682 Delete "$INSTDIR\lib\pic16\*.o"
683 Delete "$INSTDIR\lib\pic16\*.lib"
685 Delete "$INSTDIR\lib\hc08\*.rel"
686 Delete "$INSTDIR\lib\hc08\*.lib"
688 Delete "$INSTDIR\lib\z80\*.o"
689 Delete "$INSTDIR\lib\z80\*.lib"
691 Delete "$INSTDIR\lib\small\*.rel"
692 Delete "$INSTDIR\lib\small\*.lib"
694 Delete "$INSTDIR\lib\medium\*.rel"
695 Delete "$INSTDIR\lib\medium\*.lib"
697 Delete "$INSTDIR\lib\large\*.rel"
698 Delete "$INSTDIR\lib\large\*.lib"
700 Delete "$INSTDIR\lib\small-stack-auto\*.rel"
701 Delete "$INSTDIR\lib\small-stack-auto\*.lib"
703 Delete "$INSTDIR\lib\gbz80\*.o"
704 Delete "$INSTDIR\lib\gbz80\*.lib"
706 Delete "$INSTDIR\lib\ds390\*.rel"
707 Delete "$INSTDIR\lib\ds390\*.lib"
709 Delete "$INSTDIR\lib\ds400\*.rel"
710 Delete "$INSTDIR\lib\ds400\*.lib"
712 Delete "$INSTDIR\include\asm\z80\*.h"
713 Delete "$INSTDIR\include\asm\pic16\*.h"
714 Delete "$INSTDIR\include\asm\pic\*.h"
715 Delete "$INSTDIR\include\asm\mcs51\*.h"
716 Delete "$INSTDIR\include\asm\gbz80\*.h"
717 Delete "$INSTDIR\include\asm\ds390\*.h"
718 Delete "$INSTDIR\include\asm\default\*.h"
719 Delete "$INSTDIR\include\z80\*.h"
720 Delete "$INSTDIR\include\pic\*.h"
721 Delete "$INSTDIR\include\pic\*.txt"
722 Delete "$INSTDIR\include\pic\*.inc"
723 Delete "$INSTDIR\include\pic16\*.h"
724 Delete "$INSTDIR\include\mcs51\*.h"
725 Delete "$INSTDIR\include\hc08\*.h"
726 Delete "$INSTDIR\include\*.h"
729 Delete "$INSTDIR\doc\README.TXT"
730 Delete "$INSTDIR\doc\ChangeLog_head.txt"
733 Delete "$INSTDIR\bin\as-gbz80.exe"
734 Delete "$INSTDIR\bin\as-hc08.exe"
735 Delete "$INSTDIR\bin\as-z80.exe"
736 Delete "$INSTDIR\bin\asx8051.exe"
737 Delete "$INSTDIR\bin\aslink.exe"
738 Delete "$INSTDIR\bin\link-gbz80.exe"
739 Delete "$INSTDIR\bin\link-hc08.exe"
740 Delete "$INSTDIR\bin\link-z80.exe"
741 Delete "$INSTDIR\bin\makebin.exe"
742 Delete "$INSTDIR\bin\packihx.exe"
743 Delete "$INSTDIR\bin\sdcc.exe"
744 Delete "$INSTDIR\bin\sdcclib.exe"
745 Delete "$INSTDIR\bin\sdcpp.exe"
746 Delete "$INSTDIR\bin\readline5.dll"
749 Delete "$INSTDIR\bin\s51.exe"
750 Delete "$INSTDIR\bin\savr.exe"
751 Delete "$INSTDIR\bin\shc08.exe"
752 Delete "$INSTDIR\bin\sz80.exe"
754 Delete "$INSTDIR\bin\sdcdb.exe"
755 Delete "$INSTDIR\bin\sdcdb.el"
756 Delete "$INSTDIR\bin\sdcdbsrc.el"
758 Delete "$INSTDIR\COPYING.TXT"
759 Delete "$INSTDIR\sdcc.ico"
760 Delete "$INSTDIR\sdcc.url"
761 Delete "$INSTDIR\uninstall.exe"
763 RMDir /r "$INSTDIR\lib\src\pic"
764 RMDir /r "$INSTDIR\lib\src\pic16"
765 RMDir "$INSTDIR\lib\src\small"
766 RMDir "$INSTDIR\lib\src\medium"
767 RMDir "$INSTDIR\lib\src\large"
768 RMDir "$INSTDIR\lib\src\mcs51"
769 RMDir "$INSTDIR\lib\src\z80"
770 RMDir "$INSTDIR\lib\src\gbz80"
771 RMDir "$INSTDIR\lib\src\ds390\examples"
772 RMDir "$INSTDIR\lib\src\ds390"
773 RMDir "$INSTDIR\lib\src\ds400"
774 RMDir "$INSTDIR\lib\src\hc08"
775 RMDir "$INSTDIR\lib\src"
777 RMDir "$INSTDIR\lib\pic"
778 RMDir "$INSTDIR\lib\pic16"
779 RMDir "$INSTDIR\lib\z80"
780 RMDir "$INSTDIR\lib\small"
781 RMDir "$INSTDIR\lib\medium"
782 RMDir "$INSTDIR\lib\large"
783 RMDir "$INSTDIR\lib\small-stack-auto"
784 RMDir "$INSTDIR\lib\gbz80"
785 RMDir "$INSTDIR\lib\ds390"
786 RMDir "$INSTDIR\lib\ds400"
787 RMDir "$INSTDIR\lib\hc08"
790 RMDir "$INSTDIR\include\asm\z80"
791 RMDir "$INSTDIR\include\asm\pic16"
792 RMDir "$INSTDIR\include\asm\pic"
793 RMDir "$INSTDIR\include\asm\mcs51"
794 RMDir "$INSTDIR\include\asm\gbz80"
795 RMDir "$INSTDIR\include\asm\ds390"
796 RMDir "$INSTDIR\include\asm\default"
797 RMDir "$INSTDIR\include\asm"
798 RMDir "$INSTDIR\include\z80"
799 RMDir "$INSTDIR\include\pic"
800 RMDir "$INSTDIR\include\pic16"
801 RMDir "$INSTDIR\include\mcs51"
802 RMDir "$INSTDIR\include\hc08"
803 RMDir "$INSTDIR\include"
806 RMDir /r "$INSTDIR\doc"
816 Call un.RemoveFromPath
819 DeleteRegValue HKLM ${PRODUCT_UNINST_KEY} "NSIS:StartMenuDir"
820 DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
821 DeleteRegKey HKLM "Software\${PRODUCT_NAME}"
822 ;;;; SetAutoClose true
825 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
826 ; Path Manipulation functions ;
827 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
830 !include "WinMessages.nsh"
833 Function AddBinToPath
838 ; AddToPath - Adds the given dir to the search path.
839 ; Input - head of the stack
840 ; Note - Win9x systems requires reboot
849 ; don't add if the path doesn't exist
850 IfFileExists $0 "" AddToPath_done
855 ; Not on NT: read PATH from environment variable
858 ; On NT: read PATH from registry
859 ReadRegStr $1 HKCU "Environment" "PATH"
864 StrCmp $2 "" "" AddToPath_done
869 StrCmp $2 "" "" AddToPath_done
870 GetFullPathName /SHORT $3 $0
875 StrCmp $2 "" "" AddToPath_done
880 StrCmp $2 "" "" AddToPath_done
882 StrCmp $4 1 AddToPath_NT
885 FileOpen $1 "$1\autoexec.bat" a
888 IntCmp $2 26 0 +2 +2 ; DOS EOF
889 FileSeek $1 -1 END ; write over EOF
890 FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
896 ReadRegStr $1 HKCU "Environment" "PATH"
897 StrCpy $2 $1 1 -1 ; copy last char
898 StrCmp $2 ";" 0 +2 ; if last char == ;
899 StrCpy $1 $1 -1 ; remove last char
900 StrCmp $1 "" AddToPath_NTdoIt
903 WriteRegExpandStr HKCU "Environment" "PATH" $0
904 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
914 ; RemoveFromPath - Remove a given dir from the path
915 ; Input: head of the stack
917 Function un.RemoveFromPath
926 IntFmt $6 "%c" 26 ; DOS EOF
930 StrCmp $1 1 unRemoveFromPath_NT
933 FileOpen $1 "$1\autoexec.bat" r
936 GetFullPathName /SHORT $0 $0
937 StrCpy $0 "SET PATH=%PATH%;$0"
938 Goto unRemoveFromPath_dosLoop
940 unRemoveFromPath_dosLoop:
942 StrCpy $5 $3 1 -1 ; read last char
943 StrCmp $5 $6 0 +2 ; if DOS EOF
944 StrCpy $3 $3 -1 ; remove DOS EOF so we can compare
945 StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
946 StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
947 StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
948 StrCmp $3 "" unRemoveFromPath_dosLoopEnd
950 Goto unRemoveFromPath_dosLoop
951 unRemoveFromPath_dosLoopRemoveLine:
953 Goto unRemoveFromPath_dosLoop
955 unRemoveFromPath_dosLoopEnd:
959 Delete "$1\autoexec.bat"
960 CopyFiles /SILENT $4 "$1\autoexec.bat"
962 Goto unRemoveFromPath_done
965 ReadRegStr $1 HKCU "Environment" "PATH"
966 StrCpy $5 $1 1 -1 ; copy last char
967 StrCmp $5 ";" +2 ; if last char != ;
968 StrCpy $1 "$1;" ; append ;
971 Call un.StrStr ; Find `$0;` in $1
972 Pop $2 ; pos of our dir
973 StrCmp $2 "" unRemoveFromPath_done
974 ; else, it is in path
979 StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
980 StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
983 StrCpy $5 $3 1 -1 ; copy last char
984 StrCmp $5 ";" 0 +2 ; if last char == ;
985 StrCpy $3 $3 -1 ; remove last char
988 ; New PATH not empty: update the registry
989 WriteRegExpandStr HKCU "Environment" "PATH" $3
991 ; New PATH empty: remove from the registry
992 DeleteRegValue HKCU "Environment" "PATH"
993 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
995 unRemoveFromPath_done:
1005 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1006 ; Utility Functions ;
1007 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1011 ; output, top of the stack = 1 if NT or 0 if not
1016 ; ($R0 at this point is 1 or 0)
1021 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
1022 StrCmp $0 "" 0 IsNT_yes
1034 !insertmacro IsNT ""
1035 !insertmacro IsNT "un."
1038 ; input, top of stack = string to search for
1039 ; top of stack-1 = string to search in
1040 ; output, top of stack (replaces with the portion of the string remaining)
1041 ; modifies no other variables.
1044 ; Push "this is a long ass string"
1048 ; ($R0 at this point is "ass string")
1051 Function ${un}StrStr
1052 Exch $R1 ; st=haystack,old$R1, $R1=needle
1053 Exch ; st=old$R1,haystack
1054 Exch $R2 ; st=old$R1,old$R2, $R2=haystack
1066 StrCpy $R5 $R2 $R3 $R4
1072 StrCpy $R1 $R2 "" $R4
1080 !insertmacro StrStr ""
1081 !insertmacro StrStr "un."
1083 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1084 ; Uninstall/Reinstall page functions ;
1085 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1087 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
1089 Var ReinstallPageCheck
1091 Function PageReinstall
1093 ReadRegStr $R0 HKLM "Software\${PRODUCT_NAME}" ""
1096 ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
1102 ReadRegDWORD $R0 HKLM "Software\${PRODUCT_NAME}" "VersionMajor"
1103 ReadRegDWORD $R1 HKLM "Software\${PRODUCT_NAME}" "VersionMinor"
1104 ReadRegDWORD $R2 HKLM "Software\${PRODUCT_NAME}" "VersionRevision"
1105 ReadRegDWORD $R3 HKLM "Software\${PRODUCT_NAME}" "VersionBuild"
1106 StrCpy $R0 $R0.$R1.$R2.$R3
1108 ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
1110 StrCpy $R1 "${PRODUCT_NAME} ${PRODUCT_VERSION} is already installed. Select the operation you want to perform and click Next to continue."
1111 StrCpy $R2 "Add/Reinstall components"
1112 StrCpy $R3 "Uninstall ${PRODUCT_NAME}"
1113 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
1116 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."
1117 StrCpy $R2 "Uninstall before installing"
1118 StrCpy $R3 "Do not uninstall"
1119 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1122 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."
1123 StrCpy $R2 "Uninstall before installing"
1124 StrCpy $R3 "Do not uninstall"
1125 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1131 nsDialogs::Create /NOUNLOAD 1018
1133 ${NSD_CreateLabel} 0 0 100% 24u $R1
1136 ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
1138 ${NSD_OnClick} $R2 PageReinstallUpdateSelection
1140 ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3
1142 ${NSD_OnClick} $R3 PageReinstallUpdateSelection
1144 ${If} $ReinstallPageCheck != 2
1145 SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0
1147 SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0
1154 Function PageReinstallUpdateSelection
1158 ${NSD_GetState} $R2 $R1
1160 ${If} $R1 == ${BST_CHECKED}
1161 StrCpy $ReinstallPageCheck 1
1163 StrCpy $ReinstallPageCheck 2
1168 Function PageLeaveReinstall
1170 ${NSD_GetState} $R2 $R1
1173 StrCmp $R1 "1" reinst_uninstall reinst_done
1176 StrCmp $R1 "1" reinst_done reinst_uninstall
1179 ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString"
1185 ExecWait '$R1 _?=$INSTDIR'
1187 IfErrors no_remove_uninstaller
1188 IfFileExists "$INSTDIR\bin\${PRODUCT_NAME}.exe" no_remove_uninstaller
1193 no_remove_uninstaller:
1204 !endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD