-
Notifications
You must be signed in to change notification settings - Fork 327
/
InstallJMRI.nsi
1773 lines (1558 loc) · 68.6 KB
/
InstallJMRI.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; -------------------------------------------------------------------------
; - Install JMRI
; -------------------------------------------------------------------------
; - This is used to install JMRI (a Java application) on Windows.
; - It will ensure that JAVA is installed - if not, it will connect to the
; - internet to download JAVA.
; -
; - An off-line installation option is also possible - place the previously
; - downloaded off-line JRE installation program into a separate JRE folder
; - alongside the JMRI installation program.
; -
; - It will also check for a previous installation of JMRI and will backup
; - any preferences and roster files etc.
; - Also, if previous version was installed using InstallerVise, will run
; - that uninstaller first
; -------------------------------------------------------------------------
; -------------------------------------------------------------------------
; - Compilation instructions
; -------------------------------------------------------------------------
; - For the default setting of "SRCDIR", place this file in directory
; - 'Distribution\Windows\JMRI' prior to building the distribution .exe file.
; -
; - To build the resulting .exe file use one of:
; - makensis.exe (command-line)
; - makensisw.exe (Windows GUI)
; -
; - These are part of the NSIS installation suite available from:
; - http://nsis.sourceforge.net/
; -
; - makensis can also be compiled on POSIX systems such that the installer
; - .exe file can be built on such a platform.
; - For further details, refer to:
; - http://nsis.sourceforge.net/Docs/AppendixG.html#G.3
; - http://cho.hapgoods.com/wordpress/?p=138
; -
; - This installer makes use of the following NSIS plugins and macros
; - that are all included with the NSIS v2.35 or later distribution:
; - ModernUI 2.0
; - MultiUser
; - System
; - nsisDL
; - WordFunc
; -
; - A good NSIS editor (and the one used when developing this installer)
; - is 'HM NIS Edit' available from:
; - http://hmne.sourceforge.net/
; -------------------------------------------------------------------------
; -------------------------------------------------------------------------
; - Version History
; -------------------------------------------------------------------------
; - Version 0.1.27.0
; - Updated "-CleanUp" so that old/error files are removed before installation in jython directory
; -------------------------------------------------------------------------
; - Version 0.1.26.2
; - Update Java-install message URL
; -------------------------------------------------------------------------
; - Version 0.1.26.1
; - Remove Tools start menu items
; - Add support for Open JDK 8 Registry Keys
; -------------------------------------------------------------------------
; - Version 0.1.26.0
; - Remove JMRIDemo link
; - Rename Tools and Demos Folder to Tools
; - use https link for Java download and JMRI Website
; -------------------------------------------------------------------------
; - Version 0.1.25.0
; - Backup and remove lib folder
; -------------------------------------------------------------------------
; - Version 0.1.24.1
; - Correct the support for Java 11 Registry Keys
; -------------------------------------------------------------------------
; - Version 0.1.24.0
; - Add support for Java 11 Registry Keys
; -------------------------------------------------------------------------
; - Version 0.1.22.15
; - Backup and remove classes folder
; -------------------------------------------------------------------------
; - Version 0.1.22.14
; - Remove insecure Jackson libraries to address CVE-2017-17485
; -------------------------------------------------------------------------
; - Version 0.1.22.13
; - Remove outmoded SLF4J libraries
; -------------------------------------------------------------------------
; - Version 0.1.22.12
; - Remove outmoded Jetty and WebSocket libraries
; -------------------------------------------------------------------------
; - Version 0.1.22.11
; - Remove outmoded lib\ch.ntb.usb.jar
; -------------------------------------------------------------------------
; - Version 0.1.22.10
; - Support Java 9
; -------------------------------------------------------------------------
; - Version 0.1.22.9
; - Remove outmoded lib\jna-4.2.2.jar and install jmri.conf
; - Remove RXTX and SerialIO files as now replaced by purejavacomm
; -------------------------------------------------------------------------
; - Version 0.1.22.8
; - Remove outmoded jackson files
; -------------------------------------------------------------------------
; - Version 0.1.22.7
; - Remove outmoded jython files
; -------------------------------------------------------------------------
; - Version 0.1.22.6
; - Remove outmoded vecmath files
; -------------------------------------------------------------------------
; - Version 0.1.22.5
; - Remove more outmoded jetty files
; -------------------------------------------------------------------------
; - Version 0.1.22.4
; - Remove more outmoded jetty files
; -------------------------------------------------------------------------
; - Version 0.1.22.3
; - Fix decpro5 file name (.ico missing)
; -------------------------------------------------------------------------
; - Version 0.1.22.2
; - Remove references to DecoderPro3
; - Remove download of Java as this hasn't worked properly for a while
; - instead halt with a message to download if not found
; -------------------------------------------------------------------------
; - Version 0.1.22.1
; - Remove old JOAL libraries
; - Change minimum JRE version to 1.8
; -------------------------------------------------------------------------
; - Version 0.1.22.0
; - Remove support for installing the old DecoderPro
; -------------------------------------------------------------------------
; - Version 0.1.21.5
; - Updated "-CleanUp" so that another set of old files are removed,
; including:
; jetty(release 8.1.0.v20120127)-related libraries
; old log4j library
; jspwin DLL
; are removed before installation.
; -------------------------------------------------------------------------
; - Version 0.1.21.4
; - Updated "-CleanUp" so that any previous jetty-related .jar files and
; servlet .jar files are removed before installation.
; - Delete files related to XmlIO which is removed as of JMRI 3.11.3
; - Delete files which were removed as part of re-work of Zimo decoder
; definition rework for JMRI 3.11.3
; -------------------------------------------------------------------------
; - Version 0.1.21.3
; - Updated "-CleanUp" so that any previous slf4j .jar files are removed
; - before installation.
; -------------------------------------------------------------------------
; - Version 0.1.21.2
; - Updated "-CleanUp" so that any previous desktop icons are removed before
; - installation.
; - Updated "-CleanUp" so that if the Start Menu folder already exits, it
; - is removed before installation.
; - Provided work-around for deletion of Preferences.lnk on systems which
; - are slow to change file attributes.
; -------------------------------------------------------------------------
; - Version 0.1.21.1
; - Updated Uninstall operations so that DecoderPro3 icons on Desktop and in
; - Start Menu are deleted during Unninstall process
; -------------------------------------------------------------------------
; - Version 0.1.21.0
; - Add request for administrator level access when installing to correct
; - for bug highlighted by Suzie Tall
; -------------------------------------------------------------------------
; - Version 0.1.20.1
; - Added removal of obsolete library 'lib\servlet.jar'
; -------------------------------------------------------------------------
; - Version 0.1.20.0
; - Update installer to no longer install on Windows 98 and Windows ME
; - Change JRE version and copyright date to be determined by build.xml
; - ant script rather than being hard-coded here
; -------------------------------------------------------------------------
; - Version 0.1.19.0
; - Remove DecoderPro desktop shortcut from standard installation - now
; - only installed when selected
; -------------------------------------------------------------------------
; - Version 0.1.18.0
; - Remove DecoderPro3 from Tools and Demos and place in main JMRI start
; - menu along with Desktop shortcut
; -------------------------------------------------------------------------
; - Version 0.1.17.0
; - Change branding text
; -------------------------------------------------------------------------
; - Version 0.1.16.0
; - Add start menu shortcut for DecoderPro3
; -------------------------------------------------------------------------
; - Version 0.1.15.0
; - Remove shortcut to LocoTools JMRI application
; -------------------------------------------------------------------------
; - Version 0.1.14.0
; - Enabled the JMRI version to be determined by the ant dist.xml script
; - as opposed to being hard-coded in here
; - Update Multi-user installation configuration to default to the previous
; - settings when upgrading (i.e. Current User or All Users)
; - Updated URL for Windows 98 & ME JRE download to 1.5.0_22; was 1.5.0_17
; - see:
; - http://www.java.com/en/download/faq/win98_me.xml
; - http://www.java.com/en/download/windows98me_manual.jsp
; - As the build version is not checked, this will only be downloaded where
; - either no JRE exists or a version earlier than 1.5 is installed.
; -------------------------------------------------------------------------
; - Version 0.1.13.0
; - Removal of obsolete .bat and resource files
; -------------------------------------------------------------------------
; - Version 0.1.12.0
; - Update to remove comm.jar if found in JMRI\lib folder
; -------------------------------------------------------------------------
; - Version 0.1.11.0
; - Update to remove WiThrottle plug-in if previously installed
; - Modify backup check to default to off when installing over newer or
; - identical version
; - Changed backup behaviour to keep two backups:
; - - JMRI_backup
; - - JMRI_backup_old
; -------------------------------------------------------------------------
; - Version 0.1.10.0
; - Update to correctly identify JRE architecture when installing on 64-bit
; - systems.
; -------------------------------------------------------------------------
; - Version 0.1.9.0
; - Update installer for new library structure
; -------------------------------------------------------------------------
; - Version 0.1.8.0
; - Update installer for migration to new version of RXTX ensuring that
; - correct version of the .dll is installed for 32-bit or 64-bit
; - Also, changed the SerialIO installation to be localised to the JMRI
; - program directory, rather than in the system-wide JRE
; -------------------------------------------------------------------------
; - Version 0.1.7.0
; - Update to ensure removal of crimson.jar library file in both old and
; - new file layouts
; -------------------------------------------------------------------------
; - Version 0.1.6.0
; - Corrected an error where old install location was not being read back
; - if previously installed.
; - Improved check to avoid installation into Program Files root.
; - Updated installer to ensure JMRI uses the same library file layout as
; - on Linux and Mac OS X platforms.
; - Added additional obsolete decoder definitions to delete.
; - Use new icon for InstallTest application.
; - Add Start menu shortcut and optional Desktop shortcut for SoundPro
; - application.
; -------------------------------------------------------------------------
; - Version 0.1.5.0
; - Incorporated new routine to delete obsolete decoder definitions.
; - At the moment, it is purely done by deleting specified files from the
; - xml\decoders directory.
; -------------------------------------------------------------------------
; - Version 0.1.4.0
; - For a post-2.5.2 upgrade, defaulted the backup of preference and roster
; - files to be selected and also made this optional. Current behaviour
; - remains unchanged for a pre-2.5.2 upgrade (i.e. uninstallation with
; - backup is mandatory and must be explicitly selected by the user)
; -------------------------------------------------------------------------
; - Version 0.1.3.0
; - Removed the 'skipping' of program location and start menu selection
; - screens in all installation variants.
; - Renamed the 'Custom' installer
; - Enabled the install location to be read from the stored location in the
; - registry so that an upgrade will use that location, as opposed to the
; - default when installing.
; - General clean-up of obsolete code.
; -------------------------------------------------------------------------
; - Version 0.1.2.0
; - Modified offline JRE installer for Windows 98 and ME to look for a JRE
; - installer in the JRE_98ME sub-directory. This allows for a single CD to
; - be created for offline distribution.
; -------------------------------------------------------------------------
; - Version 0.1.1.0
; - Tidied up the previous version check.
; -------------------------------------------------------------------------
; - Version 0.1.0.0
; - First release for production.
; - Incorporated saving of the log to allow for cleaner uninstall.
; - Uninstaller now removes only those files and directories installed.
; - TODO: Remove reliance on access to global 'Program Files' directory
; -------------------------------------------------------------------------
; - Version 0.0.4.0
; - Reverted back to Multi-user installer with JMRI always installed into
; - 'Program Files' (need to come back and look at the scenario where a
; - user has insufficient rights to install there).
; - Removed most Desktop shortcuts and created a new 'Tools and Demos'
; - start menu folder containing less commonly used items plus a new
; - shortcut to the users Preferences folder.
; - Modified old InstallVise installer check to run the InstallVise
; - uninstaller first (with a backup of all settings and user files).
; -------------------------------------------------------------------------
; - Version 0.0.3.0
; - Removed the 'Current user' option for now as the exact behaviour of the
; - installer under Vista is not yet clear.
; - Removed custom pages and reliance on UAC and AccessControl plugins.
; -------------------------------------------------------------------------
; - Version 0.0.2.0
; - Converted to use ModernUI 2.0 (available as from NSIS v2.34).
; - Changed to use nsDialogs for custom pages instead of InstallOptions.
; - For installation on Vista, now using UAC and AccessControl plugins to
; - deal with gaining appropriate permissions for installer actions.
; -------------------------------------------------------------------------
; - Version 0.0.1.0
; - First internal test release.
; -------------------------------------------------------------------------
; -------------------------------------------------------------------------
; - Basic information
; - These should be edited to suit the application
; -------------------------------------------------------------------------
!define AUTHOR "Matt Harris for JMRI" ; Author name
!define APP "JMRI" ; Application name
!ifndef JMRI_COPY
; -- usually, this will be determined by the build.xml ant script
!define JMRI_COPY "by" ; Copyright dates
!endif
!define COPYRIGHT "(c) ${JMRI_COPY} JMRI Community" ; Copyright string
!ifndef JMRI_VER
; -- usually, this will be determined by the build.xml ant script
!define JMRI_VER "unknown" ; Application version
!endif
!ifndef RELEASEDIR
; -- usually, this will be determined by the build.xml ant script
!define RELEASEDIR ".."
!endif
!ifndef JRE_VER
; -- usually, this will be determined by the build.xml ant script
!define JRE_VER "1.8" ; Required JRE version
!endif
!define INST_VER "0.1.27.0" ; Installer version
!define PNAME "${APP}.${JMRI_VER}" ; Name of installer.exe
!define SRCDIR "." ; Path to head of sources
InstallDir "$PROGRAMFILES\JMRI" ; Default install directory
; -------------------------------------------------------------------------
; - End of basic information
; - Lines below here should not normally require editing
; -------------------------------------------------------------------------
; -------------------------------------------------------------------------
; - Variable declarations
; -------------------------------------------------------------------------
Var JAVADIR ; holds the path to the location where JAVA files can be found
Var SMFOLDER ; holds the returned Start Menu Folder
Var JREINSTALLER ; holds the path to the location of the JRE installer
Var OFFLINEINSTALL ; a flag determining if this is an offline install
Var JREINSTALLCOUNT ; a counter holding times around the JRE install loop
Var REMOVEOLDINSTALL ; a flag to determine if old installer to be removed
Var REMOVEOLDJMRI.BACKUPONLY ; a flag to determine if we should back-up
Var UPGRADING ; a flag to determine if we are upgrading
Var x64 ; flag to determine if we're installing in x64 or not
Var x64JRE ; flag to determine if we've got a 64-bit JRE
; -------------------------------------------------------------------------
; - Compiler Flags (to reduce executable size, saves some bytes)
; -------------------------------------------------------------------------
SetDatablockOptimize on
SetCompress force
SetCompressor /SOLID /FINAL lzma
; -------------------------------------------------------------------------
; - Defines for downloading
; -------------------------------------------------------------------------
!define JRE_URL "https://jmri.org/java"
!define INTERNET_CONNECTION_CONFIGURED 64 ; 0x40
!define INTERNET_CONNECTION_LAN 2 ; 0x02
!define INTERNET_CONNECTION_MODEM 1 ; 0x01
!define INTERNET_CONNECTION_OFFLINE 32 ; 0x20
!define INTERNET_CONNECTION_PROXY 4 ; 0x04
!define INTERNET_RAS_INSTALLED 16 ; 0x10
; -------------------------------------------------------------------------
; - Defines for multi-user installation
; -------------------------------------------------------------------------
!define MULTIUSER_EXECUTIONLEVEL Highest
!define MULTIUSER_MUI ; allow for use with ModernUI
!define MULTIUSER_INSTALLMODE_COMMANDLINE
!define MULTIUSER_INIT_TEXT_ALLUSERSNOTPOSSIBLE "Your user account does not have sufficient privileges to uninstall $(^Name) for all users of this computer."
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI"
!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME ""
; -------------------------------------------------------------------------
; - Includes
; -------------------------------------------------------------------------
!include "MultiUser.nsh" ; MultiUser installation
!include "WordFunc.nsh" ; add header for word manipulation
!insertmacro VersionCompare ; add function to compare versions
;-- from https://nsis.sourceforge.io/GetInQuotes:_Get_string_from_between_quotes
Function GetInQuotes
Exch $R0
Push $R1
Push $R2
Push $R3
StrCpy $R2 -1
IntOp $R2 $R2 + 1
StrCpy $R3 $R0 1 $R2
StrCmp $R3 "" 0 +3
StrCpy $R0 ""
Goto Done
StrCmp $R3 '"' 0 -5
IntOp $R2 $R2 + 1
StrCpy $R0 $R0 "" $R2
StrCpy $R2 0
IntOp $R2 $R2 + 1
StrCpy $R3 $R0 1 $R2
StrCmp $R3 "" 0 +3
StrCpy $R0 ""
Goto Done
StrCmp $R3 '"' 0 -5
StrCpy $R0 $R0 $R2
Done:
Pop $R3
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
; -------------------------------------------------------------------------
; - Defines for log saving
; -------------------------------------------------------------------------
!ifndef LVM_GETITEMCOUNT
!define LVM_GETITEMCOUNT 0x1004
!endif
!ifndef LVM_GETITEMTEXT
!define LVM_GETITEMTEXT 0x102D
!endif
; -------------------------------------------------------------------------
; - Runtime Switches
; -------------------------------------------------------------------------
CRCCheck On ; do CRC check on launcher before start ("Off" for later EXE compression)
ShowInstDetails Hide ; Hide the installation details
ShowUninstDetails Hide ; Hide the uninstallation details
AutoCloseWindow False ; do not automatically close when finished
RequestExecutionLevel admin ; Request administrator level access
; -------------------------------------------------------------------------
; - Set basic information
; -------------------------------------------------------------------------
Name "${APP} ${JMRI_VER}"
Caption "${APP} ${JMRI_VER} Setup"
BrandingText "${APP} - ${COPYRIGHT}"
OutFile "${RELEASEDIR}/${PNAME}.exe"
; -------------------------------------------------------------------------
; - Interface Settings
; -------------------------------------------------------------------------
!ifdef ICON
!define MUI_ICON "${ICON}"
!else
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!endif
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_ABORTWARNING
!define MUI_UNABORTWARNING
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "JMRI"
!define MUI_STARTMENUPAGE_NODISABLE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "SHCTX"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "StartMenuDir"
!define MUI_FINISHPAGE_NOAUTOCLOSE
#!define MUI_FINISHPAGE_RUN
#!define MUI_FINISHPAGE_RUN_TEXT "Execute DecoderPro Install Validation Wizard"
#!define MUI_FINISHPAGE_RUN_FUNCTION InstallValidationWizard
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
; -------------------------------------------------------------------------
; - Define pages
; -------------------------------------------------------------------------
!define MUI_TEXT_WELCOME_INFO_TEXT "This wizard will guide you through the installation of $(^NameDA).$\r$\n$\r$\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.$\r$\n$\r$\n$(^NameDA) requires Java Runtime Environment ${JRE_VER} or later installed on your computer. During installation, this wizard will check for Java.$\r$\n$\r$\n$_CLICK"
!insertmacro MUI_PAGE_WELCOME
Page custom nsDialogRemoveOldJMRI RemoveOldJMRI
!insertmacro MULTIUSER_PAGE_INSTALLMODE
!insertmacro MUI_PAGE_COMPONENTS
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirectoryLeave
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU JMRIStartMenu $SMFOLDER
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
InstType "Typical"
InstType "Full"
; -------------------------------------------------------------------------
; - Languages
; -------------------------------------------------------------------------
!insertmacro MUI_LANGUAGE "English"
; -------------------------------------------------------------------------
; - Reserve files (note some are already reserved by MUI2 and MultiUser)
; -------------------------------------------------------------------------
; - If solid compression is being used, files that are required before the
; - actual installation itself should be stored in the first data block -
; - this will ensure that the installer starts faster
; -------------------------------------------------------------------------
ReserveFile /plugin "System.dll"
ReserveFile /plugin "NSISdl.dll"
ReserveFile /plugin "UserInfo.dll"
; -------------------------------------------------------------------------
; - Set version information
; -------------------------------------------------------------------------
VIProductVersion "${INST_VER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "${APP} Install"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "Installs JMRI ${JMRI_VER} suite."
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "${COPYRIGHT}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "by ${AUTHOR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APP} Install"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${INST_VER}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "OriginalFilename" "${PNAME}.exe"
; -------------------------------------------------------------------------
; - Installer sections
; -------------------------------------------------------------------------
SectionGroup "JMRI Core Files" SEC_CORE
Section "-CleanUp" ; SEC_CLEANUP
SectionIn RO ; This section always selected
; -- Clean up of JMRI folder
SetOutPath "$INSTDIR"
; -- Recursively delete classes folder, which historically contained
; -- individual .properties and .classes patch files
; -- that might not be consistent with this new version
RMDir /R "$OUTDIR\classes"
; -- Recursively delete lib folder, which historically contained
; -- individually added JAR files, but which we have been encouraging
; -- users not to modify
RMDir /R "$OUTDIR\lib"
; -- Delete old USB library files
Delete "$OUTDIR\ch.ntb.usb.jar"
; -- Delete old .jar & support files in destination directory
Delete "$OUTDIR\jh.1.1.2.jar"
Delete "$OUTDIR\jh.jar"
Delete "$OUTDIR\jdom-jdk11.jar"
; -- Delete certain jython files that have been moved, or were entered erroneously, as of JMRI 4.21.3
Delete "$OUTDIR\jython\SetMqttOptions.py"
Delete "$OUTDIR\jython\SetMqttParser.py"
Delete "$OUTDIR\jython\SetMqttPrefix.py"
Delete "$OUTDIR\jython\ReceiveMqttMessage.py"
Delete "$OUTDIR\jython\SendMqttMessage.py"
Delete "$OUTDIR\jython\CmriBitsToBytes.jy"
; -- Delete XmlIO-related files, as of JMRI 3.11.3
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\2Throttles.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\AnalogClock.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\Help.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\inControlIcon.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\LocoSettings.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\Panel.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\QueryStringHelp.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\Scan2BeInControl.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\Settings.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\Throttle1.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\Throttle2.png"
Delete "$OUTDIR\help\en\package\jmri\jmrit\inControl\images\.png"
RmDir "$OUTDIR\help\en\package\jmri\jmrit\inControl\images"
RmDir "$OUTDIR\help\en\package\jmri\jmrit\inControl"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\2Throttles.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\AnalogClock.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\Help.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\inControlIcon.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\LocoSettings.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\Panel.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\QueryStringHelp.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\Scan2BeInControl.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\Settings.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\Throttle1.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\Throttle2.png"
Delete "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images\.png"
RmDir "$OUTDIR\help\fr\package\jmri\jmrit\inControl\images"
RmDir "$OUTDIR\help\fr\package\jmri\jmrit\inControl"
Delete "$OUTDIR\web\css\inControl.css"
Delete "$OUTDIR\web\css\JMRI_XMLIO_TEST.css"
Delete "$OUTDIR\web\css\Scan2BeInControl.css"
Delete "$OUTDIR\web\js\inControl.js"
Delete "$OUTDIR\web\js\JMRI_XMLIO_TEST.js"
Delete "$OUTDIR\web\js\Scan2BeInControl.js"
Delete "$OUTDIR\web\inControl.html"
Delete "$OUTDIR\web\inControl.jar"
Delete "$OUTDIR\web\JMRI_XMLIO_test.html"
Delete "$OUTDIR\web\Scan2BeInControl.html"
; Delete files which were removed as part of re-work of Zimo decoder
; definition rework for JMRI 3.11.3
Delete "$OUTDIR\xml\decoders\zimo\CV739-CV744threeSwitchIP.xml"
Delete "$OUTDIR\xml\decoders\zimo\CV739-CV744twoSwitchIP.xml"
Delete "$OUTDIR\xml\decoders\zimo\CV739-CV768.xml"
; -- Delete .jar & support files installed using previous layout
Delete "$OUTDIR\activation.jar"
Delete "$OUTDIR\ch.ntb.usb.jar"
Delete "$OUTDIR\comm.jar"
Delete "$OUTDIR\crimson.jar"
Delete "$OUTDIR\ExternalLinkContentViewerUI.jar"
Delete "$OUTDIR\gluegen-rt.dll"
Delete "$OUTDIR\gluegen-rt.jar"
Delete "$OUTDIR\javacsv.jar"
Delete "$OUTDIR\javax.comm.properties"
Delete "$OUTDIR\jdom-2.0.5.jar"
Delete "$OUTDIR\jdom.jar"
Delete "$OUTDIR\jhall.jar"
Delete "$OUTDIR\jinput-dx8.dll"
Delete "$OUTDIR\jinput-raw.dll"
Delete "$OUTDIR\jinput-wintab.dll"
Delete "$OUTDIR\jinput.jar"
Delete "$OUTDIR\joal.jar"
Delete "$OUTDIR\joal_native.dll"
Delete "$OUTDIR\jspWin.dll"
Delete "$OUTDIR\jython.jar"
Delete "$OUTDIR\LibusbJava.dll"
Delete "$OUTDIR\log4j.jar"
Delete "$OUTDIR\mailapi.jar"
Delete "$OUTDIR\MRJAdapter.jar"
Delete "$OUTDIR\security.policy"
Delete "$OUTDIR\Serialio.jar"
Delete "$OUTDIR\servlet.jar"
Delete "$OUTDIR\smtp.jar"
Delete "$OUTDIR\vecmath.jar"
Delete "$OUTDIR\win32com.dll"
Delete "$OUTDIR\xercesImpl.jar"
; -- Delete old plug-ins from program folder
Delete "$OUTDIR\WiThrottle.jar"
; -- Delete old log files from program folder
Delete "$OUTDIR\messages.log"
Delete "$OUTDIR\uninstal.log" ; from InstallerVise installer
; -- Delete obsolete .bat files from program folder
Delete "$OUTDIR\CornwallRR.bat"
Delete "$OUTDIR\DecoderPro.bat"
Delete "$OUTDIR\JmriDemo.bat"
Delete "$OUTDIR\LocoTools.bat"
Delete "$OUTDIR\PacketPro.bat"
Delete "$OUTDIR\PanelPro.bat"
Delete "$OUTDIR\SoundPro.bat"
; -- Delete obsolete resource files
Delete "$OUTDIR\resources\GreenPowerLED.gif"
Delete "$OUTDIR\resources\RedPowerLED.gif"
Delete "$OUTDIR\resources\YellowPowerLED.gif"
; -- If the current install Start Menu folder exists, remove any
; -- predictably-named JMRI-related contents.
!insertmacro MUI_STARTMENU_GETFOLDER JMRIStartMenu $0
; -- Change file attributes early so they have time to propagate on systems
; -- with unexpected delays in the filesystem.
SetFileAttributes "$SMPROGRAMS\$0\Tools\Preferences.lnk" NORMAL
Delete "$SMPROGRAMS\$0\DecoderPro.lnk"
Delete "$SMPROGRAMS\$0\DecoderPro3.lnk"
Delete "$SMPROGRAMS\$0\PanelPro.lnk"
Delete "$SMPROGRAMS\$0\SoundPro.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\JmriDemo.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\LocoTools.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\CornwallRR.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\InstallTest.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\InstallTest.pif" ; -- for Win98
Delete "$SMPROGRAMS\$0\Tools and Demos\DecoderPro3.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\Preferences.lnk"
Delete "$SMPROGRAMS\$0\Tools\InstallTest.lnk"
Delete "$SMPROGRAMS\$0\Tools\Preferences.lnk"
Delete "$SMPROGRAMS\$0\Uninstall.lnk"
RMDir "$SMPROGRAMS\$0\Tools and Demos\"
RMDir "$SMPROGRAMS\$0\Tools\"
RMDir "$SMPROGRAMS\$0\"
; -- Remove any predictably-named JMRI shortcuts from the Desktop
Delete "$DESKTOP\DecoderPro.lnk"
Delete "$DESKTOP\DecoderPro3.lnk"
Delete "$DESKTOP\PanelPro.lnk"
Delete "$DESKTOP\SoundPro.lnk"
SectionEnd ; SEC_CLEANUP
Section "Main" SEC_MAIN
SectionIn RO ; This section always selected
; -- Check for JRE
Call CheckJRE
; -- Main JMRI files
SetOutPath "$INSTDIR"
; -- Install main JMRI files
; -- Library & Support Files now moved from here
File /a "${SRCDIR}\*.jar"
File /a "${SRCDIR}\COPYING"
File /a "${SRCDIR}\jmri.conf"
File /a "${SRCDIR}\LaunchJMRI.exe"
File /a "${SRCDIR}\*.bat"
File /a "${SRCDIR}\default_lcf.xml"
File /a "${SRCDIR}\*.ico"
File /a "${SRCDIR}\lib\security.policy"
File /a "${SRCDIR}\python.properties"
SectionEnd ; SEC_MAIN
Section "COM Library" SEC_COMLIB
SectionIn RO ; This section always selected
; -- If we're upgrading, we need to make sure that
; -- any previously loaded library files in the JRE
; -- are removed
StrCmp $UPGRADING "1" 0 InstallComLib
Delete "$JAVADIR\lib\javax.comm.properties"
Delete "$JAVADIR\lib\ext\Serialio.jar"
Delete "$JAVADIR\bin\jspWin.dll"
Delete "$JAVADIR\bin\win32com.dll"
InstallComLib:
SetOutPath "$INSTDIR\lib"
; -- SerialIO native library
File /a "${SRCDIR}\jspWin.dll"
SectionEnd ; SEC_COMLIB
Section "Help" SEC_HELP
SectionIn RO ; This section always selected
; -- Help files installed here
SetOutPath "$INSTDIR\help"
File /a /r "${SRCDIR}\help\*.*"
SectionEnd ; SEC_HELP
Section "Library files" SEC_LIB
SectionIn RO ; This section always selected
; -- Library files installed here
SetOutPath "$INSTDIR\lib"
; -- Match all files in 'lib' but do not recurse into sub-directories
File /a "${SRCDIR}\lib\*.*"
; -- Install x86 library files
SetOutPath "$INSTDIR\lib\x86"
; -- Match all files in 'lib\windows\x86' but do not recurse into sub-directories
File /a "${SRCDIR}\lib\windows\x86\*.*"
; -- Install x64 library files
SetOutPath "$INSTDIR\lib\x64"
; -- Match all files in 'lib\windows\x64' but do not recurse into sub-directories
File /a "${SRCDIR}\lib\windows\x64\*.*"
; -- Extract and run OpenAL library installer in silent mode
; [Ignored for now]
;SetOutPath "$TEMP"
;File /a /r "${SRCDIR}\oalinst.exe"
;ExecWait `"$TEMP\oalinst.exe" -s`
;Delete "$TEMP\oalinst.exe"
SectionEnd ; SEC_LIB
Section "Jython files" SEC_JYTHON
SectionIn RO ; This section always selected
; -- Jython script files here
SetOutPath "$INSTDIR\jython"
File /a /r "${SRCDIR}\jython\*.*"
SectionEnd ; SEC_JYTHON
Section "Resource files" SEC_RES
SectionIn RO ; This section always selected
; -- Resource files here
SetOutPath "$INSTDIR\resources"
File /a /r "${SRCDIR}\resources\*.*"
SectionEnd ; SEC_RES
Section "XML files" SEC_XML
SectionIn RO ; This section always selected
; -- Check to see if we've been previously installed with the new installer
; -- and if so, remove obsolete decoder definitions
StrCmp $REMOVEOLDJMRI.BACKUPONLY "1" RemoveObsolete InstallXML
RemoveObsolete:
Call RemoveObsoleteDecoderDefinitions
InstallXML:
; -- XML files here
SetOutPath "$INSTDIR\xml"
File /a /r "${SRCDIR}\xml\*.*"
SectionEnd ; SEC_XML
Section "Web files" SEC_WEB
SectionIn RO ; This section always selected
; -- Web files here
SetOutPath "$INSTDIR\web"
File /a /r "${SRCDIR}\web\*.*"
SectionEnd ; SEC_WEB
SectionGroupEnd ; SEC_CORE
SectionGroup "Start menu shortcuts" SEC_SMSC
; -- Create Start menu shortcuts
Section "Standard Components" SEC_SCSMSC
SectionIn RO ; This section always selected
!insertmacro MUI_STARTMENU_WRITE_BEGIN JMRIStartMenu
SetOutPath "$INSTDIR"
CreateDirectory "$SMPROGRAMS\$SMFOLDER"
; -- Remove any shortcuts to deprecated components
Delete "$SMPROGRAMS\$SMFOLDER\Tools and Demos\LocoTools.lnk"
Delete "$SMPROGRAMS\$SMFOLDER\Tools and Demos\DecoderPro3.lnk"
; -- Create shortcuts for standard JMRI components
CreateShortcut "$SMPROGRAMS\$SMFOLDER\DecoderPro.lnk" \
"$INSTDIR\LaunchJMRI.exe" \
"apps.gui3.dp3.DecoderPro3" \
"$INSTDIR\decpro5.ico" 0 "" "" \
"Start DecoderPro"
CreateShortcut "$SMPROGRAMS\$SMFOLDER\PanelPro.lnk" \
"$INSTDIR\LaunchJMRI.exe" \
"apps.PanelPro.PanelPro" \
"$INSTDIR\PanelPro80x80.ico" 0 "" "" \
"Start PanelPro"
CreateShortcut "$SMPROGRAMS\$SMFOLDER\SoundPro.lnk" \
"$INSTDIR\LaunchJMRI.exe" \
"apps.SoundPro.SoundPro" \
"$INSTDIR\SoundPro80x80.ico" 0 "" "" \
"Start SoundPro"
CreateDirectory "$SMPROGRAMS\$SMFOLDER\Tools"
CreateShortcut "$SMPROGRAMS\$SMFOLDER\Tools\InstallTest.lnk" \
"$INSTDIR\InstallTest.bat" \
"" \
"$INSTDIR\InstallTest80x80.ico" 0 "" "" \
"Start JMRI Install Test"
; -- Create a preferences directory for this user
IfFileExists "$PROFILE\JMRI\*.*" +2
CreateDirectory "$PROFILE\JMRI"
; -- Now create a shortcut to it
CreateShortcut "$SMPROGRAMS\$SMFOLDER\Tools\Preferences.lnk" \
"%HOMEDRIVE%%HOMEPATH%\JMRI" \
"" \
"" "" "" "" \
"Open JMRI Preferences Folder"
SetFileAttributes "$SMPROGRAMS\$SMFOLDER\Tools\Preferences.lnk" READONLY
CreateShortcut "$SMPROGRAMS\$SMFOLDER\Uninstall.lnk" \
"$INSTDIR\Uninstall.exe" \
"/$MultiUser.InstallMode"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd ; SEC_SCSMSC
SectionGroupEnd ; SEC_SMSC
SectionGroup "Desktop Shortcuts" SEC_DTSC
; -- Create Desktop shortcuts
Section "DecoderPro" SEC_DPDTSC
SectionIn 1 2
CreateShortcut "$DESKTOP\DecoderPro.lnk" \
"$INSTDIR\LaunchJMRI.exe" \
"apps.gui3.dp3.DecoderPro3" \
"$INSTDIR\decpro5.ico" 0 "" "" \
"Start DecoderPro"
SectionEnd ; SEC_DPDTSC
Section "PanelPro" SEC_PPDTSC
SectionIn 1 2
CreateShortcut "$DESKTOP\PanelPro.lnk" \
"$INSTDIR\LaunchJMRI.exe" \
"apps.PanelPro.PanelPro" \
"$INSTDIR\PanelPro80x80.ico" 0 "" "" \
"Start PanelPro"
SectionEnd ; SEC_PPDTSC
Section /o "SoundPro" SEC_SPDTSC
SectionIn 2
CreateShortcut "$DESKTOP\SoundPro.lnk" \
"$INSTDIR\LaunchJMRI.exe" \
"apps.SoundPro.SoundPro" \
"$INSTDIR\SoundPro80x80.ico" 0 "" "" \
"Start SoundPro"
SectionEnd ; SEC_SPDTSC
SectionGroupEnd ; SEC_DTSC
Section "-Create Uninstaller" SEC_CRUNINST
SectionIn RO ; This section always selected
; -- Create Uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd ; SEC_CRUNINST
Section "-PostProcessing" SEC_POST
SectionIn RO ; This section always selected
; -- Register with Windows Add/Remove Programs
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"DisplayName" "JMRI - Java Model Railroad Interface"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"UninstallString" `"$INSTDIR\Uninstall.exe" /$MultiUser.InstallMode`
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"InstallLocation" "$INSTDIR"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"DisplayVersion" "${JMRI_VER}"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"Publisher" "JMRI Community"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"URLInfoAbout" "https://jmri.org/"
WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"NoModify" 1
WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI" \
"NoRepair" 1
; -- Register task to create JMRI Preferences directory with Active Setup
; -- to ensure created for each new user (for All Users on Win2k+ only)
StrCmp $MultiUser.InstallMode "CurrentUser" Done
; -- Write the Local Machine registry entries
WriteRegStr HKLM "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"" "JMRI Customizations"
WriteRegStr HKLM "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"ComponentID" "JMRI"
WriteRegDWORD HKLM "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"IsInstalled" 1
WriteRegStr HKLM "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"Locale" "*"
WriteRegStr HKLM "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"StubPath" "$INSTDIR\CreatePrefs.bat"
WriteRegStr HKLM "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"Version" "0,0,0,1"
; -- Write the Current User registry entries
WriteRegStr HKCU "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"" ""
WriteRegStr HKCU "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"Locale" "*"
WriteRegStr HKCU "Software\Microsoft\Active Setup\Installed Components\JMRI" \
"Version" "0,0,0,1"
Done:
; -- Save the log
StrCpy $0 "$INSTDIR\install.log"
Push $0
Call SaveLog
SectionEnd ; SEC_POST
Section "Uninstall" ; SEC_CRUNINST
; -- Remove all program files
StrCpy $0 "$INSTDIR\install.log"
Push $0
Call un.DeleteFromLog
; -- Remove all shortcuts
!insertmacro MUI_STARTMENU_GETFOLDER JMRIStartMenu $0
; -- Change file attributes early so they have time to propagate on systems
; -- with unexpected delays in the filesystem.
SetFileAttributes "$SMPROGRAMS\$0\Tools\Preferences.lnk" NORMAL
Delete "$SMPROGRAMS\$0\DecoderPro.lnk"
Delete "$SMPROGRAMS\$0\DecoderPro3.lnk"
Delete "$SMPROGRAMS\$0\PanelPro.lnk"
Delete "$SMPROGRAMS\$0\SoundPro.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\JmriDemo.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\LocoTools.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\CornwallRR.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\InstallTest.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\InstallTest.pif" ; -- for Win98
Delete "$SMPROGRAMS\$0\Tools and Demos\DecoderPro3.lnk"
Delete "$SMPROGRAMS\$0\Tools and Demos\Preferences.lnk"
Delete "$SMPROGRAMS\$0\Tools\Preferences.lnk"
Delete "$SMPROGRAMS\$0\Tools\InstallTest.lnk"
Delete "$SMPROGRAMS\$0\Uninstall.lnk"
RMDir "$SMPROGRAMS\$0\Tools and Demos\"
RMDir "$SMPROGRAMS\$0\Tools\"
RMDir "$SMPROGRAMS\$0\"
Delete "$DESKTOP\DecoderPro.lnk"
Delete "$DESKTOP\PanelPro.lnk"
Delete "$DESKTOP\SoundPro.lnk"
Delete "$DESKTOP\DecoderPro3.lnk"
; -- Remove registry entries
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JMRI"
StrCmp $MultiUser.InstallMode "CurrentUser" Done
DeleteRegKey HKLM "Software\Microsoft\Active Setup\Installed Components\JMRI"
Done:
; -- Remove log file
Delete "$INSTDIR\install.log"
; -- Remove the uninstaller
Delete "$INSTDIR\Uninstall.exe"
; -- Delete install directory if empty
RmDir "$INSTDIR"
SectionEnd