This repository has been archived by the owner on Feb 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.nsi
1091 lines (939 loc) · 45.4 KB
/
setup.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
# We assume the following commandline parameters for the compilation
# DIR_PREFIX is the full path to the directory containing the different modules
# SOURCE_VERSION defines the version of the release
# SOURCE_DIR is the relative path to the groovy install directory
# NATIVE_DIR is the relative path to the native launcher
# SCRIPTOM_DIR is the relative path to the scriptom module
# GANT_DIR is the relative path to the gant module
# GPARS_DIR is the relative path to the optional libraries for gpars
# GRIFFON_B_DIR is the relative path to the griffon builders module
# GAELYK_DIR is the relative path to the Gaelyk module
# SPOCK_DIR is the relative path to the Spock module
# EASYB_DIR is the relative path to the easyb module
# GMOCK_DIR is the relative path to the gmock module
# GROOVYSERV_DIR is the relative path to the groovyserv module
# GRENGINE_DIR is the relative path to the grengine module
# VERSION_TXT is the relative path to the installed_versions.txt
# DOC_DIR is the relative path to the doc directory
# JAVA_ARCH is the directory containing the architecture detection jar
# Set the compression level
SetCompressor /SOLID lzma
# The source of the Groovy installation
!define SOURCEDIR "${DIR_PREFIX}\${SOURCE_DIR}"
# Defines
!define URL http://groovy-lang.org/
!define ShortName Groovy
!define VERSION ${SOURCE_VERSION}
Name "Groovy-${Version}"
!define REGKEY "SOFTWARE\$(^Name)"
!define SUPPLEMENTARY "Supplementary"
# Version Information for the executable
VIProductVersion "${Version}.0"
VIAddVersionKey "ProductName" "Groovy Installer"
VIAddVersionKey "FileDescription" "Windows Installer for the Groovy language"
VIAddVersionKey "FileVersion" "${Version}.0"
VIAddVersionKey "ProductVersion" "${Version}.0"
# MUI defines
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER $(^Name)
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\${VERSION_TXT}
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
!define MUI_ICON "${DIR_PREFIX}\${DOC_DIR}\html\groovy-jdk\groovy.ico"
!define MUI_UNICON "uninstall-groovy.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "header.bmp"
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
# Defines for Registry keys
!define REG_GROOVY_BINARIES "Groovy Binaries"
!define REG_GROOVY_DOCUMENTATION "Groovy Documentation"
!define REG_MODIFY_VARIABLES "Modify Variables"
!define REG_GANT "Gant"
!define REG_GRIFFON "Griffon"
!define REG_SCRIPTOM "Scriptom"
!define REG_GAELYK "Gaelyk"
!define REG_SPOCK "Spock"
!define REG_EASYB "easyb"
!define REG_GMOCK "GMock"
!define REG_GROOVYSERV "GroovyServ"
!define REG_GRENGINE "Grengine"
# Included files
!include Sections.nsh
!include MUI.nsh
!include logiclib.nsh
!include WinMessages.NSH
!include FileFunc.nsh
!include EnvVarUpdate.nsh
# Reserved Files
#ReserveFile "${NSISDIR}\Plugins\AdvSplash.dll"
# User and System Environment
!define NT_current_env 'HKCU "Environment"'
!define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
# Variables
Var StartMenuGroup
Var UserOrSystem
Var JavaArchModel
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE LICENSE
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
Page custom ReadVariables SetVariables
Page custom ReadFileAssociation SetFileAssociation
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE English
!insertmacro MUI_LANGUAGE German
!insertmacro MUI_LANGUAGE Spanish
!insertmacro MUI_LANGUAGE French
!insertmacro MUI_LANGUAGE PortugueseBR
# Installer attributes
OutFile "groovy-${SOURCE_VERSION}-installer.exe"
InstallDir "$PROGRAMFILES\${ShortName}\$(^Name)"
CRCCheck on
XPStyle on
ShowInstDetails show
InstallDirRegKey HKLM "${REGKEY}" Path
ShowUninstDetails show
LangString Java32 ${LANG_ENGLISH} "Detected 32 bit Java. Copying 32 bit Groovy binaries."
LangString Java32 ${LANG_GERMAN} "Erkannt 32-Bit-Java. Kopieren 32-Bit-Groovy Binärdateien."
LangString Java32 ${LANG_SPANISH} "Detectó 64 bits de Java. Copia de archivos binarios Groovy 32 bits."
LangString Java32 ${LANG_FRENCH} "Détecté 32 bits de Java. Copie 32 bits binaires Groovy."
LangString Java32 ${LANG_PortugueseBR} "Detectado 32 bits Java. Copiando binários Groovy 32 bits."
LangString Java64 ${LANG_ENGLISH} "Detected 64 bit Java. Copying 64 bit Groovy binaries."
LangString Java64 ${LANG_GERMAN} "Erkannt 64-Bit-Java. Kopieren 64-Bit-Groovy Binärdateien."
LangString Java64 ${LANG_SPANISH} "Detectó 64 bits de Java. Copia de archivos binarios Groovy 64 bits."
LangString Java64 ${LANG_FRENCH} "Détecté 64 bits de Java. Copie 64 bits binaires Groovy."
LangString Java64 ${LANG_PortugueseBR} "Detectado 64 bits Java. Copiando binários Groovy 64 bits."
LangString NoJava ${LANG_ENGLISH} "Cannot identify Java installation. Assuming 32 bit version."
LangString NoJava ${LANG_GERMAN} "Die Java-Installation kann nicht identifiziert werden. Gehe von einer 32-Bit Installation aus."
LangString NoJava ${LANG_SPANISH} "No se puede identificar a la instalación de Java. Suponiendo versión de 32 bits."
LangString NoJava ${LANG_FRENCH} "Impossible d'identifier la version de Java installée. Version 32 bits supposée."
LangString NoJava ${LANG_PortugueseBR} "Não é possível identificar a instalação do Java. Assumindo versão 32 bits."
# Install Types
InstType "Full"
InstType "Minimal"
# Installer sections
Section "Groovy Binaries" SecBinaries
SectionIn RO # this section cannot be deselected
SetOutPath $INSTDIR
SetOverwrite on
File /r "${SOURCEDIR}\*"
SetOutPath $INSTDIR\${SUPPLEMENTARY}\JavaArch
File /r "${JAVA_ARCH}\GetArchModel.jar"
File /r "${JAVA_ARCH}\GetArchDataModel.java"
# Now execute JRE
Call GetJRE
Pop $R0
# StrCpy $0 '"$R0" -classpath "${CLASSPATH}" ${CLASS}'
StrCpy $0 '"$R0" -jar "$INSTDIR\${SUPPLEMENTARY}\JavaArch\GetArchModel.jar"'
ExecWait $0 $JavaArchModel
${If} $JavaArchModel == 32
MessageBox MB_OK $(Java32) /SD IDOK
${Else}
MessageBox MB_OK $(Java64) /SD IDOK
${EndIf}
${If} ${Errors}
${OrIf} $JavaArchModel == 1
# We assume a 32-bit installation
MessageBox MB_OK $(NoJava)
StrCpy $JavaArchModel 32
${EndIf}
SetOutPath $INSTDIR\bin
${If} $JavaArchModel == 32
File /oname=groovy.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovy.exe"
File /oname=groovyc.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovy.exe"
File /oname=groovysh.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovy.exe"
File /oname=java2groovy.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovy.exe"
File /oname=groovyw.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovyw.exe"
File /oname=groovyConsole.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovyw.exe"
${Else}
File /oname=groovy.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovy.exe"
File /oname=groovyc.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovy.exe"
File /oname=groovysh.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovy.exe"
File /oname=java2groovy.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovy.exe"
File /oname=groovyw.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovyw.exe"
File /oname=groovyConsole.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovyw.exe"
${EndIf}
SetOutPath $INSTDIR
File /r "${DIR_PREFIX}\${NATIVE_DIR}\*"
File "${DIR_PREFIX}\${VERSION_TXT}"
File /r "${DIR_PREFIX}\${GPARS_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GROOVY_BINARIES}" 1
SectionEnd
Section "Groovy Documentation" SecDocumentation
SectionIn 1
SetOutPath $INSTDIR
SetOverwrite on
File /r "${DIR_PREFIX}\${DOC_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GROOVY_DOCUMENTATION}" 1
SectionEnd
Section "Modify Variables" SecVariables
SectionIn 1 2
SetOutPath $INSTDIR
SetOverwrite on
WriteRegStr HKLM "${REGKEY}\Components" "${REG_MODIFY_VARIABLES}" 1
SectionEnd
SectionGroup /e Modules SecGrpModules
Section Easyb SecEasyb
SectionIn 1
SetOutPath "$INSTDIR"
SetOverwrite on
File /r "${DIR_PREFIX}\${EASYB_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_EASYB}" 1
SectionEnd
Section Gaelyk SecGaelyk
SectionIn 1
SetOutPath $INSTDIR\${SUPPLEMENTARY}\Gaelyk
SetOverwrite on
File /r "${DIR_PREFIX}\${GAELYK_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GAELYK}" 1
SectionEnd
Section Gant SecGant
SectionIn 1
SetOutPath $INSTDIR
SetOverwrite on
File /r "${DIR_PREFIX}\${GANT_DIR}\*"
SetOutPath $INSTDIR\bin
${If} $JavaArchModel == 32
File /oname=gant.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovy.exe"
File /oname=gantw.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\32bit\groovyw.exe"
${Else}
File /oname=gant.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovy.exe"
File /oname=gantw.exe "${DIR_PREFIX}\${NATIVE_DIR}\${SUPPLEMENTARY}\native\64bit\groovyw.exe"
${EndIf}
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GANT}" 1
SectionEnd
Section GMock SecGMock
SectionIn 1
SetOutPath "$INSTDIR"
SetOverwrite on
File /r "${DIR_PREFIX}\${GMOCK_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GMOCK}" 1
SectionEnd
Section GroovyServ SecGroovyServ
SectionIn 1
SetOutPath "$INSTDIR"
SetOverwrite on
File /r "${DIR_PREFIX}\${GROOVYSERV_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GROOVYSERV}" 1
SectionEnd
Section Grengine SecGrengine
SectionIn 1
SetOutPath "$INSTDIR"
SetOverwrite on
File /r "${DIR_PREFIX}\${GRENGINE_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GRENGINE}" 1
SectionEnd
Section Griffon SecGriffon
SectionIn 1
SetOutPath $INSTDIR
SetOverwrite on
File /r "${DIR_PREFIX}\${GRIFFON_B_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_GRIFFON}" 1
SectionEnd
Section Scriptom SecScriptom
SectionIn 1
SetOutPath $INSTDIR
SetOverwrite on
File /r "${DIR_PREFIX}\${SCRIPTOM_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_SCRIPTOM}" 1
SectionEnd
Section Spock SecSpock
SectionIn 1
SetOutPath "$INSTDIR"
SetOverwrite on
File /r "${DIR_PREFIX}\${SPOCK_DIR}\*"
WriteRegStr HKLM "${REGKEY}\Components" "${REG_SPOCK}" 1
SectionEnd
SectionGroupEnd
# Links in Start Menu
LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
LangString ^UninstallLink ${LANG_GERMAN} "Deinstalliere $(^Name)"
LangString ^UninstallLink ${LANG_SPANISH} "Uninstall $(^Name)"
LangString ^UninstallLink ${LANG_FRENCH} "Uninstall $(^Name)"
LangString ^UninstallLink ${LANG_PortugueseBR} "Desinstalar $(^Name)"
LangString ^HTMLLink ${LANG_ENGLISH} "GDK Documentation"
LangString ^HTMLLink ${LANG_GERMAN} "GDK-Dokumentation"
LangString ^HTMLLink ${LANG_SPANISH} "Documentación del GDK"
LangString ^HTMLLink ${LANG_FRENCH} "Documentation du GDK"
LangString ^HTMLLink ${LANG_PortugueseBR} "Documentação do GDK"
LangString ^APILink ${LANG_ENGLISH} "API Documentation"
LangString ^APILink ${LANG_GERMAN} "API-Dokumentation"
LangString ^APILink ${LANG_SPANISH} "Documentación del API"
LangString ^APILink ${LANG_FRENCH} "Documentation de l'API"
LangString ^APILink ${LANG_PortugueseBR} "Documentação da API"
LangString ^GAPILink ${LANG_ENGLISH} "GAPI Documentation"
LangString ^GAPILink ${LANG_GERMAN} "GAPI-Dokumentation"
LangString ^GAPILink ${LANG_SPANISH} "Documentación del GAPI"
LangString ^GAPILink ${LANG_FRENCH} "Documentation de la GAPI"
LangString ^GAPILink ${LANG_PortugueseBR} "Documentação da GAPI"
LangString ^GroovyConsoleLink ${LANG_ENGLISH} "Start GroovyConsole"
LangString ^GroovyConsoleLink ${LANG_GERMAN} "Starte GroovyConsole"
LangString ^GroovyConsoleLink ${LANG_SPANISH} "Start GroovyConsole"
LangString ^GroovyConsoleLink ${LANG_FRENCH} "Start GroovyConsole"
LangString ^GroovyConsoleLink ${LANG_PortugueseBR} "Iniciar GroovyConsole"
Section "-Shortcuts" SecShortcuts
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $SMPROGRAMS\$StartMenuGroup
SectionGetFlags ${SecDocumentation} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
${If} $R0 == ${SF_SELECTED}
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^HTMLLink).lnk" $INSTDIR\html\groovy-jdk\index.html
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^APILink).lnk" $INSTDIR\html\api\index.html
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^GAPILink).lnk" $INSTDIR\html\gapi\index.html
${EndIf}
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^GroovyConsoleLink).lnk" $INSTDIR\bin\GroovyConsole.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKLM "${REGKEY}\Components" Shortcuts 1
SectionEnd
# Section Descriptions
LangString DESC_SecBinaries ${LANG_ENGLISH} "Main Groovy Binaries (includes native launcher)"
LangString DESC_SecBinaries ${LANG_GERMAN} "Groovy Basisinstallation (beinhaltet den nativelauncher)"
LangString DESC_SecBinaries ${LANG_SPANISH} "Ficheros principales de Groovy"
LangString DESC_SecBinaries ${LANG_FRENCH} "Binaires principaux de Groovy"
LangString DESC_SecBinaries ${LANG_PortugueseBR} "Main Groovy Binaries"
LangString DESC_SecDocumentation ${LANG_ENGLISH} "Groovy Documentation"
LangString DESC_SecDocumentation ${LANG_GERMAN} "Groovy-Dokumentation"
LangString DESC_SecDocumentation ${LANG_SPANISH} "Documentación de Groovy"
LangString DESC_SecDocumentation ${LANG_FRENCH} "Documentation de Groovy"
LangString DESC_SecDocumentation ${LANG_PortugueseBR} "Groovy Documentation"
LangString DESC_SecVariables ${LANG_ENGLISH} "Environment Variables and File Association"
LangString DESC_SecVariables ${LANG_GERMAN} "Umgebungsvariablen und Dateiassoziationen"
LangString DESC_SecVariables ${LANG_SPANISH} "Variables de Entorno y Asociación de Ficheros"
LangString DESC_SecVariables ${LANG_FRENCH} "Variables d'environnement et association de fichiers"
LangString DESC_SecVariables ${LANG_PortugueseBR} "Environment Variables and File Association"
LangString DESC_SecGrpModules ${LANG_ENGLISH} "Additional Modules are not strictly necessary, \
but we recommend installing them anyway."
LangString DESC_SecGrpModules ${LANG_GERMAN} "Zusätzliche Module sind nicht unbedingt notwendig, \
wir empfehlen aber, sie trotzdem zu installieren."
LangString DESC_SecGrpModules ${LANG_SPANISH} "Los Módulos Adicionales no son estrictamente \
necesarios, pero recomendamos que se instalen de todas formas."
LangString DESC_SecGrpModules ${LANG_FRENCH} "Les Modules aditionnels sont optionnels, \
nous vous recommendons cependant de les installer"
LangString DESC_SecGrpModules ${LANG_PortugueseBR} "Módulos adicionais não são estritamente necessários, \
mesmo assim recomendamos que sejam instalados."
LangString DESC_SecGant ${LANG_ENGLISH} "Gant - a build tool for scripting Ant tasks \
with Groovy"
LangString DESC_SecGant ${LANG_GERMAN} "Gant - Ein Werkzeug, um Ant Tasks mit Groovy \
zu programmieren"
LangString DESC_SecGant ${LANG_SPANISH} "Gant - una herramienta que facilita el \
'scripting' the tareas de Ant con Groovy"
LangString DESC_SecGant ${LANG_FRENCH} "Gant - Outil de build permettant de manipuler \
les tâches Ant avec Groovy"
LangString DESC_SecGant ${LANG_PortugueseBR} "Gant - uma ferramenta de build para criar tarefas do Ant \
com scripts Groovy"
LangString DESC_SecGriffon ${LANG_ENGLISH} "Griffon Builders"
LangString DESC_SecGriffon ${LANG_GERMAN} "Griffon Builders"
LangString DESC_SecGriffon ${LANG_SPANISH} "Builders de Griffon"
LangString DESC_SecGriffon ${LANG_FRENCH} "Builders Griffon"
LangString DESC_SecGriffon ${LANG_PortugueseBR} "Griffon Builders"
LangString DESC_SecScriptom ${LANG_ENGLISH} "Scriptom - script ActiveX or COM components \
with Groovy"
LangString DESC_SecScriptom ${LANG_GERMAN} "Scriptom - Programmieren von ActiveX und COM-\
Komponenten mit Groovy"
LangString DESC_SecScriptom ${LANG_SPANISH} "Scriptom - permite acceder y configurar \
components ActiveX y/o COM con Groovy"
LangString DESC_SecScriptom ${LANG_FRENCH} "Scriptom - Manipulation d'ActiveX ou composants \
COM avec Groovy"
LangString DESC_SecScriptom ${LANG_PortugueseBR} "Scriptom - acesse componentes ActiveX ou COM \
com Groovy"
LangString DESC_SecGaelyk ${LANG_ENGLISH} "Gaelyk - Develop with Google App Engine"
LangString DESC_SecGaelyk ${LANG_GERMAN} "Gaelyk - Entwickeln mit Google App Engine"
LangString DESC_SecGaelyk ${LANG_SPANISH} "Gaelyk - Desarrollo con Google App Engine"
LangString DESC_SecGaelyk ${LANG_FRENCH} "Gaelyk - Developpez avec Google app Engine"
LangString DESC_SecGaelyk ${LANG_PortugueseBR} "Gaelyk - Desenvolva para o Google App Engine"
LangString DESC_SecSpock ${LANG_ENGLISH} "Spock - The Testing and Specification Framework"
LangString DESC_SecSpock ${LANG_GERMAN} "Spock - Das Test- und Spezifikations-Frame- work"
LangString DESC_SecSpock ${LANG_SPANISH} "Spock - Herramienta de Pruebas y Especificaciones"
LangString DESC_SecSpock ${LANG_FRENCH} "Le framework de tests et de spécifications"
LangString DESC_SecSpock ${LANG_PortugueseBR} "Spock - Framework de Testes e Especificações"
LangString DESC_SecEasyb ${LANG_ENGLISH} "easyb - BDD with Groovy"
LangString DESC_SecEasyb ${LANG_GERMAN} "easyb - BDD mit Groovy"
LangString DESC_SecEasyb ${LANG_SPANISH} "easyb - BDD con Groovy"
LangString DESC_SecEasyb ${LANG_FRENCH} "easyb - BDD avec Groovy"
LangString DESC_SecEasyb ${LANG_PortugueseBR} "easyb - BDD para Groovy"
LangString DESC_SecGMock ${LANG_ENGLISH} "GMock - Mocking Framework for Groovy"
LangString DESC_SecGMock ${LANG_GERMAN} "GMock - Mocking Framework für Groovy"
LangString DESC_SecGMock ${LANG_SPANISH} "GMock - Burlándose de Marco para Groovy"
LangString DESC_SecGMock ${LANG_FRENCH} "GMock - Mocking Framework pour Groovy"
LangString DESC_SecGMock ${LANG_PortugueseBR} "GMock - Construa Mocks utilizando Groovy"
LangString DESC_SecGroovyServ ${LANG_ENGLISH} "GroovyServ - A Server for Executing Groovy Programs"
LangString DESC_SecGroovyServ ${LANG_GERMAN} "GroovyServ - Ein Server für die Ausführung von Groovy-Programmen"
LangString DESC_SecGroovyServ ${LANG_SPANISH} "GroovyServ - Un Servidor para la Ejecución de Programas de Groovy"
LangString DESC_SecGroovyServ ${LANG_FRENCH} "GroovyServ - Un serveur pour exécuter des programmes Groovy"
LangString DESC_SecGroovyServ ${LANG_PortugueseBR} "GroovyServ - Servidor para execução de programas Groovy"
LangString DESC_SecGrengine ${LANG_ENGLISH} "Grengine - An engine for running and embedding Groovy in a Java VM."
LangString DESC_SecGrengine ${LANG_GERMAN} "Grengine - Ein Motor für den Betrieb und die Einbettung Groovy in Java VM."
LangString DESC_SecGrengine ${LANG_SPANISH} "Grengine - Un motor para el funcionamiento y la incrustación de Groovy en una máquina virtual Java."
LangString DESC_SecGrengine ${LANG_FRENCH} "Grengine - Un moteur pour la course et l'intégration Groovy dans une machine virtuelle Java."
LangString DESC_SecGrengine ${LANG_PortugueseBR} "Grengine - Um motor para a execução e incorporação Groovy em uma máquina virtual Java."
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecBinaries} $(DESC_SecBinaries)
!insertmacro MUI_DESCRIPTION_TEXT ${SecDocumentation} $(DESC_SecDocumentation)
!insertmacro MUI_DESCRIPTION_TEXT ${SecVariables} $(DESC_SecVariables)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGrpModules} $(DESC_SecGrpModules)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGant} $(DESC_SecGant)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGriffon} $(DESC_SecGriffon)
!insertmacro MUI_DESCRIPTION_TEXT ${SecScriptom} $(DESC_SecScriptom)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGaelyk} $(DESC_SecGaelyk)
!insertmacro MUI_DESCRIPTION_TEXT ${SecSpock} $(DESC_SecSpock)
!insertmacro MUI_DESCRIPTION_TEXT ${SecEasyb} $(DESC_SecEasyb)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGMock} $(DESC_SecGMock)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGroovyServ} $(DESC_SecGroovyServ)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGrengine} $(DESC_SecGrengine)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section -post SEC0006
WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
SetOutPath $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${Version}.0"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "The Groovy Project"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" InstallLocation $INSTDIR
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" HelpLink "${URL}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLUpdateInfo "${URL}"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Contact "[email protected]"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\bin\GroovyConsole.exe
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
Call GetInstalledSize
Pop $0
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" EstimatedSize $0
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
Section /o un.Shortcuts UNSEC0998
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^GroovyConsoleLink).lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^HTMLLink).lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^APILink).lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^GAPILink).lnk"
DeleteRegValue HKLM "${REGKEY}\Components" "Shortcuts"
SectionEnd
# Uninstaller sections
Section /o un.GroovyServ UNSEC0010
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GROOVYSERV}"
SectionEnd
Section /o un.Grengine UNSEC0011
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GRENGINE}"
SectionEnd
Section /o un.GMock UNSEC0009
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GMOCK}"
SectionEnd
Section /o un.Easyb UNSEC0008
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_EASYB}"
SectionEnd
Section /o un.Spock UNSEC0007
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_SPOCK}"
SectionEnd
Section /o un.Gaelyk UNSEC0006
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GAELYK}"
SectionEnd
Section /o un.Scriptom UNSEC0005
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_SCRIPTOM}"
SectionEnd
Section /o un.Griffon UNSEC0004
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GRIFFON}"
SectionEnd
Section /o un.Gant UNSEC0003
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GANT}"
SectionEnd
Section /o "un.Modify Variables" UNSEC0002
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_MODIFY_VARIABLES}"
SectionEnd
Section /o "un.Groovy Documentation" UNSEC0001
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GROOVY_DOCUMENTATION}"
SectionEnd
Section /o "un.Groovy Binaries" UNSEC0000
Delete /REBOOTOK $INSTDIR\${VERSION_TXT}
RmDir /r /REBOOTOK $INSTDIR
DeleteRegValue HKLM "${REGKEY}\Components" "${REG_GROOVY_BINARIES}"
SectionEnd
Section un.post UNSEC0999
DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
DeleteRegValue HKLM "${REGKEY}" Path
DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKLM "${REGKEY}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
Push $R0
StrCpy $R0 $StartMenuGroup 1
StrCmp $R0 ">" no_smgroup
no_smgroup:
Pop $R0
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
!insertmacro MUI_LANGDLL_DISPLAY
File /oname=$PLUGINSDIR\variables.ini variables.ini
File /oname=$PLUGINSDIR\fileassociation.ini fileassociation.ini
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION "Groovy Binaries" ${UNSEC0000}
!insertmacro SELECT_UNSECTION "Groovy Documentation" ${UNSEC0001}
!insertmacro SELECT_UNSECTION "Modify Variables" ${UNSEC0002}
!insertmacro SELECT_UNSECTION Gant ${UNSEC0003}
!insertmacro SELECT_UNSECTION Griffon ${UNSEC0004}
!insertmacro SELECT_UNSECTION Scriptom ${UNSEC0005}
!insertmacro SELECT_UNSECTION Gaelyk ${UNSEC0006}
!insertmacro SELECT_UNSECTION Spock ${UNSEC0007}
!insertmacro SELECT_UNSECTION Easyb ${UNSEC0008}
!insertmacro SELECT_UNSECTION GMock ${UNSEC0009}
!insertmacro SELECT_UNSECTION GroovyServ ${UNSEC0010}
!insertmacro SELECT_UNSECTION Grengine ${UNSEC0011}
!insertmacro SELECT_UNSECTION Shortcuts ${UNSEC0998}
FunctionEnd
#################################################################################################
### Environment
#################################################################################################
# VField 01
LangString VField01 ${LANG_ENGLISH} "Create GROOVY_HOME"
LangString VField01 ${LANG_GERMAN} "Erzeuge GROOVY_HOME"
LangString VField01 ${LANG_SPANISH} "Crear GROOVY_HOME"
LangString VField01 ${LANG_FRENCH} "Créer GROOVY_HOME"
LangString VField01 ${LANG_PortugueseBR} "Criar GROOVY_HOME"
# VField 02
LangString VField02 ${LANG_ENGLISH} "Add to Path"
LangString VField02 ${LANG_GERMAN} "Zum Pfad hinzufügen"
LangString VField02 ${LANG_SPANISH} "Agregar a la Ruta"
LangString VField02 ${LANG_FRENCH} "Ajouter au chemin d'accès/au Path"
LangString VField02 ${LANG_PortugueseBR} "Adicionar ao Path"
# VField 5
LangString VField05 ${LANG_ENGLISH} "If a reference to groovy is detected in the path, \
the checkbox for adding GROOVY_HOME to the path is unchecked. \
If you know better, please set the checkbox to checked.\r\n\r\n\
NB: The uninstaller won't restore old values (yet)."
LangString VField05 ${LANG_GERMAN} "Wenn eine Referenz zu groovy im Pfad entdeckt wird, \
wird die Checkbox für das Hinzufügen von GROOVY_HOME ausgeschaltet.\
Wenn Sie GROOVY_HOME trotzdem zum Pfad hinzufügen möchten, wählen Sie sie wieder an.\r\n\r\n\
Achtung: Der Uninstaller merkt sich keine alten Werte (noch nicht)."
LangString VField05 ${LANG_SPANISH} "Si alguna referencia a Groovy es detectada en la ruta, \
el botón para agregar GROOVY_HOME a la ruta aparecerá deseleccionado. \
Puede dejar el botón seleccionado si lo desea.\r\n\r\n\
NB: El proceso de desinstalación no restaurará valores anteriores."
LangString VField05 ${LANG_FRENCH} "Si une référence vers groovy \
est détectée dans le chemin d'accès, \
la boite à cocher d'ajout de GROOVY_HOME au chemin d'accès est décochée. \
Si vous êtes expert, cochez ici svp.\r\n\r\n\
NB: Le désinstalleur ne restaurera pas les anciennes valeurs (pas pour le moment)."
LangString VField05 ${LANG_PortugueseBR} "Se uma referência ao Groovy foi detectada, \
o checkbox para adicionar o GROOVY_HOME ao Path estará desmarcada. \
Se você preferir, por favor marque esse checkbox.\r\n\r\n\
NB: O desinstalador não irá restaurar os antigos valores (por enquanto)."
# VField 6
LangString VField06 ${LANG_ENGLISH} "User Environment or\r\nSystem Environment"
LangString VField06 ${LANG_GERMAN} "Benutzerumgebung oder\r\nSystemumgebung"
LangString VField06 ${LANG_SPANISH} "Entorno de Usuario o\r\nEntorno de Sistema"
LangString VField06 ${LANG_FRENCH} "Environnement utilisateur ou\r\nenvironnement système"
LangString VField06 ${LANG_PortugueseBR} "Apenas para esse usuário\r\nPara todos os usuários"
# VField 7
LangString VField07 ${LANG_ENGLISH} "Add to System Environment"
LangString VField07 ${LANG_GERMAN} "Systemumgebung wählen"
LangString VField07 ${LANG_SPANISH} "Agregar a Entorno de Sistema"
LangString VField07 ${LANG_FRENCH} "Ajouter à l'environnement système"
LangString VField07 ${LANG_PortugueseBR} "Adicionar às variáveis do sistema"
# VField 8
LangString VField08 ${LANG_ENGLISH} "Path to Groovy Home"
LangString VField08 ${LANG_GERMAN} "Pfad zu Groovy Home"
LangString VField08 ${LANG_SPANISH} "Ruta a Groovy Home"
LangString VField08 ${LANG_FRENCH} "Chemins d'accès au répertoire standard Groovy"
LangString VField08 ${LANG_PortugueseBR} "Caminho para o diretório raiz do Groovy"
# VField 9
LangString VField09 ${LANG_ENGLISH} "Path Extension"
LangString VField09 ${LANG_GERMAN} "Erweiterung des Pfades"
LangString VField09 ${LANG_SPANISH} "Extensión de Rutas"
LangString VField09 ${LANG_FRENCH} "Extension du chemin d'accès"
LangString VField09 ${LANG_PortugueseBR} "Extensão do Path"
# EnvironmentTitle
LangString EnvironmentTitle ${LANG_ENGLISH} "Environment ..."
LangString EnvironmentTitle ${LANG_GERMAN} "Umgebung ..."
LangString EnvironmentTitle ${LANG_SPANISH} "Entorno ..."
LangString EnvironmentTitle ${LANG_FRENCH} "Environnement ..."
LangString EnvironmentTitle ${LANG_PortugueseBR} "Variáveis ..."
# JavaHomeWarning
LangString JavaHomeWarning ${LANG_ENGLISH} "JAVA_HOME is not set. Please set it \
to your Java installation, otherwise Groovy won't be able to work."
LangString JavaHomeWarning ${LANG_GERMAN} "JAVA_HOME ist nicht gesetzt. \
Bitte setzen Sie die Umgebungsvariable, ansonsten kann Groovy nicht funktionieren."
LangString JavaHomeWarning ${LANG_SPANISH} "JAVA_HOME no está definido. Por favor defina la ruta \
hacia la instalación de Java, de lo contrario Groovy no podrá funcionar correctamente."
LangString JavaHomeWarning ${LANG_FRENCH} "JAVA_HOME n'est pas positionné sur le répertoire \
d'installation Java. Dans le cas contraire groovy ne fonctionnera pas."
LangString JavaHomeWarning ${LANG_PortugueseBR} "JAVA_HOME não está configurada. Por favor, configure \
para o diretório de instalação do Java, caso contrário o Groovy não funcionará."
#Additional Page for setting GROOVY_HOME and system path
Function ReadVariables
SectionGetFlags ${SecVariables} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} show
Abort
show:
Push $R0
# Localization
WriteINIStr $PLUGINSDIR\variables.ini "Field 1" "Text" $(VField01)
WriteINIStr $PLUGINSDIR\variables.ini "Field 2" "Text" $(VField02)
WriteINIStr $PLUGINSDIR\variables.ini "Field 5" "Text" $(VField05)
WriteINIStr $PLUGINSDIR\variables.ini "Field 6" "Text" $(VField06)
WriteINIStr $PLUGINSDIR\variables.ini "Field 7" "Text" $(VField07)
WriteINIStr $PLUGINSDIR\variables.ini "Field 8" "Text" $(VField08)
WriteINIStr $PLUGINSDIR\variables.ini "Field 9" "Text" $(VField09)
# Set value for GROOVY_HOME textfield
WriteINIStr $PLUGINSDIR\variables.ini "Field 3" "state" $INSTDIR
# Check for groovy in path
ReadEnvStr $R0 PATH
Push $R0
Push "roovy"
Call StrStr
Pop $R0
# set GROOVY_HOME checkbox to unchecked if groovy is in path
${If} $R0 != ''
WriteINIStr $PLUGINSDIR\variables.ini "Field 2" "state" "0"
${EndIf}
#InstallOptions::dialog $PLUGINSDIR\variables.ini
;If not using Modern UI use InstallOptions::dialog "iofile.ini"
!insertmacro MUI_HEADER_TEXT "$(EnvironmentTitle)" ""
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "variables.ini"
Pop $R0
FunctionEnd
Function SetVariables
Push $R0
# default is current
StrCpy $UserOrSystem "current"
# If set, then the system environment is used
ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 7" "State"
${If} $R0 == '1'
StrCpy $UserOrSystem "all"
${Else}
StrCpy $UserOrSystem "current"
${EndIf}
# Set GROOVY_HOME if the user checked the resp. checkbox
ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 1" "State"
${If} $R0 == '1'
ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 3" "State"
GetFullPathName /SHORT $0 $R0
Push "GROOVY_HOME"
Push $0
Call WriteEnvStr
${EndIf}
# Set PATH if the user checked the resp. checkbox
ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 2" "State"
${If} $R0 == '1'
# Variable PATH and Mode Append
Push "PATH"
Push "A"
# "HKLM" = the "all users" section of the registry
# "HKCU" = the "current user" section
StrCmp $UserOrSystem "current" NT_current
Push "HKLM"
Goto NT_resume
NT_current:
Push "HKCU"
NT_resume:
ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 4" "State"
Push $R0
Call EnvVarUpdate
Pop $0
${EndIf}
# Finally, check for JAVA_HOME existence
ReadEnvStr $R0 JAVA_HOME
${If} $R0 == ""
MessageBox MB_ICONEXCLAMATION|MB_OK $(JavaHomeWarning)
${EndIf}
Pop $R0
FunctionEnd
#################################################################################################
### File Associations
#################################################################################################
# FAField 01
LangString FAField01 ${LANG_ENGLISH} "File Association allows us to define \
a program (in our case groovy) to execute upon \
double click on a file. This means that you can \
execute your groovy programs directly from the explorer.\
You need the native launcher for this.\
\r\n\r\nAn added benefit is that the groovy \
icon is associated with groovy files."
LangString FAField01 ${LANG_GERMAN} "Dateiassoziation erlaubt es uns, ein \
Programm zu bestimmen (in unserem Fall Groovy), \
das automatisch beim Start einer Groovy-Datei \
ausgeführt wird. Sie können also mit Doppelklick \
im Explorer Ihre Groovy-Programme starten.\
Sie benötigen den 'Native Launcher' hierfür.\
\r\n\r\nZusätzlich wird das Groovy Icon mit \
Groovy-Dateien assoziiert."
LangString FAField01 ${LANG_SPANISH} "Asociación de Ficheros permite definir que \
un programa (en este caso Groovy) se ejecute al realizar \
doble click con el puntero sobre un fichero. Esto significa \
que usted podrá ejecutar programas Groovy directamente desde el Explorador de Windows. \
Para ello se requiere entonces del Lanzador Nativo.\
\r\nComo beneficio adicional habrá un ícono Groovy asociado a \
ficheros de tipo Groovy."
LangString FAField01 ${LANG_FRENCH} "L'association fichier vous permet de définir \
un programme (dans notre cas groovy) pour exécuter un fichier groovy \
par simple double-click sur ce dernier. Ceci signifie que vous pouvez \
exécuter vos programmes groovy directement à partir d'un explorateur windows. \
Vous avez besoin du lanceur natif pour cela. \
\r\nUn bénéfice supplémentaire est que l'icone \
groovy est associée à tout fichier de type groovy."
LangString FAField01 ${LANG_PortugueseBR} "Associação de arquivos nos permite definir \
um programa (no caso groovy) que executa com \
um duplo clique no arquivo. Isso significa que você pode \
executar seus programas escritos em Groovy diretamente do explorer. \
Você precisa do Native Launcher para isso.\
\r\n\r\nUm benefício adicional é que o icone do Groovy \
será associado aos arquivos .groovy."
# FAField 02
LangString FAField02 ${LANG_ENGLISH} "Add File Association"
LangString FAField02 ${LANG_GERMAN} "Füge Dateiassoziation hinzu"
LangString FAField02 ${LANG_SPANISH} "Agregar Asociación de Ficheros"
LangString FAField02 ${LANG_FRENCH} "Ajouter une association fichier"
LangString FAField02 ${LANG_PortugueseBR} "Adicionar associação de arquivos"
# FAField 03
LangString FAField03 ${LANG_ENGLISH} "PATHEXT is an environment variable telling cmd.exe \
which files are executable. If Groovy-Files are already referenced, this checkbox \
is unchecked. If you know better, please set the checkbox to checked."
LangString FAField03 ${LANG_GERMAN} "PATHEXT ist eine Umgebungsvariable, die cmd.exe \
mitteilt, welche Dateien ausführbar sind. Wenn Groovy-Dateien schon referenziert \
sind, ist die Checkbox nicht ausgewählt. \
Wenn Sie Groovy trotzdem hinzufügen wollen, wählen Sie sie wieder an."
LangString FAField03 ${LANG_SPANISH} "PATHEXT es una variable de entorno que le indica \
a cmd.exe cuales ficheros son de tipo ejecutable. Si Groovy-Files ya esta referenciado, \
este botón aparecerá deseleccionado. Puede dejar el botón seleccionado si lo \
desea."
LangString FAField03 ${LANG_FRENCH} "PATHEXT est une variable d'environnement indiquant \
à la commande cmd.exe \
quels fichiers sont des exécutables. Si les fichiers groovy sont déjà référencés, \
la boite à cocher est décochée. Si vous êtes expert, cochez ici svp."
LangString FAField03 ${LANG_PortugueseBR} "PATHEXT é uma variável de ambiente que indica ao cmd.exe \
quais arquivos são executáveis. Se os arquivos Groovy já estão referenciados, este checkbox \
estará desmarcado. Se você preferir, por favor marque esse checkbox."
# FAField 04
LangString FAField04 ${LANG_ENGLISH} "Add to PATHEXT"
LangString FAField04 ${LANG_GERMAN} "Füge zu PATHEXT hinzu"
LangString FAField04 ${LANG_SPANISH} "Agregar a PATHEXT"
LangString FAField04 ${LANG_FRENCH} "Ajouter à PATHEXT"
LangString FAField04 ${LANG_PortugueseBR} "Adicionar ao PATHEXT"
# AssocTitle
LangString AssocTitle ${LANG_ENGLISH} "File Associations ..."
LangString AssocTitle ${LANG_GERMAN} "Dateiassoziationen ..."
LangString AssocTitle ${LANG_SPANISH} "Asociación de Ficheros ..."
LangString AssocTitle ${LANG_FRENCH} "Association de fichiers ..."
LangString AssocTitle ${LANG_PortugueseBR} "Associação de arquivos ..."
Function ReadFileAssociation
SectionGetFlags ${SecVariables} $R0
IntOp $R0 $R0 & ${SF_SELECTED}
IntCmp $R0 ${SF_SELECTED} show
Abort
show:
Push $R0
# Localization
#MessageBox MB_ICONEXCLAMATION|MB_OK "Result. $(Field10)"
WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 1" "Text" $(FAField01)
WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 2" "Text" $(FAField02)
WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 3" "Text" $(FAField03)
WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 4" "Text" $(FAField04)
# Check for groovy in pathext
ReadEnvStr $R0 "PATHEXT"
Push $R0
Push ".groovy"
Call StrStr
Pop $R0
# set Pathext checkbox to unchecked if .groovy is already in Pathext
${If} $R0 != ''
WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 4" "state" "0"
${EndIf}
#InstallOptions::dialog $PLUGINSDIR\fileassociation.ini
;If not using Modern UI use InstallOptions::dialog "iofile.ini"
!insertmacro MUI_HEADER_TEXT "$(AssocTitle)" ""
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "fileassociation.ini"
Pop $R0
FunctionEnd
Function SetFileAssociation
Push $R0
# If set, then create file association
ReadINIStr $R0 "$PLUGINSDIR\fileassociation.ini" "Field 2" "State"
${If} $R0 == '1'
# set file associations
!define Index "Line${__LINE__}"
ReadRegStr $1 HKCR ".groovy" ""
StrCmp $1 "" "${Index}-NoBackup"
StrCmp $1 "Groovy" "${Index}-NoBackup"
WriteRegStr HKCR ".groovy" "backup_val" $1
"${Index}-NoBackup:"
WriteRegStr HKCR ".groovy" "" "Groovy"
ReadRegStr $0 HKCR "Groovy" ""
StrCmp $0 "" 0 "${Index}-Skip"
WriteRegStr HKCR "Groovy" "" "Groovy.groovy"
WriteRegStr HKCR "Groovy\shell" "" "open"
WriteRegStr HKCR "Groovy\DefaultIcon" "" '"$INSTDIR\bin\groovy.exe",0'
"${Index}-Skip:"
WriteRegStr HKCR "Groovy\shell\open\command" "" '"$INSTDIR\bin\groovy.exe" "%1" %*'
#WriteRegStr HKCR "Groovy\shell\edit" "" "Edit Options File"
#WriteRegStr HKCR "Groovy\shell\edit\command" "" '$INSTDIR\execute.exe "%1"'
System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
!undef Index
${EndIf}
# Set PATHEXT if the user checked the resp. checkbox
ReadINIStr $R0 "$PLUGINSDIR\fileassociation.ini" "Field 4" "State"
${If} $R0 == '1'
ReadEnvStr $R0 "PATHEXT"
StrCpy $R0 "$R0;.groovy;.gy"
Push "PATHEXT"
Push $R0
Call WriteEnvStr
${EndIf}
Pop $R0
FunctionEnd
!macro IsNT UN
Function ${UN}IsNT
Push $0
ReadRegStr $0 HKLM \
"SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
StrCmp $0 "" 0 IsNT_yes
; we are not NT.
Pop $0
Push 0
Return
IsNT_yes:
; NT!!!
Pop $0
Push 1
FunctionEnd
!macroend
!insertmacro IsNT ""
!insertmacro IsNT "un."
#
# WriteEnvStr - Writes an environment variable
# Note: Win9x systems requires reboot
#
# Example:
# Push "HOMEDIR" # name
# Push "C:\New Home Dir\" # value
# Call WriteEnvStr
#
Function WriteEnvStr
Exch $1 ; $1 has environment variable value
Exch
Exch $0 ; $0 has environment variable name
Push $2
Call IsNT
Pop $2
StrCmp $2 1 WriteEnvStr_NT
; Not on NT
StrCpy $2 $WINDIR 2 ; Copy drive of windows (c:)
FileOpen $2 "$2\autoexec.bat" a
FileSeek $2 0 END
FileWrite $2 "$\r$\nSET $0=$1$\r$\n"
FileClose $2
SetRebootFlag true
Goto WriteEnvStr_done
WriteEnvStr_NT:
${If} $UserOrSystem == "all"
ClearErrors