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 ;--------------------------------
102 !define MULTIUSER_INSTALLMODE_INSTDIR SDCC
103 !define MULTIUSER_EXECUTIONLEVEL Highest
104 !define MULTIUSER_MUI
105 !define MULTIUSER_INSTALLMODE_COMMANDLINE
106 !include MultiUser.nsh
108 !include WordFunc.nsh
110 ;--------------------------------
113 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
114 !insertmacro VersionCompare
117 ;--------------------------------
120 !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
122 ;--------------------------------
126 !define MUI_ABORTWARNING
129 !insertmacro MUI_PAGE_WELCOME
132 !insertmacro MUI_PAGE_LICENSE "${SDCC_ROOT}\COPYING.TXT"
134 ; Uninstall/reinstall page
135 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
136 Page custom PageReinstall PageLeaveReinstall
140 !insertmacro MULTIUSER_PAGE_INSTALLMODE
143 !define MUI_STARTMENUPAGE_DEFAULTFOLDER ${PRODUCT_NAME}
144 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
145 !define MUI_STARTMENUPAGE_REGISTRY_KEY ${PRODUCT_UNINST_KEY}
146 !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "NSIS:StartMenuDir"
147 !define MUI_STARTMENUPAGE_NODISABLE
148 Var MUI_STARTMENUPAGE_VARIABLE
149 !insertmacro MUI_PAGE_STARTMENU Application $MUI_STARTMENUPAGE_VARIABLE
152 !define MUI_COMPONENTSPAGE_SMALLDESC
153 !insertmacro MUI_PAGE_COMPONENTS
156 !insertmacro MUI_PAGE_DIRECTORY
159 !insertmacro MUI_PAGE_INSTFILES
162 !define MUI_FINISHPAGE_SHOWREADME_TEXT "Add $INSTDIR\bin to the PATH"
163 !define MUI_FINISHPAGE_SHOWREADME_FUNCTION AddBinToPath
164 !define MUI_FINISHPAGE_SHOWREADME
165 !insertmacro MUI_PAGE_FINISH
168 !insertmacro MUI_UNPAGE_CONFIRM
169 !insertmacro MUI_UNPAGE_INSTFILES
172 !insertmacro MUI_LANGUAGE "English"
174 Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
177 ;;;;ShowInstDetails show
178 ;;;;ShowUnInstDetails show
181 !ifndef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
182 ; Old unistallation method
183 ;Uninstall the old version, if present
184 ReadRegStr $R0 HKLM \
185 "Software\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" \
189 MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
190 "$(^Name) is already installed. $\n$\nClick 'OK' to remove the \
191 previous version or 'Cancel' to cancel this upgrade." \
196 ; Run the uninstaller
198 ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
203 ; Install the new version
204 MessageBox MB_YESNO|MB_ICONQUESTION "This will install $(^Name). Do you wish to continue?" IDYES +2
209 !insertmacro MULTIUSER_INIT
213 !insertmacro MULTIUSER_UNINIT
217 SetOutPath "$INSTDIR"
219 File "${SDCC_ROOT}\COPYING.TXT"
222 Section "SDCC application files" SEC01
224 SetOutPath "$INSTDIR\bin"
225 File "${SDCC_ROOT}\bin\as-gbz80.exe"
226 File "${SDCC_ROOT}\bin\as-hc08.exe"
227 File "${SDCC_ROOT}\bin\as-z80.exe"
228 File "${SDCC_ROOT}\bin\asx8051.exe"
229 File "${SDCC_ROOT}\bin\aslink.exe"
230 File "${SDCC_ROOT}\bin\link-gbz80.exe"
231 File "${SDCC_ROOT}\bin\link-hc08.exe"
232 File "${SDCC_ROOT}\bin\link-z80.exe"
233 File "${SDCC_ROOT}\bin\makebin.exe"
234 File "${SDCC_ROOT}\bin\packihx.exe"
235 File "${SDCC_ROOT}\bin\sdcc.exe"
236 File "${SDCC_ROOT}\bin\sdcclib.exe"
237 File "${SDCC_ROOT}\bin\sdcpp.exe"
238 File "${SDCC_ROOT}\bin\readline5.dll"
241 Section "ucSim application files" SEC02
243 SetOutPath "$INSTDIR\bin"
244 File "${SDCC_ROOT}\bin\s51.exe"
245 File "${SDCC_ROOT}\bin\savr.exe"
246 File "${SDCC_ROOT}\bin\shc08.exe"
247 File "${SDCC_ROOT}\bin\sz80.exe"
250 Section "SDCDB files" SEC03
252 File "${SDCC_ROOT}\bin\sdcdb.exe"
253 File "${SDCC_ROOT}\bin\sdcdb.el"
254 File "${SDCC_ROOT}\bin\sdcdbsrc.el"
257 Section "SDCC documentation" SEC04
259 SetOutPath "$INSTDIR\doc"
261 File /r "${SDCC_ROOT}\doc\*"
263 File "${SDCC_ROOT}\doc\ChangeLog_head.txt"
264 File "${SDCC_ROOT}\doc\README.TXT"
268 Section "SDCC include files" SEC05
270 SetOutPath "$INSTDIR\include\asm\default"
271 File "${DEV_ROOT}\include\asm\default\features.h"
272 SetOutPath "$INSTDIR\include\asm\ds390"
273 File "${DEV_ROOT}\include\asm\ds390\features.h"
274 SetOutPath "$INSTDIR\include\asm\gbz80"
275 File "${DEV_ROOT}\include\asm\gbz80\features.h"
276 SetOutPath "$INSTDIR\include\asm\mcs51"
277 File "${DEV_ROOT}\include\asm\mcs51\features.h"
278 SetOutPath "$INSTDIR\include\asm\pic"
279 File "${DEV_ROOT}\include\asm\pic\features.h"
280 SetOutPath "$INSTDIR\include\asm\pic16"
281 File "${DEV_ROOT}\include\asm\pic16\features.h"
282 SetOutPath "$INSTDIR\include\asm\z80"
283 File "${DEV_ROOT}\include\asm\z80\features.h"
284 SetOutPath "$INSTDIR\include\hc08"
285 File "${DEV_ROOT}\include\hc08\*.h"
286 SetOutPath "$INSTDIR\include\mcs51"
287 File "${DEV_ROOT}\include\mcs51\*.h"
288 SetOutPath "$INSTDIR\include\pic"
289 File "${DEV_ROOT}\include\pic\*.h"
290 File "${DEV_ROOT}\include\pic\*.txt"
291 File "${DEV_ROOT}\include\pic\*.inc"
292 SetOutPath "$INSTDIR\include\pic16"
293 File "${DEV_ROOT}\include\pic16\*.h"
294 SetOutPath "$INSTDIR\include\z80"
295 File "${DEV_ROOT}\include\z80\*.h"
296 SetOutPath "$INSTDIR\include"
297 File "${DEV_ROOT}\include\*.h"
300 Section "SDCC DS390 library" SEC06
302 SetOutPath "$INSTDIR\lib\ds390"
303 File "${DEV_ROOT}\lib\ds390\*.rel"
304 File "${DEV_ROOT}\lib\ds390\*.lib"
307 Section "SDCC DS400 library" SEC07
309 SetOutPath "$INSTDIR\lib\ds400"
310 File "${DEV_ROOT}\lib\ds400\*.rel"
311 File "${DEV_ROOT}\lib\ds400\*.lib"
314 Section "SDCC GBZ80 library" SEC08
316 SetOutPath "$INSTDIR\lib\gbz80"
317 File "${DEV_ROOT}\lib\gbz80\*.o"
318 File "${DEV_ROOT}\lib\gbz80\*.lib"
321 Section "SDCC Z80 library" SEC09
323 SetOutPath "$INSTDIR\lib\z80"
324 File "${DEV_ROOT}\lib\z80\*.o"
325 File "${DEV_ROOT}\lib\z80\*.lib"
328 Section "SDCC small model library" SEC10
330 SetOutPath "$INSTDIR\lib\small"
331 File "${DEV_ROOT}\lib\small\*.rel"
332 File "${DEV_ROOT}\lib\small\*.lib"
335 Section "SDCC medium model library" SEC11
337 SetOutPath "$INSTDIR\lib\medium"
338 File "${DEV_ROOT}\lib\medium\*.rel"
339 File "${DEV_ROOT}\lib\medium\*.lib"
342 Section "SDCC large model library" SEC12
344 SetOutPath "$INSTDIR\lib\large"
345 File "${DEV_ROOT}\lib\large\*.rel"
346 File "${DEV_ROOT}\lib\large\*.lib"
349 Section "SDCC small-stack-auto model library" SEC13
351 SetOutPath "$INSTDIR\lib\small-stack-auto"
352 File "${DEV_ROOT}\lib\small-stack-auto\*.rel"
353 File "${DEV_ROOT}\lib\small-stack-auto\*.lib"
356 Section "SDCC HC08 library" SEC14
358 SetOutPath "$INSTDIR\lib\hc08"
359 File "${DEV_ROOT}\lib\hc08\*.rel"
360 File "${DEV_ROOT}\lib\hc08\*.lib"
363 Section "SDCC PIC16 library" SEC15
365 SetOutPath "$INSTDIR\lib\pic16"
366 File "${DEV_ROOT}\lib\pic16\*.o"
367 File "${DEV_ROOT}\lib\pic16\*.lib"
370 Section "SDCC PIC library" SEC16
372 SetOutPath "$INSTDIR\lib\pic"
373 File "${DEV_ROOT}\lib\pic\*.lib"
376 Section "SDCC library sources" SEC17
378 SetOutPath "$INSTDIR\lib\src\ds390\examples"
379 File "${DEV_ROOT}\lib\src\ds390\examples\MOVED"
381 SetOutPath "$INSTDIR\lib\src\ds390"
382 File "${DEV_ROOT}\lib\src\ds390\*.c"
383 # File "${DEV_ROOT}\lib\src\ds390\Makefile"
385 SetOutPath "$INSTDIR\lib\src\ds400"
386 File "${DEV_ROOT}\lib\src\ds400\*.c"
387 # File "${DEV_ROOT}\lib\src\ds400\Makefile"
389 SetOutPath "$INSTDIR\lib\src\gbz80"
390 File "${DEV_ROOT}\lib\src\gbz80\*.c"
391 File "${DEV_ROOT}\lib\src\gbz80\*.s"
392 # File "${DEV_ROOT}\lib\src\gbz80\Makefile"
394 SetOutPath "$INSTDIR\lib\src\z80"
395 File "${DEV_ROOT}\lib\src\z80\*.c"
396 File "${DEV_ROOT}\lib\src\z80\*.s"
397 # File "${DEV_ROOT}\lib\src\z80\Makefile"
399 SetOutPath "$INSTDIR\lib\src\hc08"
400 File "${DEV_ROOT}\lib\src\hc08\*.c"
401 # File "${DEV_ROOT}\lib\src\hc08\Makefile"
403 SetOutPath "$INSTDIR\lib\src\mcs51"
404 File "${DEV_ROOT}\lib\src\mcs51\*.asm"
405 # File "${DEV_ROOT}\lib\src\mcs51\Makefile"
407 SetOutPath "$INSTDIR\lib\src\small"
408 # File "${DEV_ROOT}\lib\src\small\Makefile"
410 SetOutPath "$INSTDIR\lib\src\medium"
411 # File "${DEV_ROOT}\lib\src\medium\Makefile"
413 SetOutPath "$INSTDIR\lib\src\large"
414 # File "${DEV_ROOT}\lib\src\large\Makefile"
416 SetOutPath "$INSTDIR\lib\src\pic"
417 # File "${DEV_ROOT}\lib\src\pic\configure"
418 # File "${DEV_ROOT}\lib\src\pic\configure.in"
419 # File "${DEV_ROOT}\lib\src\pic\GPL"
420 # File "${DEV_ROOT}\lib\src\pic\LGPL"
421 # File "${DEV_ROOT}\lib\src\pic\Makefile"
422 # File "${DEV_ROOT}\lib\src\pic\Makefile.common"
423 # File "${DEV_ROOT}\lib\src\pic\Makefile.common.in"
424 # File "${DEV_ROOT}\lib\src\pic\Makefile.rules"
425 # File "${DEV_ROOT}\lib\src\pic\Makefile.subdir"
426 # File "${DEV_ROOT}\lib\src\pic\NEWS"
427 # File "${DEV_ROOT}\lib\src\pic\README"
428 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.c"
429 File "${DEV_ROOT}\lib\src\pic\TEMPLATE.S"
431 SetOutPath "$INSTDIR\lib\src\pic\libsdcc"
432 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.c"
433 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.S"
434 File "${DEV_ROOT}\lib\src\pic\libsdcc\*.inc"
435 # File "${DEV_ROOT}\lib\src\pic\libsdcc\Makefile"
437 SetOutPath "$INSTDIR\lib\src\pic\libdev"
438 File "${DEV_ROOT}\lib\src\pic\libdev\*.c"
439 # File "${DEV_ROOT}\lib\src\pic\libdev\Makefile"
441 SetOutPath "$INSTDIR\lib\src\pic\libm"
442 File "${DEV_ROOT}\lib\src\pic\libm\*.c"
444 SetOutPath "$INSTDIR\lib\src\pic16"
445 # File "${DEV_ROOT}\lib\src\pic16\configure"
446 # File "${DEV_ROOT}\lib\src\pic16\configure.in"
447 # File "${DEV_ROOT}\lib\src\pic16\COPYING"
448 # File "${DEV_ROOT}\lib\src\pic16\Makefile"
449 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common"
450 # File "${DEV_ROOT}\lib\src\pic16\Makefile.common.in"
451 # File "${DEV_ROOT}\lib\src\pic16\Makefile.rules"
452 # File "${DEV_ROOT}\lib\src\pic16\Makefile.subdir"
453 # File "${DEV_ROOT}\lib\src\pic16\pics.all"
454 # File "${DEV_ROOT}\lib\src\pic16\pics.build"
455 # File "${DEV_ROOT}\lib\src\pic16\README"
457 SetOutPath "$INSTDIR\lib\src\pic16\debug"
458 # File "${DEV_ROOT}\lib\src\pic16\debug\Makefile"
460 SetOutPath "$INSTDIR\lib\src\pic16\debug\gstack"
461 # File "${DEV_ROOT}\lib\src\pic16\debug\gstack\Makefile"
462 File "${DEV_ROOT}\lib\src\pic16\debug\gstack\*.c"
464 SetOutPath "$INSTDIR\lib\src\pic16\libc"
465 # File "${DEV_ROOT}\lib\src\pic16\libc\Makefile"
467 SetOutPath "$INSTDIR\lib\src\pic16\libc\ctype"
468 File "${DEV_ROOT}\lib\src\pic16\libc\ctype\*.c"
469 # File "${DEV_ROOT}\lib\src\pic16\libc\ctype\Makefile"
471 SetOutPath "$INSTDIR\lib\src\pic16\libc\delay"
472 File "${DEV_ROOT}\lib\src\pic16\libc\delay\*.S"
473 # File "${DEV_ROOT}\lib\src\pic16\libc\delay\Makefile"
475 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdio"
476 File "${DEV_ROOT}\lib\src\pic16\libc\stdio\*.c"
477 # File "${DEV_ROOT}\lib\src\pic16\libc\stdio\Makefile"
479 SetOutPath "$INSTDIR\lib\src\pic16\libc\stdlib"
480 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.c"
481 File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\*.S"
482 # File "${DEV_ROOT}\lib\src\pic16\libc\stdlib\Makefile"
484 SetOutPath "$INSTDIR\lib\src\pic16\libc\string"
485 File "${DEV_ROOT}\lib\src\pic16\libc\string\*.c"
486 # File "${DEV_ROOT}\lib\src\pic16\libc\string\Makefile"
488 SetOutPath "$INSTDIR\lib\src\pic16\libc\utils"
489 File "${DEV_ROOT}\lib\src\pic16\libc\utils\*.S"
490 # File "${DEV_ROOT}\lib\src\pic16\libc\utils\Makefile"
492 SetOutPath "$INSTDIR\lib\src\pic16\libdev"
493 File "${DEV_ROOT}\lib\src\pic16\libdev\*.c"
494 # File "${DEV_ROOT}\lib\src\pic16\libdev\Makefile"
496 SetOutPath "$INSTDIR\lib\src\pic16\libio"
497 File "${DEV_ROOT}\lib\src\pic16\libio\*.ignore"
498 # File "${DEV_ROOT}\lib\src\pic16\libio\Makefile"
500 SetOutPath "$INSTDIR\lib\src\pic16\libio\adc"
501 File "${DEV_ROOT}\lib\src\pic16\libio\adc\*.c"
502 # File "${DEV_ROOT}\lib\src\pic16\libio\adc\Makefile"
504 SetOutPath "$INSTDIR\lib\src\pic16\libio\i2c"
505 File "${DEV_ROOT}\lib\src\pic16\libio\i2c\*.c"
506 # File "${DEV_ROOT}\lib\src\pic16\libio\i2c\Makefile"
508 SetOutPath "$INSTDIR\lib\src\pic16\libio\usart"
509 File "${DEV_ROOT}\lib\src\pic16\libio\usart\*.c"
510 # File "${DEV_ROOT}\lib\src\pic16\libio\usart\Makefile"
512 SetOutPath "$INSTDIR\lib\src\pic16\libm"
513 File "${DEV_ROOT}\lib\src\pic16\libm\*.c"
514 # File "${DEV_ROOT}\lib\src\pic16\libm\Makefile"
516 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc"
517 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\Makefile"
519 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\char"
520 File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\*.c"
521 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\char\Makefile"
523 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\fixed16x16"
524 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.c"
525 File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\*.S"
526 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\fixed16x16\Makefile"
528 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\float"
529 File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\*.c"
530 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\float\Makefile"
532 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\gptr"
533 File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\*.c"
534 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\gptr\Makefile"
536 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\int"
537 File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\*.c"
538 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\int\Makefile"
540 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\long"
541 File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\*.c"
542 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\long\Makefile"
544 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\lregs"
545 File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\*.c"
546 # File "${DEV_ROOT}\lib\src\pic16\libsdcc\lregs\Makefile"
548 SetOutPath "$INSTDIR\lib\src\pic16\libsdcc\stack"
549 File "${DEV_ROOT}\lib\src\pic16\libsdcc\stack\*.S"
551 SetOutPath "$INSTDIR\lib\src\pic16\startup"
552 File "${DEV_ROOT}\lib\src\pic16\startup\*.c"
553 # File "${DEV_ROOT}\lib\src\pic16\startup\Makefile"
554 # File "${DEV_ROOT}\lib\src\pic16\startup\README"
556 SetOutPath "$INSTDIR\lib\src"
557 File "${DEV_ROOT}\lib\src\*.c"
560 ;--------------------------------
564 LangString DESC_SEC01 ${LANG_ENGLISH} "SDCC application files"
565 LangString DESC_SEC02 ${LANG_ENGLISH} "ucSim application files"
566 LangString DESC_SEC03 ${LANG_ENGLISH} "SDCDB files"
567 LangString DESC_SEC04 ${LANG_ENGLISH} "SDCC documentation"
568 LangString DESC_SEC05 ${LANG_ENGLISH} "SDCC include files"
569 LangString DESC_SEC06 ${LANG_ENGLISH} "SDCC DS390 library"
570 LangString DESC_SEC07 ${LANG_ENGLISH} "SDCC DS400 library"
571 LangString DESC_SEC08 ${LANG_ENGLISH} "SDCC GBZ80 library"
572 LangString DESC_SEC09 ${LANG_ENGLISH} "SDCC Z80 library"
573 LangString DESC_SEC10 ${LANG_ENGLISH} "SDCC small model library"
574 LangString DESC_SEC11 ${LANG_ENGLISH} "SDCC medium model library"
575 LangString DESC_SEC12 ${LANG_ENGLISH} "SDCC large model library"
576 LangString DESC_SEC13 ${LANG_ENGLISH} "SDCC small-stack-auto model library"
577 LangString DESC_SEC14 ${LANG_ENGLISH} "SDCC HC08 library"
578 LangString DESC_SEC15 ${LANG_ENGLISH} "SDCC PIC16 library"
579 LangString DESC_SEC16 ${LANG_ENGLISH} "SDCC PIC library"
580 LangString DESC_SEC17 ${LANG_ENGLISH} "SDCC library sources"
582 ;Assign language strings to sections
583 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
584 !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} $(DESC_SEC01)
585 !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} $(DESC_SEC02)
586 !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} $(DESC_SEC03)
587 !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} $(DESC_SEC04)
588 !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} $(DESC_SEC05)
589 !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} $(DESC_SEC06)
590 !insertmacro MUI_DESCRIPTION_TEXT ${SEC07} $(DESC_SEC07)
591 !insertmacro MUI_DESCRIPTION_TEXT ${SEC08} $(DESC_SEC08)
592 !insertmacro MUI_DESCRIPTION_TEXT ${SEC09} $(DESC_SEC09)
593 !insertmacro MUI_DESCRIPTION_TEXT ${SEC10} $(DESC_SEC10)
594 !insertmacro MUI_DESCRIPTION_TEXT ${SEC11} $(DESC_SEC11)
595 !insertmacro MUI_DESCRIPTION_TEXT ${SEC12} $(DESC_SEC12)
596 !insertmacro MUI_DESCRIPTION_TEXT ${SEC13} $(DESC_SEC13)
597 !insertmacro MUI_DESCRIPTION_TEXT ${SEC14} $(DESC_SEC14)
598 !insertmacro MUI_DESCRIPTION_TEXT ${SEC15} $(DESC_SEC15)
599 !insertmacro MUI_DESCRIPTION_TEXT ${SEC16} $(DESC_SEC16)
600 !insertmacro MUI_DESCRIPTION_TEXT ${SEC17} $(DESC_SEC17)
601 !insertmacro MUI_FUNCTION_DESCRIPTION_END
602 ;--------------------------------
605 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
606 CreateDirectory "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
607 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk" "$INSTDIR\sdcc.url"
608 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk" "$INSTDIR\uninstall.exe"
609 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk" "$INSTDIR\doc\README.TXT" "" "$INSTDIR\sdcc.ico" "" "" "" ""
610 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk" "$INSTDIR\doc\ChangeLog_head.txt" "" "$INSTDIR\sdcc.ico" "" "" "" ""
611 CreateShortCut "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk" "$INSTDIR\COPYING.TXT"
612 !insertmacro MUI_STARTMENU_WRITE_END
616 WriteIniStr "$INSTDIR\sdcc.url" "InternetShortcut" "URL" "http://sdcc.sourceforge.net/"
620 WriteRegStr HKLM "Software\${PRODUCT_NAME}" "" $INSTDIR
621 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
622 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMajor" "${VER_MAJOR}"
623 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionMinor" "${VER_MINOR}"
624 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionRevision" "${VER_REVISION}"
625 WriteRegDword HKLM "Software\${PRODUCT_NAME}" "VersionBuild" "${VER_BUILD}"
628 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "DisplayName" "${PRODUCT_NAME}"
629 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "UninstallString" "$INSTDIR\uninstall.exe"
630 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "Publisher" "sdcc.sourceforge.net"
631 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "URLInfoAbout" "http://sdcc.sourceforge.net/"
632 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "HelpLink" "http://sdcc.sourceforge.net/"
633 WriteRegStr HKLM ${PRODUCT_UNINST_KEY} "URLUpdateInfo" "http://sdcc.sourceforge.net/"
635 WriteUninstaller "$INSTDIR\uninstall.exe"
639 ;;;; Uninstaller code ;;;;
642 !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_STARTMENUPAGE_VARIABLE
644 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\GPL 2 License.lnk"
645 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Change Log.lnk"
646 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Documentation.lnk"
647 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\Uninstall SDCC.lnk"
648 Delete "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE\SDCC on the Web.lnk"
650 RMDir "$SMPROGRAMS\$MUI_STARTMENUPAGE_VARIABLE"
652 Delete "$INSTDIR\lib\src\large\Makefile"
654 Delete "$INSTDIR\lib\src\medium\Makefile"
656 Delete "$INSTDIR\lib\src\small\Makefile"
658 Delete "$INSTDIR\lib\src\mcs51\*.asm"
659 Delete "$INSTDIR\lib\src\mcs51\Makefile"
660 Delete "$INSTDIR\lib\src\mcs51\README"
662 Delete "$INSTDIR\lib\src\hc08\*.c"
663 Delete "$INSTDIR\lib\src\hc08\hc08.lib"
664 Delete "$INSTDIR\lib\src\hc08\Makefile"
666 Delete "$INSTDIR\lib\src\z80\*.c"
667 Delete "$INSTDIR\lib\src\z80\*.s"
668 Delete "$INSTDIR\lib\src\z80\z80.lib"
669 Delete "$INSTDIR\lib\src\z80\README"
670 Delete "$INSTDIR\lib\src\z80\Makefile"
672 Delete "$INSTDIR\lib\src\gbz80\*.c"
673 Delete "$INSTDIR\lib\src\gbz80\*.s"
674 Delete "$INSTDIR\lib\src\gbz80\gbz80.lib"
675 Delete "$INSTDIR\lib\src\gbz80\README"
676 Delete "$INSTDIR\lib\src\gbz80\Makefile"
678 Delete "$INSTDIR\lib\src\ds390\*.c"
679 Delete "$INSTDIR\lib\src\ds390\libds390.lib"
680 Delete "$INSTDIR\lib\src\ds390\Makefile.dep"
681 Delete "$INSTDIR\lib\src\ds390\Makefile"
682 Delete "$INSTDIR\lib\src\ds390\examples\MOVED"
684 Delete "$INSTDIR\lib\src\ds400\*.c"
685 Delete "$INSTDIR\lib\src\ds400\libds400.lib"
686 Delete "$INSTDIR\lib\src\ds400\Makefile.dep"
687 Delete "$INSTDIR\lib\src\ds400\Makefile"
689 Delete "$INSTDIR\lib\src\*.c"
691 Delete "$INSTDIR\lib\pic\*.o"
692 Delete "$INSTDIR\lib\pic\*.lib"
694 Delete "$INSTDIR\lib\pic16\*.o"
695 Delete "$INSTDIR\lib\pic16\*.lib"
697 Delete "$INSTDIR\lib\hc08\*.rel"
698 Delete "$INSTDIR\lib\hc08\*.lib"
700 Delete "$INSTDIR\lib\z80\*.o"
701 Delete "$INSTDIR\lib\z80\*.lib"
703 Delete "$INSTDIR\lib\small\*.rel"
704 Delete "$INSTDIR\lib\small\*.lib"
706 Delete "$INSTDIR\lib\medium\*.rel"
707 Delete "$INSTDIR\lib\medium\*.lib"
709 Delete "$INSTDIR\lib\large\*.rel"
710 Delete "$INSTDIR\lib\large\*.lib"
712 Delete "$INSTDIR\lib\small-stack-auto\*.rel"
713 Delete "$INSTDIR\lib\small-stack-auto\*.lib"
715 Delete "$INSTDIR\lib\gbz80\*.o"
716 Delete "$INSTDIR\lib\gbz80\*.lib"
718 Delete "$INSTDIR\lib\ds390\*.rel"
719 Delete "$INSTDIR\lib\ds390\*.lib"
721 Delete "$INSTDIR\lib\ds400\*.rel"
722 Delete "$INSTDIR\lib\ds400\*.lib"
724 Delete "$INSTDIR\include\asm\z80\*.h"
725 Delete "$INSTDIR\include\asm\pic16\*.h"
726 Delete "$INSTDIR\include\asm\pic\*.h"
727 Delete "$INSTDIR\include\asm\mcs51\*.h"
728 Delete "$INSTDIR\include\asm\gbz80\*.h"
729 Delete "$INSTDIR\include\asm\ds390\*.h"
730 Delete "$INSTDIR\include\asm\default\*.h"
731 Delete "$INSTDIR\include\z80\*.h"
732 Delete "$INSTDIR\include\pic\*.h"
733 Delete "$INSTDIR\include\pic\*.txt"
734 Delete "$INSTDIR\include\pic\*.inc"
735 Delete "$INSTDIR\include\pic16\*.h"
736 Delete "$INSTDIR\include\mcs51\*.h"
737 Delete "$INSTDIR\include\hc08\*.h"
738 Delete "$INSTDIR\include\*.h"
741 Delete "$INSTDIR\doc\README.TXT"
742 Delete "$INSTDIR\doc\ChangeLog_head.txt"
745 Delete "$INSTDIR\bin\as-gbz80.exe"
746 Delete "$INSTDIR\bin\as-hc08.exe"
747 Delete "$INSTDIR\bin\as-z80.exe"
748 Delete "$INSTDIR\bin\asx8051.exe"
749 Delete "$INSTDIR\bin\aslink.exe"
750 Delete "$INSTDIR\bin\link-gbz80.exe"
751 Delete "$INSTDIR\bin\link-hc08.exe"
752 Delete "$INSTDIR\bin\link-z80.exe"
753 Delete "$INSTDIR\bin\makebin.exe"
754 Delete "$INSTDIR\bin\packihx.exe"
755 Delete "$INSTDIR\bin\sdcc.exe"
756 Delete "$INSTDIR\bin\sdcclib.exe"
757 Delete "$INSTDIR\bin\sdcpp.exe"
758 Delete "$INSTDIR\bin\readline5.dll"
761 Delete "$INSTDIR\bin\s51.exe"
762 Delete "$INSTDIR\bin\savr.exe"
763 Delete "$INSTDIR\bin\shc08.exe"
764 Delete "$INSTDIR\bin\sz80.exe"
766 Delete "$INSTDIR\bin\sdcdb.exe"
767 Delete "$INSTDIR\bin\sdcdb.el"
768 Delete "$INSTDIR\bin\sdcdbsrc.el"
770 Delete "$INSTDIR\COPYING.TXT"
771 Delete "$INSTDIR\sdcc.ico"
772 Delete "$INSTDIR\sdcc.url"
773 Delete "$INSTDIR\uninstall.exe"
775 RMDir /r "$INSTDIR\lib\src\pic"
776 RMDir /r "$INSTDIR\lib\src\pic16"
777 RMDir "$INSTDIR\lib\src\small"
778 RMDir "$INSTDIR\lib\src\medium"
779 RMDir "$INSTDIR\lib\src\large"
780 RMDir "$INSTDIR\lib\src\mcs51"
781 RMDir "$INSTDIR\lib\src\z80"
782 RMDir "$INSTDIR\lib\src\gbz80"
783 RMDir "$INSTDIR\lib\src\ds390\examples"
784 RMDir "$INSTDIR\lib\src\ds390"
785 RMDir "$INSTDIR\lib\src\ds400"
786 RMDir "$INSTDIR\lib\src\hc08"
787 RMDir "$INSTDIR\lib\src"
789 RMDir "$INSTDIR\lib\pic"
790 RMDir "$INSTDIR\lib\pic16"
791 RMDir "$INSTDIR\lib\z80"
792 RMDir "$INSTDIR\lib\small"
793 RMDir "$INSTDIR\lib\medium"
794 RMDir "$INSTDIR\lib\large"
795 RMDir "$INSTDIR\lib\small-stack-auto"
796 RMDir "$INSTDIR\lib\gbz80"
797 RMDir "$INSTDIR\lib\ds390"
798 RMDir "$INSTDIR\lib\ds400"
799 RMDir "$INSTDIR\lib\hc08"
802 RMDir "$INSTDIR\include\asm\z80"
803 RMDir "$INSTDIR\include\asm\pic16"
804 RMDir "$INSTDIR\include\asm\pic"
805 RMDir "$INSTDIR\include\asm\mcs51"
806 RMDir "$INSTDIR\include\asm\gbz80"
807 RMDir "$INSTDIR\include\asm\ds390"
808 RMDir "$INSTDIR\include\asm\default"
809 RMDir "$INSTDIR\include\asm"
810 RMDir "$INSTDIR\include\z80"
811 RMDir "$INSTDIR\include\pic"
812 RMDir "$INSTDIR\include\pic16"
813 RMDir "$INSTDIR\include\mcs51"
814 RMDir "$INSTDIR\include\hc08"
815 RMDir "$INSTDIR\include"
818 RMDir /r "$INSTDIR\doc"
828 Call un.RemoveFromPath
831 DeleteRegValue HKLM ${PRODUCT_UNINST_KEY} "NSIS:StartMenuDir"
832 DeleteRegKey HKLM "${PRODUCT_UNINST_KEY}"
833 DeleteRegKey HKLM "Software\${PRODUCT_NAME}"
834 ;;;; SetAutoClose true
837 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
838 ; Path Manipulation functions ;
839 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
842 !include "WinMessages.nsh"
845 Function AddBinToPath
850 ; AddToPath - Adds the given dir to the search path.
851 ; Input - head of the stack
852 ; Note - Win9x systems requires reboot
861 ; don't add if the path doesn't exist
862 IfFileExists $0 "" AddToPath_done
867 ; Not on NT: read PATH from environment variable
870 ; On NT: read PATH from registry
871 ReadRegStr $1 HKCU "Environment" "PATH"
872 ${StrStr} $2 "$1;" "$0;"
873 StrCmp $2 "" "" AddToPath_done
875 ${StrStr} $2 "$1;" "$0\;"
876 StrCmp $2 "" "" AddToPath_done
878 GetFullPathName /SHORT $3 $0
879 ${StrStr} $2 "$1;" "$3;"
880 StrCmp $2 "" "" AddToPath_done
882 ${StrStr} $2 "$1;" "$03\;"
883 StrCmp $2 "" "" AddToPath_done
885 StrCmp $4 1 AddToPath_NT
888 FileOpen $1 "$1\autoexec.bat" a
891 IntCmp $2 26 0 +2 +2 ; DOS EOF
892 FileSeek $1 -1 END ; write over EOF
893 FileWrite $1 "$\r$\nSET PATH=%PATH%;$3$\r$\n"
899 ;System PATH variable is at:
900 ;HKLM "/SYSTEM/CurrentControlSet/Control/Session Manager/Environment" "Path"
901 ReadRegStr $1 HKCU "Environment" "PATH"
902 StrCpy $2 $1 1 -1 ; copy last char
903 StrCmp $2 ";" 0 +2 ; if last char == ;
904 StrCpy $1 $1 -1 ; remove last char
905 StrCmp $1 "" AddToPath_NTdoIt
908 WriteRegExpandStr HKCU "Environment" "PATH" $0
909 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
919 ; RemoveFromPath - Remove a given dir from the path
920 ; Input: head of the stack
922 Function un.RemoveFromPath
931 IntFmt $6 "%c" 26 ; DOS EOF
935 StrCmp $1 1 unRemoveFromPath_NT
938 FileOpen $1 "$1\autoexec.bat" r
941 GetFullPathName /SHORT $0 $0
942 StrCpy $0 "SET PATH=%PATH%;$0"
943 Goto unRemoveFromPath_dosLoop
945 unRemoveFromPath_dosLoop:
947 StrCpy $5 $3 1 -1 ; read last char
948 StrCmp $5 $6 0 +2 ; if DOS EOF
949 StrCpy $3 $3 -1 ; remove DOS EOF so we can compare
950 StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoopRemoveLine
951 StrCmp $3 "$0$\n" unRemoveFromPath_dosLoopRemoveLine
952 StrCmp $3 "$0" unRemoveFromPath_dosLoopRemoveLine
953 StrCmp $3 "" unRemoveFromPath_dosLoopEnd
955 Goto unRemoveFromPath_dosLoop
956 unRemoveFromPath_dosLoopRemoveLine:
958 Goto unRemoveFromPath_dosLoop
960 unRemoveFromPath_dosLoopEnd:
964 Delete "$1\autoexec.bat"
965 CopyFiles /SILENT $4 "$1\autoexec.bat"
967 Goto unRemoveFromPath_done
970 ;System PATH variable is at:
971 ;HKLM "/SYSTEM/CurrentControlSet/Control/Session Manager/Environment" "Path"
972 ReadRegStr $1 HKCU "Environment" "PATH"
973 StrCpy $5 $1 1 -1 ; copy last char
974 StrCmp $5 ";" +2 ; if last char != ;
975 StrCpy $1 "$1;" ; append ;
976 ${UnStrStr} $2 $1 "$0;" ; Find `$0;` in $1
977 StrCmp $2 "" unRemoveFromPath_done
978 ; else, it is in path
983 StrCpy $5 $1 -$4 ; $5 is now the part before the path to remove
984 StrCpy $6 $2 "" $3 ; $6 is now the part after the path to remove
987 StrCpy $5 $3 1 -1 ; copy last char
988 StrCmp $5 ";" 0 +2 ; if last char == ;
989 StrCpy $3 $3 -1 ; remove last char
992 ; New PATH not empty: update the registry
993 WriteRegExpandStr HKCU "Environment" "PATH" $3
995 ; New PATH empty: remove from the registry
996 DeleteRegValue HKCU "Environment" "PATH"
997 SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
999 unRemoveFromPath_done:
1009 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1010 ; Utility Functions ;
1011 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1015 ; output, top of the stack = 1 if NT or 0 if not
1020 ; ($R0 at this point is 1 or 0)
1025 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
1026 StrCmp $0 "" 0 IsNT_yes
1038 !insertmacro IsNT ""
1039 !insertmacro IsNT "un."
1041 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1042 ; Uninstall/Reinstall page functions ;
1043 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1045 !ifdef VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD
1047 Var ReinstallPageCheck
1049 Function PageReinstall
1051 ReadRegStr $R0 HKLM "Software\${PRODUCT_NAME}" ""
1054 ReadRegStr $R0 HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
1060 ReadRegDWORD $R0 HKLM "Software\${PRODUCT_NAME}" "VersionMajor"
1061 ReadRegDWORD $R1 HKLM "Software\${PRODUCT_NAME}" "VersionMinor"
1062 ReadRegDWORD $R2 HKLM "Software\${PRODUCT_NAME}" "VersionRevision"
1063 ReadRegDWORD $R3 HKLM "Software\${PRODUCT_NAME}" "VersionBuild"
1064 StrCpy $R0 $R0.$R1.$R2.$R3
1066 ${VersionCompare} ${VER_MAJOR}.${VER_MINOR}.${VER_REVISION}.${VER_BUILD} $R0 $R0
1068 StrCpy $R1 "${PRODUCT_NAME} ${PRODUCT_VERSION} is already installed. Select the operation you want to perform and click Next to continue."
1069 StrCpy $R2 "Add/Reinstall components"
1070 StrCpy $R3 "Uninstall ${PRODUCT_NAME}"
1071 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose the maintenance option to perform."
1074 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."
1075 StrCpy $R2 "Uninstall before installing"
1076 StrCpy $R3 "Do not uninstall"
1077 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1080 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."
1081 StrCpy $R2 "Uninstall before installing"
1082 StrCpy $R3 "Do not uninstall"
1083 !insertmacro MUI_HEADER_TEXT "Already Installed" "Choose how you want to install ${PRODUCT_NAME}."
1089 nsDialogs::Create /NOUNLOAD 1018
1091 ${NSD_CreateLabel} 0 0 100% 24u $R1
1094 ${NSD_CreateRadioButton} 30u 50u -30u 8u $R2
1096 ${NSD_OnClick} $R2 PageReinstallUpdateSelection
1098 ${NSD_CreateRadioButton} 30u 70u -30u 8u $R3
1100 ${NSD_OnClick} $R3 PageReinstallUpdateSelection
1102 ${If} $ReinstallPageCheck != 2
1103 SendMessage $R2 ${BM_SETCHECK} ${BST_CHECKED} 0
1105 SendMessage $R3 ${BM_SETCHECK} ${BST_CHECKED} 0
1112 Function PageReinstallUpdateSelection
1116 ${NSD_GetState} $R2 $R1
1118 ${If} $R1 == ${BST_CHECKED}
1119 StrCpy $ReinstallPageCheck 1
1121 StrCpy $ReinstallPageCheck 2
1126 Function PageLeaveReinstall
1128 ${NSD_GetState} $R2 $R1
1131 StrCmp $R1 "1" reinst_uninstall reinst_done
1134 StrCmp $R1 "1" reinst_done reinst_uninstall
1137 ReadRegStr $R1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString"
1143 ExecWait '$R1 _?=$INSTDIR'
1145 IfErrors no_remove_uninstaller
1146 IfFileExists "$INSTDIR\bin\${PRODUCT_NAME}.exe" no_remove_uninstaller
1151 no_remove_uninstaller:
1162 !endif # VER_MAJOR & VER_MINOR & VER_REVISION & VER_BUILD