Skip to content
Browse files

Last version for 1.1 Beta2 (native installer, gant, scriptom)

git-svn-id: http://svn.codehaus.org/groovy/tags/GROOVY_1_1_BETA_2@8213 a5544e8c-8a19-0410-ba12-f9af4593a198
  • Loading branch information...
1 parent 1c610d9 commit 4d58e8b62050b60d5d8edf9bcdc524ccf6673e86 @jbaumann jbaumann committed Sep 23, 2007
View
17 groovy/modules/installers/windows/NSIS-Groovy/.project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>NSIS-Groovy</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>net.sf.eclipsensis.installoptions.InstallOptionsBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>net.sf.eclipsensis.installoptions.InstallOptionsNature</nature>
+ </natures>
+</projectDescription>
View
28 groovy/modules/installers/windows/NSIS-Groovy/Groovy-1.0.launch
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="net.sf.eclipsensis.launch.nsisLaunchConfigType">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/NSIS-Groovy/setup.nsi"/>
+</listAttribute>
+<booleanAttribute key="noCD" value="false"/>
+<listAttribute key="instructions"/>
+<booleanAttribute key="noConfig" value="false"/>
+<booleanAttribute key="runInstaller" value="false"/>
+<stringAttribute key="script" value="${workspace_loc:/NSIS-Groovy/setup.nsi}"/>
+<booleanAttribute key="hdrInfo" value="false"/>
+<intAttribute key="processPriority" value="-1"/>
+<listAttribute key="symbols">
+<listEntry value="SOURCE_DIR­D:\NSIS\NSIS-Groovy\Data\1.0\groovy-1.0"/>
+<listEntry value="SOURCE_VERSION­1.0"/>
+<listEntry value="NATIVE_DIR­D:\NSIS\NSIS-Groovy\Data\native"/>
+<listEntry value="SCRIPTOM_DIR­D:\NSIS\NSIS-Groovy\Data\Scriptom-1.2"/>
+<listEntry value="GANT_DIR­D:\NSIS\NSIS-Groovy\Data\1.0\gant-0.3.1_groovy-1.0"/>
+</listAttribute>
+<booleanAttribute key="solidCompression" value="false"/>
+<stringAttribute key="pluginVersion" value="0.9.5.1"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<intAttribute key="compressor" value="0"/>
+<booleanAttribute key="license" value="false"/>
+<intAttribute key="verbosity" value="-1"/>
+</launchConfiguration>
View
28 groovy/modules/installers/windows/NSIS-Groovy/Groovy-1.1-Beta2.launch
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="net.sf.eclipsensis.launch.nsisLaunchConfigType">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/NSIS-Groovy/setup.nsi"/>
+</listAttribute>
+<booleanAttribute key="noCD" value="false"/>
+<listAttribute key="instructions"/>
+<booleanAttribute key="noConfig" value="false"/>
+<booleanAttribute key="runInstaller" value="false"/>
+<stringAttribute key="script" value="${workspace_loc:/NSIS-Groovy/setup.nsi}"/>
+<booleanAttribute key="hdrInfo" value="false"/>
+<intAttribute key="processPriority" value="-1"/>
+<listAttribute key="symbols">
+<listEntry value="SOURCE_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\groovy-1.1-BETA-2"/>
+<listEntry value="SOURCE_VERSION­1.1-Beta2"/>
+<listEntry value="NATIVE_DIR­D:\NSIS\NSIS-Groovy\Data\native"/>
+<listEntry value="SCRIPTOM_DIR­D:\NSIS\NSIS-Groovy\Data\Scriptom-1.2"/>
+<listEntry value="GANT_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\gant-0.3.1_head"/>
+</listAttribute>
+<booleanAttribute key="solidCompression" value="false"/>
+<stringAttribute key="pluginVersion" value="0.9.5.1"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<intAttribute key="compressor" value="0"/>
+<booleanAttribute key="license" value="false"/>
+<intAttribute key="verbosity" value="-1"/>
+</launchConfiguration>
View
28 groovy/modules/installers/windows/NSIS-Groovy/Groovy-1.1-Beta3.launch
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="net.sf.eclipsensis.launch.nsisLaunchConfigType">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/NSIS-Groovy/setup.nsi"/>
+</listAttribute>
+<booleanAttribute key="noCD" value="false"/>
+<listAttribute key="instructions"/>
+<booleanAttribute key="noConfig" value="false"/>
+<booleanAttribute key="runInstaller" value="false"/>
+<stringAttribute key="script" value="${workspace_loc:/NSIS-Groovy/setup.nsi}"/>
+<booleanAttribute key="hdrInfo" value="false"/>
+<intAttribute key="processPriority" value="-1"/>
+<listAttribute key="symbols">
+<listEntry value="SOURCE_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\groovy-1.1-BETA-2"/>
+<listEntry value="SOURCE_VERSION­1.1-Beta3"/>
+<listEntry value="NATIVE_DIR­D:\NSIS\NSIS-Groovy\Data\native"/>
+<listEntry value="SCRIPTOM_DIR­D:\NSIS\NSIS-Groovy\Data\Scriptom-1.2"/>
+<listEntry value="GANT_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\gant-0.3.1_head"/>
+</listAttribute>
+<booleanAttribute key="solidCompression" value="false"/>
+<stringAttribute key="pluginVersion" value="0.9.5.1"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<intAttribute key="compressor" value="0"/>
+<booleanAttribute key="license" value="false"/>
+<intAttribute key="verbosity" value="-1"/>
+</launchConfiguration>
View
37 groovy/modules/installers/windows/NSIS-Groovy/ReadmeFirst.txt
@@ -0,0 +1,37 @@
+NSIS Groovy
+-----------
+
+This directory contains the NSIS installer for Groovy as a project for Eclipse.
+
+To use it, simply check it out into an Eclipse workspace. Additionally you might
+want to install the NSISEclipse-Plugin, it helps when developing NSIS stuff.
+
+If you have worked with NSIS-scripts already there should be no big problem understanding
+what is done.
+
+The main script is the file setup.nsi, where you can find the installer program.
+Three additional pages are defined, Variables, NativeLauncher and FileAssociation,
+and for each you can find the respective .ini file containing the screen placement.
+Simply open them in the design editor provided by the Eclipse-Plugin, and you can
+see what they look like.
+
+Two bmp-images contain the Groovy logo in different resolutions, one for the welcome
+page and one as header image for the other pages. The name is the game ...
+
+F�nally you have the launch scripts. These actually start the compiler with different
+settings for the groovy version, the groovy location (on your hard disk) and the
+location of the native launcher. The groovy version influences the final name of the
+installer.
+
+The launch scripts are setting the following variables:
+
+SOURCE_VERSION defines the version of the release
+SOURCE_DIR is the full path to the groovy install directory
+NATIVE_DIR is the full path to the native launcher
+
+
+Most probably you only have to set these variables and you are happy to go.
+
+Have fun, Joachim
+
+Contact: joachim.baumann@xinaris.de
View
31 groovy/modules/installers/windows/NSIS-Groovy/additionalpackages.ini
@@ -0,0 +1,31 @@
+; Auto-generated by EclipseNSIS InstallOptions Script Wizard
+; 28.07.2007 22:00:24
+[Settings]
+NumFields=3
+Title=Additional Modules
+
+[Field 1]
+Type=Label
+Left=15
+Top=15
+Right=284
+Bottom=52
+Text=Additional Modules are not necessary, but we recommend installing them anyway.
+
+[Field 2]
+Type=CheckBox
+Left=15
+Top=52
+Right=284
+Bottom=62
+Text=Gant - a build tool for scripting Ant tasks with Groovy
+State=1
+
+[Field 3]
+Type=CheckBox
+Left=15
+Top=71
+Right=284
+Bottom=81
+Text=Scriptom - script ActiveX or COM components with Groovy
+State=1
View
39 groovy/modules/installers/windows/NSIS-Groovy/fileassociation.ini
@@ -0,0 +1,39 @@
+; Auto-generated by EclipseNSIS InstallOptions Script Wizard
+; 26.07.2007 13:42:05
+[Settings]
+NumFields=4
+Title=File Associations
+
+[Field 1]
+Type=Label
+Left=50
+Top=1
+Right=249
+Bottom=70
+Text=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.\r\n\r\nAn added benefit is that the groovy icon is associated with groovy files.
+
+[Field 2]
+Type=CheckBox
+Left=50
+Top=70
+Right=249
+Bottom=80
+Text=Add File Association
+State=1
+
+[Field 3]
+Type=Label
+Left=50
+Top=90
+Right=249
+Bottom=130
+Text=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.
+
+[Field 4]
+Type=CheckBox
+Left=50
+Top=130
+Right=249
+Bottom=140
+Text=Add to PATHEXT
+State=1
View
BIN groovy/modules/installers/windows/NSIS-Groovy/header.bmp
Binary file not shown.
View
22 groovy/modules/installers/windows/NSIS-Groovy/nativelauncher.ini
@@ -0,0 +1,22 @@
+; Auto-generated by EclipseNSIS InstallOptions Script Wizard
+; 26.07.2007 12:57:18
+[Settings]
+NumFields=2
+Title=Native Launcher
+
+[Field 1]
+Type=Label
+Left=50
+Top=20
+Right=249
+Bottom=89
+Text=The Native Launcher is an executable, that in most cases is preferrable to the normal launching scripts. If you want file associations, than you have to install the native launcher.\r\n\r\nIf you don't know what this is about, then leave the checkbox in the checked state.
+
+[Field 2]
+Type=CheckBox
+Left=50
+Top=102
+Right=249
+Bottom=112
+Text=Install Native Launcher
+State=1
View
950 groovy/modules/installers/windows/NSIS-Groovy/setup.nsi
@@ -0,0 +1,950 @@
+# We assume the following commandline parameters for the compilation
+# SOURCE_VERSION defines the version of the release
+# SOURCE_DIR is the full path to the groovy install directory
+# NATIVE_DIR is the full path to the native launcher
+# SCRIPTOM_DIR is the full path to the scriptom module
+# GANT_DIR is the full path to the gant module
+
+Name Groovy
+
+!define InstallerVersion 0.4
+
+# Set the compression level
+SetCompressor /SOLID lzma
+
+# The source of the Groovy installation
+!define SOURCEDIR ${SOURCE_DIR}
+
+# Defines
+!define REGKEY "SOFTWARE\$(^Name)"
+!define VERSION ${SOURCE_VERSION}
+!define COMPANY ""
+!define URL groovy.codehaus.org
+
+# MUI defines
+!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
+!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 Groovy
+!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
+!define MUI_LANGDLL_REGISTRY_ROOT HKLM
+!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
+!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
+!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
+
+# Included files
+!include Sections.nsh
+!include MUI.nsh
+!include logiclib.nsh
+!include WinMessages.NSH
+
+
+# Reserved Files
+!insertmacro MUI_RESERVEFILE_LANGDLL
+
+# 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 "current"
+
+
+
+# Installer pages
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
+!insertmacro MUI_PAGE_INSTFILES
+Page custom ReadVariables SetVariables
+Page custom ReadNativeLauncher InstallNativeLauncher
+Page custom ReadAdditionalPackages InstallAdditionalPackages
+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
+
+# Installer attributes
+OutFile "groovy${SOURCE_VERSION}-installer.exe"
+InstallDir $PROGRAMFILES\Groovy
+CRCCheck on
+XPStyle on
+ShowInstDetails show
+VIProductVersion 1.1.0.0
+VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName Groovy
+VIAddVersionKey ProductVersion "${VERSION}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion ""
+VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription ""
+VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright ""
+InstallDirRegKey HKLM "${REGKEY}" Path
+ShowUninstDetails show
+
+# Installer sections
+Section -Main SEC0000
+ SetOutPath $INSTDIR
+ SetOverwrite on
+ File /r ${SOURCEDIR}\*
+ WriteRegStr HKLM "${REGKEY}\Components" Main 1
+SectionEnd
+
+Section -post SEC0001
+ 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}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
+ 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
+
+# Uninstaller sections
+Section /o un.Main UNSEC0000
+ RmDir /r /REBOOTOK $INSTDIR
+ DeleteRegValue HKLM "${REGKEY}\Components" Main
+SectionEnd
+
+Section un.post UNSEC0001
+ 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
+
+!define RUSSELOPTION "Russel-option detected: Now reformatting the disc. \
+Press ok to install Ubuntu and Groovy as an Ubuntu package."
+
+# Installer functions
+Function .onInit
+ InitPluginsDir
+ !insertmacro MUI_LANGDLL_DISPLAY
+ File /oname=$PLUGINSDIR\variables.ini variables.ini
+ File /oname=$PLUGINSDIR\nativelauncher.ini nativelauncher.ini
+ File /oname=$PLUGINSDIR\fileassociation.ini fileassociation.ini
+ File /oname=$PLUGINSDIR\additionalpackages.ini additionalpackages.ini
+
+ Push $CMDLINE
+ Push "-russel"
+ Call StrStr
+ Pop $R0
+
+ ${If} $R0 != '-1'
+ MessageBox MB_ICONEXCLAMATION|MB_OK "${RUSSELOPTION}"
+ ${EndIf}
+
+FunctionEnd
+
+
+# Uninstaller functions
+Function un.onInit
+ ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
+ !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
+ !insertmacro MUI_UNGETLANGUAGE
+ !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
+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"
+
+# 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"
+
+# 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)."
+
+# 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"
+
+# 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"
+
+# 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"
+
+# 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"
+
+# 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."
+
+
+#Additional Page for setting GROOVY_HOME and system path
+Function ReadVariables
+ 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 "Groovy" # seems to be case-insensitive
+ Call StrStr
+ Pop $R0
+
+ # set GROOVY_HOME checkbox to unchecked if groovy is in path
+ ${If} $R0 != '-1'
+ WriteINIStr $PLUGINSDIR\variables.ini "Field 2" "state" "0"
+ ${EndIf}
+
+ InstallOptions::dialog $PLUGINSDIR\variables.ini
+
+ Pop $R0
+FunctionEnd
+
+Function SetVariables
+ Push $R0
+
+ # If set, then the system environment is used
+ ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 7" "State"
+ ${If} $R0 == '1'
+ # default is current
+ 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"
+ Push "GROOVY_HOME"
+ Push $R0
+ Call WriteEnvStr
+ ${EndIf}
+
+ # Set PATH if the user checked the resp. checkbox
+ ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 2" "State"
+ ${If} $R0 == '1'
+ ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 4" "State"
+ Push $R0
+ Call AddToPath
+ ${EndIf}
+
+ # Finally, check for JAVA_HOME existence
+ ReadEnvStr $R0 JAVA_HOME
+ ${If} $R0 == ""
+ MessageBox MB_ICONEXCLAMATION|MB_OK $(JavaHomeWarning)
+ ${EndIf}
+
+ Pop $R0
+
+FunctionEnd
+
+#################################################################################################
+
+### Native Launcher
+
+#################################################################################################
+
+# NLField 01
+LangString NLField01 ${LANG_ENGLISH} "The Native Launcher is an executable, that \
+in most cases is preferrable to the normal \
+launching scripts. If you want file associations, \
+than you have to install the native launcher.\
+\r\n\r\nIf you don't know what this is about, \
+then leave the checkbox in the checked state."
+LangString NLField01 ${LANG_GERMAN} "Der 'Native Launcher' ist ein ausführbares \
+Programm, das den Start-Skripten in den meisten \
+Fällen überlegen ist. Wenn Sie Datei-Assoziationen \
+verwenden wollen, müssen sie den 'Native Launcher' \
+installieren.\r\n\r\n\
+Wenn Sie nicht wissen, was das bedeutet, \
+lassen Sie die Checkbox angehakt."
+LangString NLField01 ${LANG_SPANISH} "El Lanzador Nativo es una aplicación ejecutable, que \
+en la mayoría de los casos es preferible a los ficheros de \
+inicio tipo script. Si desea tener asociaciones a ficheros, \
+entonces deberá instalar el Lanzador Nativo. \
+\r\n\r\nSi no tiene conocimiento de lo anterior, entonces por favor \
+deje el botón en estado seleccionado."
+LangString NLField01 ${LANG_FRENCH} "Le lanceur natif est un executable qui \
+dans la majeure partie des cas est bien préférable à \
+un lancement par scripts. Si vous voulez une association fichier, \
+il est nécessaire d'utiliser le lanceur natif.\
+\r\n\r\nSi vous ne savez pas de quoi il s'agit, alors laissez \
+la boite à cocher dans l'état coché."
+
+# NLField 02
+LangString NLField02 ${LANG_ENGLISH} "Install Native Launcher"
+LangString NLField02 ${LANG_GERMAN} "Installiere Native Launcher"
+LangString NLField02 ${LANG_SPANISH} "Instalar el Lanzador Nativo"
+LangString NLField02 ${LANG_FRENCH} "Installer le lanceur natif"
+
+Function ReadNativeLauncher
+ Push $R0
+
+ # Localization
+ #MessageBox MB_ICONEXCLAMATION|MB_OK "Result. $(Field10)"
+ WriteINIStr $PLUGINSDIR\nativelauncher.ini "Field 1" "Text" $(NLField01)
+ WriteINIStr $PLUGINSDIR\nativelauncher.ini "Field 2" "Text" $(NLField02)
+
+ InstallOptions::dialog $PLUGINSDIR\nativelauncher.ini
+
+ Pop $R0
+FunctionEnd
+
+Function InstallNativeLauncher
+ Push $R0
+
+ # If set, then install the native launcher
+ ReadINIStr $R0 "$PLUGINSDIR\nativelauncher.ini" "Field 2" "State"
+ ${If} $R0 == '1'
+ SetOutPath $INSTDIR\bin
+ File /r ${NATIVE_DIR}\*
+ ${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\n\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\n\r\nUn bénéfice supplémentaire est que l'icone \
+groovy est associée à tout fichier de type 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"
+
+# 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."
+
+# 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"
+
+Function ReadFileAssociation
+ 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 path
+ ReadEnvStr $R0 "PATHEXT"
+ Push $R0
+ Push ".groovy" # seems to be case-insensitive
+ Call StrStr
+ Pop $R0
+
+ # set GROOVY_HOME checkbox to unchecked if groovy is in path
+ ${If} $R0 != '-1'
+ WriteINIStr $PLUGINSDIR\variables.ini "Field 4" "state" "0"
+ ${EndIf}
+
+ InstallOptions::dialog $PLUGINSDIR\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
+
+
+
+#################################################################################################
+
+### Additional Packages
+
+#################################################################################################
+
+# APField 01
+LangString APField01 ${LANG_ENGLISH} "Additional Modules are not strictly necessary, \
+but we recommend installing them anyway."
+LangString APField01 ${LANG_GERMAN} "Zusätzliche Module sind nicht unbedingt notwendig, \
+wir empfehlen aber, sie trotzdem zu installieren."
+LangString APField01 ${LANG_SPANISH} "Los Módulos Adicionales no son estrictamente \
+necesarios, pero recomendamos que se instalen de todas formas."
+LangString APField01 ${LANG_FRENCH} "Les Modules aditionnels sont optionnels, \
+nous vous recommendons cependant de les installer"
+
+# APField 02
+LangString APField02 ${LANG_ENGLISH} "Gant - a build tool for scripting Ant tasks \
+with Groovy"
+LangString APField02 ${LANG_GERMAN} "Gant - Ein Werkzeug, um Ant Tasks mit Groovy \
+zu programmieren"
+LangString APField02 ${LANG_SPANISH} "Gant - una herramienta que facilita el \
+'scripting' the tareas de Ant con Groovy"
+LangString APField02 ${LANG_FRENCH} "Gant - Outil de build permettant de manipuler \
+les tâches Ant avec Groovy"
+
+# APField 03
+LangString APField03 ${LANG_ENGLISH} "Scriptom - script ActiveX or COM components \
+with Groovy"
+LangString APField03 ${LANG_GERMAN} "Scriptom - Programmieren von ActiveX und COM-\
+Komponenten mit Groovy"
+LangString APField03 ${LANG_SPANISH} "Scriptom - permite acceder y configurar \
+components ActiveX y/o COM con Groovy"
+LangString APField03 ${LANG_FRENCH} "Scriptom - Manipulation d'ActiveX ou composants \
+COM avec Groovy"
+
+
+Function ReadAdditionalPackages
+ Push $R0
+
+ # Localization
+ WriteINIStr $PLUGINSDIR\additionalpackages.ini "Field 1" "Text" $(APField01)
+ WriteINIStr $PLUGINSDIR\additionalpackages.ini "Field 2" "Text" $(APField02)
+ WriteINIStr $PLUGINSDIR\additionalpackages.ini "Field 3" "Text" $(APField03)
+
+ InstallOptions::dialog $PLUGINSDIR\additionalpackages.ini
+
+ Pop $R0
+FunctionEnd
+
+Function InstallAdditionalPackages
+ Push $R0
+
+ # If set, then install Gant
+ ReadINIStr $R0 "$PLUGINSDIR\additionalpackages.ini" "Field 2" "State"
+ ${If} $R0 == '1'
+ SetOutPath $INSTDIR\bin
+ File /r ${GANT_DIR}\bin\gant*
+
+ SetOutPath $INSTDIR\lib
+ File /r ${GANT_DIR}\lib\gant*.jar
+ File /nonfatal /r ${GANT_DIR}\lib\ivy*.jar
+ File /nonfatal /r ${GANT_DIR}\lib\maven*.jar
+ ${EndIf}
+
+ # If set, then install Scriptom
+ ReadINIStr $R0 "$PLUGINSDIR\additionalpackages.ini" "Field 3" "State"
+ ${If} $R0 == '1'
+ SetOutPath $INSTDIR
+ File /r ${SCRIPTOM_DIR}\*
+ ${EndIf}
+
+ Pop $R0
+
+FunctionEnd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Installer Language Strings
+# TODO Update the Language Strings with the appropriate translations.
+
+LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
+LangString ^UninstallLink ${LANG_GERMAN} "Uninstall $(^Name)"
+LangString ^UninstallLink ${LANG_SPANISH} "Uninstall $(^Name)"
+LangString ^UninstallLink ${LANG_FRENCH} "Uninstall $(^Name)"
+
+
+;====================================================
+; get_NT_environment
+; Returns: the selected environment
+; Output : head of the stack
+;====================================================
+!macro select_NT_profile UN
+Function ${UN}select_NT_profile
+ MessageBox MB_YESNO|MB_ICONQUESTION "Change the environment for all users?$\r$\nSaying no here will change the envrironment for the current user only.$\r$\n(Administrator permissions required for all users)" \
+ IDNO environment_single
+ DetailPrint "Selected environment for all users"
+ Push "all"
+ Return
+ environment_single:
+ DetailPrint "Selected environment for current user only."
+ Push "current"
+ Return
+FunctionEnd
+!macroend
+!insertmacro select_NT_profile ""
+!insertmacro select_NT_profile "un."
+
+;====================================================
+; StrStr - Finds a given string in another given string.
+; Returns -1 if not found and the pos if found.
+; Input: head of the stack - string to find
+; second in the stack - string to find in
+; Output: head of the stack
+;====================================================
+!macro StrStr UN
+Function ${UN}StrStr
+ Push $0
+ Exch
+ Pop $0 ; $0 now have the string to find
+ Push $1
+ Exch 2
+ Pop $1 ; $1 now have the string to find in
+ Exch
+ Push $2
+ Push $3
+ Push $4
+ Push $5
+
+ StrCpy $2 -1
+ StrLen $3 $0
+ StrLen $4 $1
+ IntOp $4 $4 - $3
+
+ ${UN}StrStr_loop:
+ IntOp $2 $2 + 1
+ IntCmp $2 $4 0 0 ${UN}StrStrReturn_notFound
+ StrCpy $5 $1 $3 $2
+ StrCmp $5 $0 ${UN}StrStr_done ${UN}StrStr_loop
+
+ ${UN}StrStrReturn_notFound:
+ StrCpy $2 -1
+
+ ${UN}StrStr_done:
+ Pop $5
+ Pop $4
+ Pop $3
+ Exch $2
+ Exch 2
+ Pop $0
+ Pop $1
+FunctionEnd
+!macroend
+!insertmacro StrStr ""
+!insertmacro StrStr "un."
+#
+# [un.]IsNT - Pushes 1 if running on NT, 0 if not
+#
+# Example:
+# Call IsNT
+# Pop $0
+# StrCmp $0 1 +3
+# MessageBox MB_OK "Not running on NT!"
+# Goto +2
+# MessageBox MB_OK "Running on NT!"
+#
+!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."
+
+;====================================================
+; AddToPath - Adds the given dir to the search path.
+; Input - head of the stack
+; Note - Win9x systems requires reboot
+;====================================================
+Function AddToPath
+ Exch $0
+ Push $1
+ Push $2
+
+ Call IsNT
+ Pop $1
+ StrCmp $1 1 AddToPath_NT
+ ; Not on NT
+ StrCpy $1 $WINDIR 2
+ FileOpen $1 "$1\autoexec.bat" a
+ FileSeek $1 0 END
+ GetFullPathName /SHORT $0 $0
+ FileWrite $1 "$\r$\nSET PATH=%PATH%;$0$\r$\n"
+ FileClose $1
+ Goto AddToPath_done
+
+ AddToPath_NT:
+
+ AddToPath_NT_selection_done:
+ StrCmp $UserOrSystem "current" read_path_NT_current
+ ReadRegStr $1 ${NT_all_env} "PATH"
+ Goto read_path_NT_resume
+ read_path_NT_current:
+ ReadRegStr $1 ${NT_current_env} "PATH"
+ read_path_NT_resume:
+ StrCpy $2 $0
+ StrCmp $1 "" AddToPath_NTdoIt
+ StrCpy $2 "$1;$0"
+ AddToPath_NTdoIt:
+ StrCmp $UserOrSystem "current" write_path_NT_current
+ ClearErrors
+ WriteRegExpandStr ${NT_all_env} "PATH" $2
+ IfErrors 0 write_path_NT_resume
+ MessageBox MB_YESNO|MB_ICONQUESTION "The path could not be set for all users$\r$\nShould I try for the current user?" \
+ IDNO write_path_NT_failed
+ ; change selection
+ StrCpy $4 "current"
+ Goto AddToPath_NT_selection_done
+ write_path_NT_current:
+ ClearErrors
+ WriteRegExpandStr ${NT_current_env} "PATH" $2
+ IfErrors 0 write_path_NT_resume
+ MessageBox MB_OK|MB_ICONINFORMATION "The path could not be set for the current user."
+ Goto write_path_NT_failed
+ write_path_NT_resume:
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+ DetailPrint "added path for user ($4), $0"
+ write_path_NT_failed:
+
+ Pop $4
+ AddToPath_done:
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+
+;====================================================
+; RemoveFromPath - Remove a given dir from the path
+; Input: head of the stack
+;====================================================
+Function un.RemoveFromPath
+ Exch $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+
+ Call un.IsNT
+ Pop $1
+ StrCmp $1 1 unRemoveFromPath_NT
+ ; Not on NT
+ StrCpy $1 $WINDIR 2
+ FileOpen $1 "$1\autoexec.bat" r
+ GetTempFileName $4
+ FileOpen $2 $4 w
+ GetFullPathName /SHORT $0 $0
+ StrCpy $0 "SET PATH=%PATH%;$0"
+ SetRebootFlag true
+ Goto unRemoveFromPath_dosLoop
+
+ unRemoveFromPath_dosLoop:
+ FileRead $1 $3
+ StrCmp $3 "$0$\r$\n" unRemoveFromPath_dosLoop
+ StrCmp $3 "$0$\n" unRemoveFromPath_dosLoop
+ StrCmp $3 "$0" unRemoveFromPath_dosLoop
+ StrCmp $3 "" unRemoveFromPath_dosLoopEnd
+ FileWrite $2 $3
+ Goto unRemoveFromPath_dosLoop
+
+ unRemoveFromPath_dosLoopEnd:
+ FileClose $2
+ FileClose $1
+ StrCpy $1 $WINDIR 2
+ Delete "$1\autoexec.bat"
+ CopyFiles /SILENT $4 "$1\autoexec.bat"
+ Delete $4
+ Goto unRemoveFromPath_done
+
+ unRemoveFromPath_NT:
+ StrLen $2 $0
+ Call un.select_NT_profile
+ Pop $4
+
+ StrCmp $4 "current" un_read_path_NT_current
+ ReadRegStr $1 ${NT_all_env} "PATH"
+ Goto un_read_path_NT_resume
+ un_read_path_NT_current:
+ ReadRegStr $1 ${NT_current_env} "PATH"
+ un_read_path_NT_resume:
+
+ Push $1
+ Push $0
+ Call un.StrStr ; Find $0 in $1
+ Pop $0 ; pos of our dir
+ IntCmp $0 -1 unRemoveFromPath_done
+ ; else, it is in path
+ StrCpy $3 $1 $0 ; $3 now has the part of the path before our dir
+ IntOp $2 $2 + $0 ; $2 now contains the pos after our dir in the path (';')
+ IntOp $2 $2 + 1 ; $2 now containts the pos after our dir and the semicolon.
+ StrLen $0 $1
+ StrCpy $1 $1 $0 $2
+ StrCpy $3 "$3$1"
+
+ StrCmp $4 "current" un_write_path_NT_current
+ WriteRegExpandStr ${NT_all_env} "PATH" $3
+ Goto un_write_path_NT_resume
+ un_write_path_NT_current:
+ WriteRegExpandStr ${NT_current_env} "PATH" $3
+ un_write_path_NT_resume:
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+ unRemoveFromPath_done:
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+FunctionEnd
+
+
+#
+# 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
+ WriteRegExpandStr ${NT_all_env} $0 $1
+
+ IfErrors 0 WriteEnvStr_all_resume
+ MessageBox MB_YESNO|MB_ICONQUESTION "The path could not be set for all users$\r$\nShould I try for the current user?" \
+ IDNO WriteEnvStr_all_failed
+ ; change selection
+ StrCpy $UserOrSystem "current"
+ WriteEnvStr_all_resume:
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+ DetailPrint "added variable $0 for user ($UserOrSystem), $1"
+ WriteEnvStr_all_failed:
+ ${EndIf}
+
+
+ ${If} $UserOrSystem == "current"
+ ClearErrors
+ WriteRegExpandStr ${NT_current_env} $0 $1
+
+ IfErrors 0 WriteEnvStr_current_resume
+ MessageBox MB_OK|MB_ICONINFORMATION "The path could not be set for the current user."
+ Goto WriteEnvStr_current_failed
+ WriteEnvStr_current_resume:
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+ DetailPrint "added variable $0 for user ($UserOrSystem), $1"
+ WriteEnvStr_current_failed:
+ ${EndIf}
+
+ WriteEnvStr_done:
+ Pop $2
+ Pop $0
+ Pop $1
+FunctionEnd
+
View
80 groovy/modules/installers/windows/NSIS-Groovy/variables.ini
@@ -0,0 +1,80 @@
+; Auto-generated by EclipseNSIS InstallOptions Script Wizard
+; 22.07.2007 14:47:09
+[Settings]
+NumFields=9
+Title=Environment Variables
+
+[Field 1]
+Type=CheckBox
+Left=29
+Top=76
+Right=128
+Bottom=90
+Text=Create GROOVY_HOME
+State=1
+
+[Field 2]
+Type=CheckBox
+Left=29
+Top=98
+Right=128
+Bottom=114
+Text=Add to Path
+State=1
+
+[Field 3]
+Type=Text
+Left=131
+Top=76
+Right=253
+Bottom=89
+State=
+
+[Field 4]
+Type=Text
+Left=131
+Top=100
+Right=253
+Bottom=113
+State=%GROOVY_HOME%\bin
+
+[Field 5]
+Type=Label
+Left=29
+Top=0
+Right=250
+Bottom=49
+Text=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\nNB: The uninstaller won't restore old values (yet).
+
+[Field 7]
+Type=CheckBox
+Left=29
+Top=118
+Right=128
+Bottom=134
+Text=Add to System Env.
+State=0
+
+[Field 8]
+Type=Label
+Left=131
+Top=68
+Right=253
+Bottom=77
+Text=Path to Groovy Home
+
+[Field 9]
+Type=Label
+Left=131
+Top=92
+Right=253
+Bottom=101
+Text=Path Extension\r\n
+
+[Field 6]
+Type=Label
+Left=131
+Top=118
+Right=255
+Bottom=138
+Text=User Environment or\r\nSystem Environment
View
BIN groovy/modules/installers/windows/NSIS-Groovy/welcome.bmp
Binary file not shown.

0 comments on commit 4d58e8b

Please sign in to comment.
Something went wrong with that request. Please try again.