Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 4d58e8b62050b60d5d8edf9bcdc524ccf6673e86 1 parent 1c610d9
jbaumann jbaumann authored
17 groovy/modules/installers/windows/NSIS-Groovy/.project
... ... @@ -0,0 +1,17 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>NSIS-Groovy</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>net.sf.eclipsensis.installoptions.InstallOptionsBuilder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + </buildSpec>
  14 + <natures>
  15 + <nature>net.sf.eclipsensis.installoptions.InstallOptionsNature</nature>
  16 + </natures>
  17 +</projectDescription>
28 groovy/modules/installers/windows/NSIS-Groovy/Groovy-1.0.launch
... ... @@ -0,0 +1,28 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<launchConfiguration type="net.sf.eclipsensis.launch.nsisLaunchConfigType">
  3 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
  4 +<listEntry value="/NSIS-Groovy/setup.nsi"/>
  5 +</listAttribute>
  6 +<booleanAttribute key="noCD" value="false"/>
  7 +<listAttribute key="instructions"/>
  8 +<booleanAttribute key="noConfig" value="false"/>
  9 +<booleanAttribute key="runInstaller" value="false"/>
  10 +<stringAttribute key="script" value="${workspace_loc:/NSIS-Groovy/setup.nsi}"/>
  11 +<booleanAttribute key="hdrInfo" value="false"/>
  12 +<intAttribute key="processPriority" value="-1"/>
  13 +<listAttribute key="symbols">
  14 +<listEntry value="SOURCE_DIR­D:\NSIS\NSIS-Groovy\Data\1.0\groovy-1.0"/>
  15 +<listEntry value="SOURCE_VERSION­1.0"/>
  16 +<listEntry value="NATIVE_DIR­D:\NSIS\NSIS-Groovy\Data\native"/>
  17 +<listEntry value="SCRIPTOM_DIR­D:\NSIS\NSIS-Groovy\Data\Scriptom-1.2"/>
  18 +<listEntry value="GANT_DIR­D:\NSIS\NSIS-Groovy\Data\1.0\gant-0.3.1_groovy-1.0"/>
  19 +</listAttribute>
  20 +<booleanAttribute key="solidCompression" value="false"/>
  21 +<stringAttribute key="pluginVersion" value="0.9.5.1"/>
  22 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
  23 +<listEntry value="1"/>
  24 +</listAttribute>
  25 +<intAttribute key="compressor" value="0"/>
  26 +<booleanAttribute key="license" value="false"/>
  27 +<intAttribute key="verbosity" value="-1"/>
  28 +</launchConfiguration>
28 groovy/modules/installers/windows/NSIS-Groovy/Groovy-1.1-Beta2.launch
... ... @@ -0,0 +1,28 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<launchConfiguration type="net.sf.eclipsensis.launch.nsisLaunchConfigType">
  3 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
  4 +<listEntry value="/NSIS-Groovy/setup.nsi"/>
  5 +</listAttribute>
  6 +<booleanAttribute key="noCD" value="false"/>
  7 +<listAttribute key="instructions"/>
  8 +<booleanAttribute key="noConfig" value="false"/>
  9 +<booleanAttribute key="runInstaller" value="false"/>
  10 +<stringAttribute key="script" value="${workspace_loc:/NSIS-Groovy/setup.nsi}"/>
  11 +<booleanAttribute key="hdrInfo" value="false"/>
  12 +<intAttribute key="processPriority" value="-1"/>
  13 +<listAttribute key="symbols">
  14 +<listEntry value="SOURCE_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\groovy-1.1-BETA-2"/>
  15 +<listEntry value="SOURCE_VERSION­1.1-Beta2"/>
  16 +<listEntry value="NATIVE_DIR­D:\NSIS\NSIS-Groovy\Data\native"/>
  17 +<listEntry value="SCRIPTOM_DIR­D:\NSIS\NSIS-Groovy\Data\Scriptom-1.2"/>
  18 +<listEntry value="GANT_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\gant-0.3.1_head"/>
  19 +</listAttribute>
  20 +<booleanAttribute key="solidCompression" value="false"/>
  21 +<stringAttribute key="pluginVersion" value="0.9.5.1"/>
  22 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
  23 +<listEntry value="1"/>
  24 +</listAttribute>
  25 +<intAttribute key="compressor" value="0"/>
  26 +<booleanAttribute key="license" value="false"/>
  27 +<intAttribute key="verbosity" value="-1"/>
  28 +</launchConfiguration>
28 groovy/modules/installers/windows/NSIS-Groovy/Groovy-1.1-Beta3.launch
... ... @@ -0,0 +1,28 @@
  1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2 +<launchConfiguration type="net.sf.eclipsensis.launch.nsisLaunchConfigType">
  3 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
  4 +<listEntry value="/NSIS-Groovy/setup.nsi"/>
  5 +</listAttribute>
  6 +<booleanAttribute key="noCD" value="false"/>
  7 +<listAttribute key="instructions"/>
  8 +<booleanAttribute key="noConfig" value="false"/>
  9 +<booleanAttribute key="runInstaller" value="false"/>
  10 +<stringAttribute key="script" value="${workspace_loc:/NSIS-Groovy/setup.nsi}"/>
  11 +<booleanAttribute key="hdrInfo" value="false"/>
  12 +<intAttribute key="processPriority" value="-1"/>
  13 +<listAttribute key="symbols">
  14 +<listEntry value="SOURCE_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\groovy-1.1-BETA-2"/>
  15 +<listEntry value="SOURCE_VERSION­1.1-Beta3"/>
  16 +<listEntry value="NATIVE_DIR­D:\NSIS\NSIS-Groovy\Data\native"/>
  17 +<listEntry value="SCRIPTOM_DIR­D:\NSIS\NSIS-Groovy\Data\Scriptom-1.2"/>
  18 +<listEntry value="GANT_DIR­D:\NSIS\NSIS-Groovy\Data\1.1\gant-0.3.1_head"/>
  19 +</listAttribute>
  20 +<booleanAttribute key="solidCompression" value="false"/>
  21 +<stringAttribute key="pluginVersion" value="0.9.5.1"/>
  22 +<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
  23 +<listEntry value="1"/>
  24 +</listAttribute>
  25 +<intAttribute key="compressor" value="0"/>
  26 +<booleanAttribute key="license" value="false"/>
  27 +<intAttribute key="verbosity" value="-1"/>
  28 +</launchConfiguration>
37 groovy/modules/installers/windows/NSIS-Groovy/ReadmeFirst.txt
... ... @@ -0,0 +1,37 @@
  1 +NSIS Groovy
  2 +-----------
  3 +
  4 +This directory contains the NSIS installer for Groovy as a project for Eclipse.
  5 +
  6 +To use it, simply check it out into an Eclipse workspace. Additionally you might
  7 +want to install the NSISEclipse-Plugin, it helps when developing NSIS stuff.
  8 +
  9 +If you have worked with NSIS-scripts already there should be no big problem understanding
  10 +what is done.
  11 +
  12 +The main script is the file setup.nsi, where you can find the installer program.
  13 +Three additional pages are defined, Variables, NativeLauncher and FileAssociation,
  14 +and for each you can find the respective .ini file containing the screen placement.
  15 +Simply open them in the design editor provided by the Eclipse-Plugin, and you can
  16 +see what they look like.
  17 +
  18 +Two bmp-images contain the Groovy logo in different resolutions, one for the welcome
  19 +page and one as header image for the other pages. The name is the game ...
  20 +
  21 +F�nally you have the launch scripts. These actually start the compiler with different
  22 +settings for the groovy version, the groovy location (on your hard disk) and the
  23 +location of the native launcher. The groovy version influences the final name of the
  24 +installer.
  25 +
  26 +The launch scripts are setting the following variables:
  27 +
  28 +SOURCE_VERSION defines the version of the release
  29 +SOURCE_DIR is the full path to the groovy install directory
  30 +NATIVE_DIR is the full path to the native launcher
  31 +
  32 +
  33 +Most probably you only have to set these variables and you are happy to go.
  34 +
  35 +Have fun, Joachim
  36 +
  37 +Contact: joachim.baumann@xinaris.de
31 groovy/modules/installers/windows/NSIS-Groovy/additionalpackages.ini
... ... @@ -0,0 +1,31 @@
  1 +; Auto-generated by EclipseNSIS InstallOptions Script Wizard
  2 +; 28.07.2007 22:00:24
  3 +[Settings]
  4 +NumFields=3
  5 +Title=Additional Modules
  6 +
  7 +[Field 1]
  8 +Type=Label
  9 +Left=15
  10 +Top=15
  11 +Right=284
  12 +Bottom=52
  13 +Text=Additional Modules are not necessary, but we recommend installing them anyway.
  14 +
  15 +[Field 2]
  16 +Type=CheckBox
  17 +Left=15
  18 +Top=52
  19 +Right=284
  20 +Bottom=62
  21 +Text=Gant - a build tool for scripting Ant tasks with Groovy
  22 +State=1
  23 +
  24 +[Field 3]
  25 +Type=CheckBox
  26 +Left=15
  27 +Top=71
  28 +Right=284
  29 +Bottom=81
  30 +Text=Scriptom - script ActiveX or COM components with Groovy
  31 +State=1
39 groovy/modules/installers/windows/NSIS-Groovy/fileassociation.ini
... ... @@ -0,0 +1,39 @@
  1 +; Auto-generated by EclipseNSIS InstallOptions Script Wizard
  2 +; 26.07.2007 13:42:05
  3 +[Settings]
  4 +NumFields=4
  5 +Title=File Associations
  6 +
  7 +[Field 1]
  8 +Type=Label
  9 +Left=50
  10 +Top=1
  11 +Right=249
  12 +Bottom=70
  13 +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.
  14 +
  15 +[Field 2]
  16 +Type=CheckBox
  17 +Left=50
  18 +Top=70
  19 +Right=249
  20 +Bottom=80
  21 +Text=Add File Association
  22 +State=1
  23 +
  24 +[Field 3]
  25 +Type=Label
  26 +Left=50
  27 +Top=90
  28 +Right=249
  29 +Bottom=130
  30 +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.
  31 +
  32 +[Field 4]
  33 +Type=CheckBox
  34 +Left=50
  35 +Top=130
  36 +Right=249
  37 +Bottom=140
  38 +Text=Add to PATHEXT
  39 +State=1
BIN  groovy/modules/installers/windows/NSIS-Groovy/header.bmp
Binary file not shown
22 groovy/modules/installers/windows/NSIS-Groovy/nativelauncher.ini
... ... @@ -0,0 +1,22 @@
  1 +; Auto-generated by EclipseNSIS InstallOptions Script Wizard
  2 +; 26.07.2007 12:57:18
  3 +[Settings]
  4 +NumFields=2
  5 +Title=Native Launcher
  6 +
  7 +[Field 1]
  8 +Type=Label
  9 +Left=50
  10 +Top=20
  11 +Right=249
  12 +Bottom=89
  13 +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.
  14 +
  15 +[Field 2]
  16 +Type=CheckBox
  17 +Left=50
  18 +Top=102
  19 +Right=249
  20 +Bottom=112
  21 +Text=Install Native Launcher
  22 +State=1
950 groovy/modules/installers/windows/NSIS-Groovy/setup.nsi
... ... @@ -0,0 +1,950 @@
  1 +# We assume the following commandline parameters for the compilation
  2 +# SOURCE_VERSION defines the version of the release
  3 +# SOURCE_DIR is the full path to the groovy install directory
  4 +# NATIVE_DIR is the full path to the native launcher
  5 +# SCRIPTOM_DIR is the full path to the scriptom module
  6 +# GANT_DIR is the full path to the gant module
  7 +
  8 +Name Groovy
  9 +
  10 +!define InstallerVersion 0.4
  11 +
  12 +# Set the compression level
  13 +SetCompressor /SOLID lzma
  14 +
  15 +# The source of the Groovy installation
  16 +!define SOURCEDIR ${SOURCE_DIR}
  17 +
  18 +# Defines
  19 +!define REGKEY "SOFTWARE\$(^Name)"
  20 +!define VERSION ${SOURCE_VERSION}
  21 +!define COMPANY ""
  22 +!define URL groovy.codehaus.org
  23 +
  24 +# MUI defines
  25 +!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
  26 +!define MUI_FINISHPAGE_NOAUTOCLOSE
  27 +!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
  28 +!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
  29 +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
  30 +!define MUI_STARTMENUPAGE_DEFAULTFOLDER Groovy
  31 +!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
  32 +!define MUI_UNFINISHPAGE_NOAUTOCLOSE
  33 +!define MUI_LANGDLL_REGISTRY_ROOT HKLM
  34 +!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
  35 +!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
  36 +!define MUI_HEADERIMAGE
  37 +!define MUI_HEADERIMAGE_BITMAP "header.bmp"
  38 +!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
  39 +!define MUI_WELCOMEFINISHPAGE_BITMAP "welcome.bmp"
  40 +!define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
  41 +
  42 +# Included files
  43 +!include Sections.nsh
  44 +!include MUI.nsh
  45 +!include logiclib.nsh
  46 +!include WinMessages.NSH
  47 +
  48 +
  49 +# Reserved Files
  50 +!insertmacro MUI_RESERVEFILE_LANGDLL
  51 +
  52 +# User and System Environment
  53 +!define NT_current_env 'HKCU "Environment"'
  54 +!define NT_all_env 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
  55 +
  56 +# Variables
  57 +Var StartMenuGroup
  58 +Var UserOrSystem "current"
  59 +
  60 +
  61 +
  62 +# Installer pages
  63 +!insertmacro MUI_PAGE_WELCOME
  64 +!insertmacro MUI_PAGE_DIRECTORY
  65 +!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
  66 +!insertmacro MUI_PAGE_INSTFILES
  67 +Page custom ReadVariables SetVariables
  68 +Page custom ReadNativeLauncher InstallNativeLauncher
  69 +Page custom ReadAdditionalPackages InstallAdditionalPackages
  70 +Page custom ReadFileAssociation SetFileAssociation
  71 +!insertmacro MUI_PAGE_FINISH
  72 +!insertmacro MUI_UNPAGE_CONFIRM
  73 +!insertmacro MUI_UNPAGE_INSTFILES
  74 +
  75 +# Installer languages
  76 +!insertmacro MUI_LANGUAGE English
  77 +!insertmacro MUI_LANGUAGE German
  78 +!insertmacro MUI_LANGUAGE Spanish
  79 +!insertmacro MUI_LANGUAGE French
  80 +
  81 +# Installer attributes
  82 +OutFile "groovy${SOURCE_VERSION}-installer.exe"
  83 +InstallDir $PROGRAMFILES\Groovy
  84 +CRCCheck on
  85 +XPStyle on
  86 +ShowInstDetails show
  87 +VIProductVersion 1.1.0.0
  88 +VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName Groovy
  89 +VIAddVersionKey ProductVersion "${VERSION}"
  90 +VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}"
  91 +VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion ""
  92 +VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription ""
  93 +VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright ""
  94 +InstallDirRegKey HKLM "${REGKEY}" Path
  95 +ShowUninstDetails show
  96 +
  97 +# Installer sections
  98 +Section -Main SEC0000
  99 + SetOutPath $INSTDIR
  100 + SetOverwrite on
  101 + File /r ${SOURCEDIR}\*
  102 + WriteRegStr HKLM "${REGKEY}\Components" Main 1
  103 +SectionEnd
  104 +
  105 +Section -post SEC0001
  106 + WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
  107 + SetOutPath $INSTDIR
  108 + WriteUninstaller $INSTDIR\uninstall.exe
  109 + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  110 + SetOutPath $SMPROGRAMS\$StartMenuGroup
  111 + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\uninstall.exe
  112 + !insertmacro MUI_STARTMENU_WRITE_END
  113 + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
  114 + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
  115 + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
  116 + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
  117 + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
  118 + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
  119 + WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
  120 +SectionEnd
  121 +
  122 +# Macro for selecting uninstaller sections
  123 +!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
  124 + Push $R0
  125 + ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
  126 + StrCmp $R0 1 0 next${UNSECTION_ID}
  127 + !insertmacro SelectSection "${UNSECTION_ID}"
  128 + GoTo done${UNSECTION_ID}
  129 +next${UNSECTION_ID}:
  130 + !insertmacro UnselectSection "${UNSECTION_ID}"
  131 +done${UNSECTION_ID}:
  132 + Pop $R0
  133 +!macroend
  134 +
  135 +# Uninstaller sections
  136 +Section /o un.Main UNSEC0000
  137 + RmDir /r /REBOOTOK $INSTDIR
  138 + DeleteRegValue HKLM "${REGKEY}\Components" Main
  139 +SectionEnd
  140 +
  141 +Section un.post UNSEC0001
  142 + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
  143 + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk"
  144 + Delete /REBOOTOK $INSTDIR\uninstall.exe
  145 + DeleteRegValue HKLM "${REGKEY}" StartMenuGroup
  146 + DeleteRegValue HKLM "${REGKEY}" Path
  147 + DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
  148 + DeleteRegKey /IfEmpty HKLM "${REGKEY}"
  149 + RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
  150 + RmDir /REBOOTOK $INSTDIR
  151 + Push $R0
  152 + StrCpy $R0 $StartMenuGroup 1
  153 + StrCmp $R0 ">" no_smgroup
  154 +no_smgroup:
  155 + Pop $R0
  156 +SectionEnd
  157 +
  158 +!define RUSSELOPTION "Russel-option detected: Now reformatting the disc. \
  159 +Press ok to install Ubuntu and Groovy as an Ubuntu package."
  160 +
  161 +# Installer functions
  162 +Function .onInit
  163 + InitPluginsDir
  164 + !insertmacro MUI_LANGDLL_DISPLAY
  165 + File /oname=$PLUGINSDIR\variables.ini variables.ini
  166 + File /oname=$PLUGINSDIR\nativelauncher.ini nativelauncher.ini
  167 + File /oname=$PLUGINSDIR\fileassociation.ini fileassociation.ini
  168 + File /oname=$PLUGINSDIR\additionalpackages.ini additionalpackages.ini
  169 +
  170 + Push $CMDLINE
  171 + Push "-russel"
  172 + Call StrStr
  173 + Pop $R0
  174 +
  175 + ${If} $R0 != '-1'
  176 + MessageBox MB_ICONEXCLAMATION|MB_OK "${RUSSELOPTION}"
  177 + ${EndIf}
  178 +
  179 +FunctionEnd
  180 +
  181 +
  182 +# Uninstaller functions
  183 +Function un.onInit
  184 + ReadRegStr $INSTDIR HKLM "${REGKEY}" Path
  185 + !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
  186 + !insertmacro MUI_UNGETLANGUAGE
  187 + !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
  188 +FunctionEnd
  189 +
  190 +#################################################################################################
  191 +
  192 +### Environment
  193 +
  194 +#################################################################################################
  195 +
  196 +# VField 01
  197 +LangString VField01 ${LANG_ENGLISH} "Create GROOVY_HOME"
  198 +LangString VField01 ${LANG_GERMAN} "Erzeuge GROOVY_HOME"
  199 +LangString VField01 ${LANG_SPANISH} "Crear GROOVY_HOME"
  200 +LangString VField01 ${LANG_FRENCH} "Cr�er GROOVY_HOME"
  201 +
  202 +# VField 02
  203 +LangString VField02 ${LANG_ENGLISH} "Add to Path"
  204 +LangString VField02 ${LANG_GERMAN} "Zum Pfad hinzuf�gen"
  205 +LangString VField02 ${LANG_SPANISH} "Agregar a la Ruta"
  206 +LangString VField02 ${LANG_FRENCH} "Ajouter au chemin d'acc�s/au Path"
  207 +
  208 +# VField 5
  209 +LangString VField05 ${LANG_ENGLISH} "If a reference to groovy is detected in the path, \
  210 +the checkbox for adding GROOVY_HOME to the path is unchecked. \
  211 +If you know better, please set the checkbox to checked.\r\n\r\n\
  212 +NB: The uninstaller won't restore old values (yet)."
  213 +LangString VField05 ${LANG_GERMAN} "Wenn eine Referenz zu groovy im Pfad entdeckt wird, \
  214 +wird die Checkbox f�r das Hinzuf�gen von GROOVY_HOME ausgeschaltet.\
  215 +Wenn Sie GROOVY_HOME trotzdem zum Pfad hinzuf�gen m�chten, w�hlen Sie sie wieder an.\r\n\r\n\
  216 +Achtung: Der Uninstaller merkt sich keine alten Werte (noch nicht)."
  217 +LangString VField05 ${LANG_SPANISH} "Si alguna referencia a Groovy es detectada en la ruta, \
  218 +el bot�n para agregar GROOVY_HOME a la ruta aparecer� deseleccionado. \
  219 +Puede dejar el bot�n seleccionado si lo desea.\r\n\r\n\
  220 +NB: El proceso de desinstalaci�n no restaurar� valores anteriores."
  221 +LangString VField05 ${LANG_FRENCH} "Si une r�f�rence vers groovy \
  222 +est d�tect�e dans le chemin d'acc�s, \
  223 +la boite � cocher d'ajout de GROOVY_HOME au chemin d'acc�s est d�coch�e. \
  224 +Si vous �tes expert, cochez ici svp.\r\n\r\n\
  225 +NB: Le d�sinstalleur ne restaurera pas les anciennes valeurs (pas pour le moment)."
  226 +
  227 +# VField 6
  228 +LangString VField06 ${LANG_ENGLISH} "User Environment or\r\nSystem Environment"
  229 +LangString VField06 ${LANG_GERMAN} "Benutzerumgebung oder\r\nSystemumgebung"
  230 +LangString VField06 ${LANG_SPANISH} "Entorno de Usuario o\r\nEntorno de Sistema"
  231 +LangString VField06 ${LANG_FRENCH} "Environnement utilisateur ou\r\nenvironnement syst�me"
  232 +
  233 +# VField 7
  234 +LangString VField07 ${LANG_ENGLISH} "Add to System Environment"
  235 +LangString VField07 ${LANG_GERMAN} "Systemumgebung w�hlen"
  236 +LangString VField07 ${LANG_SPANISH} "Agregar a Entorno de Sistema"
  237 +LangString VField07 ${LANG_FRENCH} "Ajouter � l'environnement syst�me"
  238 +
  239 +# VField 8
  240 +LangString VField08 ${LANG_ENGLISH} "Path to Groovy Home"
  241 +LangString VField08 ${LANG_GERMAN} "Pfad zu Groovy Home"
  242 +LangString VField08 ${LANG_SPANISH} "Ruta a Groovy Home"
  243 +LangString VField08 ${LANG_FRENCH} "Chemins d'acc�s au r�pertoire standard Groovy"
  244 +
  245 +# VField 9
  246 +LangString VField09 ${LANG_ENGLISH} "Path Extension"
  247 +LangString VField09 ${LANG_GERMAN} "Erweiterung des Pfades"
  248 +LangString VField09 ${LANG_SPANISH} "Extensi�n de Rutas"
  249 +LangString VField09 ${LANG_FRENCH} "Extension du chemin d'acc�s"
  250 +
  251 +# JavaHomeWarning
  252 +LangString JavaHomeWarning ${LANG_ENGLISH} "JAVA_HOME is not set. Please set it \
  253 +to your Java installation, otherwise Groovy won't be able to work."
  254 +LangString JavaHomeWarning ${LANG_GERMAN} "JAVA_HOME ist nicht gesetzt. \
  255 +Bitte setzen Sie die Umgebungsvariable, ansonsten kann Groovy nicht funktionieren."
  256 +LangString JavaHomeWarning ${LANG_SPANISH} "JAVA_HOME no est� definido. Por favor defina la ruta \
  257 +hacia la instalaci�n de Java, de lo contrario Groovy no podr� funcionar correctamente."
  258 +LangString JavaHomeWarning ${LANG_FRENCH} "JAVA_HOME n'est pas positionn� sur le r�pertoire \
  259 +d'installation Java. Dans le cas contraire groovy ne fonctionnera pas."
  260 +
  261 +
  262 +#Additional Page for setting GROOVY_HOME and system path
  263 +Function ReadVariables
  264 + Push $R0
  265 +
  266 + # Localization
  267 + WriteINIStr $PLUGINSDIR\variables.ini "Field 1" "Text" $(VField01)
  268 + WriteINIStr $PLUGINSDIR\variables.ini "Field 2" "Text" $(VField02)
  269 + WriteINIStr $PLUGINSDIR\variables.ini "Field 5" "Text" $(VField05)
  270 + WriteINIStr $PLUGINSDIR\variables.ini "Field 6" "Text" $(VField06)
  271 + WriteINIStr $PLUGINSDIR\variables.ini "Field 7" "Text" $(VField07)
  272 + WriteINIStr $PLUGINSDIR\variables.ini "Field 8" "Text" $(VField08)
  273 + WriteINIStr $PLUGINSDIR\variables.ini "Field 9" "Text" $(VField09)
  274 +
  275 + # Set value for GROOVY_HOME textfield
  276 + WriteINIStr $PLUGINSDIR\variables.ini "Field 3" "state" $INSTDIR
  277 +
  278 + # Check for groovy in path
  279 + ReadEnvStr $R0 PATH
  280 + Push $R0
  281 + Push "Groovy" # seems to be case-insensitive
  282 + Call StrStr
  283 + Pop $R0
  284 +
  285 + # set GROOVY_HOME checkbox to unchecked if groovy is in path
  286 + ${If} $R0 != '-1'
  287 + WriteINIStr $PLUGINSDIR\variables.ini "Field 2" "state" "0"
  288 + ${EndIf}
  289 +
  290 + InstallOptions::dialog $PLUGINSDIR\variables.ini
  291 +
  292 + Pop $R0
  293 +FunctionEnd
  294 +
  295 +Function SetVariables
  296 + Push $R0
  297 +
  298 + # If set, then the system environment is used
  299 + ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 7" "State"
  300 + ${If} $R0 == '1'
  301 + # default is current
  302 + StrCpy $UserOrSystem "all"
  303 + ${Else}
  304 + StrCpy $UserOrSystem "current"
  305 + ${EndIf}
  306 +
  307 + # Set GROOVY_HOME if the user checked the resp. checkbox
  308 + ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 1" "State"
  309 + ${If} $R0 == '1'
  310 + ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 3" "State"
  311 + Push "GROOVY_HOME"
  312 + Push $R0
  313 + Call WriteEnvStr
  314 + ${EndIf}
  315 +
  316 + # Set PATH if the user checked the resp. checkbox
  317 + ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 2" "State"
  318 + ${If} $R0 == '1'
  319 + ReadINIStr $R0 "$PLUGINSDIR\variables.ini" "Field 4" "State"
  320 + Push $R0
  321 + Call AddToPath
  322 + ${EndIf}
  323 +
  324 + # Finally, check for JAVA_HOME existence
  325 + ReadEnvStr $R0 JAVA_HOME
  326 + ${If} $R0 == ""
  327 + MessageBox MB_ICONEXCLAMATION|MB_OK $(JavaHomeWarning)
  328 + ${EndIf}
  329 +
  330 + Pop $R0
  331 +
  332 +FunctionEnd
  333 +
  334 +#################################################################################################
  335 +
  336 +### Native Launcher
  337 +
  338 +#################################################################################################
  339 +
  340 +# NLField 01
  341 +LangString NLField01 ${LANG_ENGLISH} "The Native Launcher is an executable, that \
  342 +in most cases is preferrable to the normal \
  343 +launching scripts. If you want file associations, \
  344 +than you have to install the native launcher.\
  345 +\r\n\r\nIf you don't know what this is about, \
  346 +then leave the checkbox in the checked state."
  347 +LangString NLField01 ${LANG_GERMAN} "Der 'Native Launcher' ist ein ausf�hrbares \
  348 +Programm, das den Start-Skripten in den meisten \
  349 +F�llen �berlegen ist. Wenn Sie Datei-Assoziationen \
  350 +verwenden wollen, m�ssen sie den 'Native Launcher' \
  351 +installieren.\r\n\r\n\
  352 +Wenn Sie nicht wissen, was das bedeutet, \
  353 +lassen Sie die Checkbox angehakt."
  354 +LangString NLField01 ${LANG_SPANISH} "El Lanzador Nativo es una aplicaci�n ejecutable, que \
  355 +en la mayor�a de los casos es preferible a los ficheros de \
  356 +inicio tipo script. Si desea tener asociaciones a ficheros, \
  357 +entonces deber� instalar el Lanzador Nativo. \
  358 +\r\n\r\nSi no tiene conocimiento de lo anterior, entonces por favor \
  359 +deje el bot�n en estado seleccionado."
  360 +LangString NLField01 ${LANG_FRENCH} "Le lanceur natif est un executable qui \
  361 +dans la majeure partie des cas est bien pr�f�rable � \
  362 +un lancement par scripts. Si vous voulez une association fichier, \
  363 +il est n�cessaire d'utiliser le lanceur natif.\
  364 +\r\n\r\nSi vous ne savez pas de quoi il s'agit, alors laissez \
  365 +la boite � cocher dans l'�tat coch�."
  366 +
  367 +# NLField 02
  368 +LangString NLField02 ${LANG_ENGLISH} "Install Native Launcher"
  369 +LangString NLField02 ${LANG_GERMAN} "Installiere Native Launcher"
  370 +LangString NLField02 ${LANG_SPANISH} "Instalar el Lanzador Nativo"
  371 +LangString NLField02 ${LANG_FRENCH} "Installer le lanceur natif"
  372 +
  373 +Function ReadNativeLauncher
  374 + Push $R0
  375 +
  376 + # Localization
  377 + #MessageBox MB_ICONEXCLAMATION|MB_OK "Result. $(Field10)"
  378 + WriteINIStr $PLUGINSDIR\nativelauncher.ini "Field 1" "Text" $(NLField01)
  379 + WriteINIStr $PLUGINSDIR\nativelauncher.ini "Field 2" "Text" $(NLField02)
  380 +
  381 + InstallOptions::dialog $PLUGINSDIR\nativelauncher.ini
  382 +
  383 + Pop $R0
  384 +FunctionEnd
  385 +
  386 +Function InstallNativeLauncher
  387 + Push $R0
  388 +
  389 + # If set, then install the native launcher
  390 + ReadINIStr $R0 "$PLUGINSDIR\nativelauncher.ini" "Field 2" "State"
  391 + ${If} $R0 == '1'
  392 + SetOutPath $INSTDIR\bin
  393 + File /r ${NATIVE_DIR}\*
  394 + ${EndIf}
  395 +
  396 + Pop $R0
  397 +
  398 +FunctionEnd
  399 +
  400 +#################################################################################################
  401 +
  402 +### File Associations
  403 +
  404 +#################################################################################################
  405 +
  406 +# FAField 01
  407 +LangString FAField01 ${LANG_ENGLISH} "File Association allows us to define \
  408 +a program (in our case groovy) to execute upon \
  409 +double click on a file. This means that you can \
  410 +execute your groovy programs directly from the explorer.\
  411 +You need the native launcher for this.\
  412 +\r\n\r\nAn added benefit is that the groovy \
  413 +icon is associated with groovy files."
  414 +LangString FAField01 ${LANG_GERMAN} "Dateiassoziation erlaubt es uns, ein \
  415 +Programm zu bestimmen (in unserem Fall Groovy), \
  416 +das automatisch beim Start einer Groovy-Datei \
  417 +ausgef�hrt wird. Sie k�nnen also mit Doppelklick \
  418 +im Explorer Ihre Groovy-Programme starten.\
  419 +Sie ben�tigen den 'Native Launcher' hierf�r.\
  420 +\r\n\r\nZus�tzlich wird das Groovy Icon mit \
  421 +Groovy-Dateien assoziiert."
  422 +LangString FAField01 ${LANG_SPANISH} "Asociaci�n de Ficheros permite definir que \
  423 +un programa (en este caso Groovy) se ejecute al realizar \
  424 +doble click con el puntero sobre un fichero. Esto significa \
  425 +que usted podr� ejecutar programas Groovy directamente desde el Explorador de Windows. \
  426 +Para ello se requiere entonces del Lanzador Nativo.\
  427 +\r\n\r\nComo beneficio adicional habr� un �cono Groovy asociado a \
  428 +ficheros de tipo Groovy."
  429 +LangString FAField01 ${LANG_FRENCH} "L'association fichier vous permet de d�finir \
  430 +un programme (dans notre cas groovy) pour ex�cuter un fichier groovy \
  431 +par simple double-click sur ce dernier. Ceci signifie que vous pouvez \
  432 +ex�cuter vos programmes groovy directement � partir d'un explorateur windows. \
  433 +Vous avez besoin du lanceur natif pour cela. \
  434 +\r\n\r\nUn b�n�fice suppl�mentaire est que l'icone \
  435 +groovy est associ�e � tout fichier de type groovy."
  436 +
  437 +
  438 +# FAField 02
  439 +LangString FAField02 ${LANG_ENGLISH} "Add File Association"
  440 +LangString FAField02 ${LANG_GERMAN} "F�ge Dateiassoziation hinzu"
  441 +LangString FAField02 ${LANG_SPANISH} "Agregar Asociaci�n de Ficheros"
  442 +LangString FAField02 ${LANG_FRENCH} "Ajouter une association fichier"
  443 +
  444 +# FAField 03
  445 +LangString FAField03 ${LANG_ENGLISH} "PATHEXT is an environment variable telling cmd.exe \
  446 +which files are executable. If Groovy-Files are already referenced, this checkbox \
  447 +is unchecked. If you know better, please set the checkbox to checked."
  448 +LangString FAField03 ${LANG_GERMAN} "PATHEXT ist eine Umgebungsvariable, die cmd.exe \
  449 +mitteilt, welche Dateien ausf�hrbar sind. Wenn Groovy-Dateien schon referenziert \
  450 +sind, ist die Checkbox nicht ausgew�hlt. \
  451 +Wenn Sie Groovy trotzdem hinzuf�gen wollen, w�hlen Sie sie wieder an."
  452 +LangString FAField03 ${LANG_SPANISH} "PATHEXT es una variable de entorno que le indica \
  453 +a cmd.exe cuales ficheros son de tipo ejecutable. Si Groovy-Files ya esta referenciado, \
  454 +este bot�n aparecer� deseleccionado. Puede dejar el bot�n seleccionado si lo \
  455 +desea."
  456 +LangString FAField03 ${LANG_FRENCH} "PATHEXT est une variable d'environnement indiquant \
  457 +� la commande cmd.exe \
  458 +quels fichiers sont des ex�cutables. Si les fichiers groovy sont d�j� r�f�renc�s, \
  459 +la boite � cocher est d�coch�e. Si vous �tes expert, cochez ici svp."
  460 +
  461 +# FAField 04
  462 +LangString FAField04 ${LANG_ENGLISH} "Add to PATHEXT"
  463 +LangString FAField04 ${LANG_GERMAN} "F�ge zu PATHEXT hinzu"
  464 +LangString FAField04 ${LANG_SPANISH} "Agregar a PATHEXT"
  465 +LangString FAField04 ${LANG_FRENCH} "Ajouter � PATHEXT"
  466 +
  467 +Function ReadFileAssociation
  468 + Push $R0
  469 +
  470 + # Localization
  471 + #MessageBox MB_ICONEXCLAMATION|MB_OK "Result. $(Field10)"
  472 + WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 1" "Text" $(FAField01)
  473 + WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 2" "Text" $(FAField02)
  474 + WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 3" "Text" $(FAField03)
  475 + WriteINIStr $PLUGINSDIR\fileassociation.ini "Field 4" "Text" $(FAField04)
  476 +
  477 +
  478 + # Check for groovy in path
  479 + ReadEnvStr $R0 "PATHEXT"
  480 + Push $R0
  481 + Push ".groovy" # seems to be case-insensitive
  482 + Call StrStr
  483 + Pop $R0
  484 +
  485 + # set GROOVY_HOME checkbox to unchecked if groovy is in path
  486 + ${If} $R0 != '-1'
  487 + WriteINIStr $PLUGINSDIR\variables.ini "Field 4" "state" "0"
  488 + ${EndIf}
  489 +
  490 + InstallOptions::dialog $PLUGINSDIR\fileassociation.ini
  491 +
  492 + Pop $R0
  493 +FunctionEnd
  494 +
  495 +Function SetFileAssociation
  496 + Push $R0
  497 +
  498 + # If set, then create file association
  499 + ReadINIStr $R0 "$PLUGINSDIR\fileassociation.ini" "Field 2" "State"
  500 + ${If} $R0 == '1'
  501 + # set file associations
  502 + !define Index "Line${__LINE__}"
  503 + ReadRegStr $1 HKCR ".groovy" ""
  504 + StrCmp $1 "" "${Index}-NoBackup"
  505 + StrCmp $1 "Groovy" "${Index}-NoBackup"
  506 + WriteRegStr HKCR ".groovy" "backup_val" $1
  507 + "${Index}-NoBackup:"
  508 + WriteRegStr HKCR ".groovy" "" "Groovy"
  509 + ReadRegStr $0 HKCR "Groovy" ""
  510 + StrCmp $0 "" 0 "${Index}-Skip"
  511 + WriteRegStr HKCR "Groovy" "" "Groovy.groovy"
  512 + WriteRegStr HKCR "Groovy\shell" "" "open"
  513 + WriteRegStr HKCR "Groovy\DefaultIcon" "" '"$INSTDIR\bin\groovy.exe",0'
  514 + "${Index}-Skip:"
  515 + WriteRegStr HKCR "Groovy\shell\open\command" "" '"$INSTDIR\bin\groovy.exe" "%1"'
  516 + #WriteRegStr HKCR "Groovy\shell\edit" "" "Edit Options File"
  517 + #WriteRegStr HKCR "Groovy\shell\edit\command" "" '$INSTDIR\execute.exe "%1"'
  518 +
  519 + System::Call 'Shell32::SHChangeNotify(i 0x8000000, i 0, i 0, i 0)'
  520 + !undef Index
  521 + ${EndIf}
  522 +
  523 + # Set PATHEXT if the user checked the resp. checkbox
  524 + ReadINIStr $R0 "$PLUGINSDIR\fileassociation.ini" "Field 4" "State"
  525 + ${If} $R0 == '1'
  526 + ReadEnvStr $R0 "PATHEXT"
  527 + StrCpy $R0 "$R0;.groovy;.gy"
  528 + Push "PATHEXT"
  529 + Push $R0
  530 + Call WriteEnvStr
  531 + ${EndIf}
  532 +
  533 +
  534 + Pop $R0
  535 +
  536 +FunctionEnd
  537 +
  538 +
  539 +
  540 +#################################################################################################
  541 +
  542 +### Additional Packages
  543 +
  544 +#################################################################################################
  545 +
  546 +# APField 01
  547 +LangString APField01 ${LANG_ENGLISH} "Additional Modules are not strictly necessary, \
  548 +but we recommend installing them anyway."
  549 +LangString APField01 ${LANG_GERMAN} "Zus�tzliche Module sind nicht unbedingt notwendig, \
  550 +wir empfehlen aber, sie trotzdem zu installieren."
  551 +LangString APField01 ${LANG_SPANISH} "Los M�dulos Adicionales no son estrictamente \
  552 +necesarios, pero recomendamos que se instalen de todas formas."
  553 +LangString APField01 ${LANG_FRENCH} "Les Modules aditionnels sont optionnels, \
  554 +nous vous recommendons cependant de les installer"
  555 +
  556 +# APField 02
  557 +LangString APField02 ${LANG_ENGLISH} "Gant - a build tool for scripting Ant tasks \
  558 +with Groovy"
  559 +LangString APField02 ${LANG_GERMAN} "Gant - Ein Werkzeug, um Ant Tasks mit Groovy \
  560 +zu programmieren"
  561 +LangString APField02 ${LANG_SPANISH} "Gant - una herramienta que facilita el \
  562 +'scripting' the tareas de Ant con Groovy"
  563 +LangString APField02 ${LANG_FRENCH} "Gant - Outil de build permettant de manipuler \
  564 +les t�ches Ant avec Groovy"
  565 +
  566 +# APField 03
  567 +LangString APField03 ${LANG_ENGLISH} "Scriptom - script ActiveX or COM components \
  568 +with Groovy"
  569 +LangString APField03 ${LANG_GERMAN} "Scriptom - Programmieren von ActiveX und COM-\
  570 +Komponenten mit Groovy"
  571 +LangString APField03 ${LANG_SPANISH} "Scriptom - permite acceder y configurar \
  572 +components ActiveX y/o COM con Groovy"
  573 +LangString APField03 ${LANG_FRENCH} "Scriptom - Manipulation d'ActiveX ou composants \
  574 +COM avec Groovy"
  575 +
  576 +
  577 +Function ReadAdditionalPackages
  578 + Push $R0
  579 +
  580 + # Localization
  581 + WriteINIStr $PLUGINSDIR\additionalpackages.ini "Field 1" "Text" $(APField01)
  582 + WriteINIStr $PLUGINSDIR\additionalpackages.ini "Field 2" "Text" $(APField02)
  583 + WriteINIStr $PLUGINSDIR\additionalpackages.ini "Field 3" "Text" $(APField03)
  584 +
  585 + InstallOptions::dialog $PLUGINSDIR\additionalpackages.ini
  586 +
  587 + Pop $R0
  588 +FunctionEnd
  589 +
  590 +Function InstallAdditionalPackages
  591 + Push $R0
  592 +
  593 + # If set, then install Gant
  594 + ReadINIStr $R0 "$PLUGINSDIR\additionalpackages.ini" "Field 2" "State"
  595 + ${If} $R0 == '1'
  596 + SetOutPath $INSTDIR\bin
  597 + File /r ${GANT_DIR}\bin\gant*
  598 +
  599 + SetOutPath $INSTDIR\lib
  600 + File /r ${GANT_DIR}\lib\gant*.jar
  601 + File /nonfatal /r ${GANT_DIR}\lib\ivy*.jar
  602 + File /nonfatal /r ${GANT_DIR}\lib\maven*.jar
  603 + ${EndIf}
  604 +
  605 + # If set, then install Scriptom
  606 + ReadINIStr $R0 "$PLUGINSDIR\additionalpackages.ini" "Field 3" "State"
  607 + ${If} $R0 == '1'
  608 + SetOutPath $INSTDIR
  609 + File /r ${SCRIPTOM_DIR}\*
  610 + ${EndIf}
  611 +
  612 + Pop $R0
  613 +
  614 +FunctionEnd
  615 +
  616 +
  617 +
  618 +
  619 +
  620 +
  621 +
  622 +
  623 +
  624 +
  625 +
  626 +
  627 +
  628 +
  629 +
  630 +
  631 +
  632 +
  633 +
  634 +# Installer Language Strings
  635 +# TODO Update the Language Strings with the appropriate translations.
  636 +
  637 +LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
  638 +LangString ^UninstallLink ${LANG_GERMAN} "Uninstall $(^Name)"
  639 +LangString ^UninstallLink ${LANG_SPANISH} "Uninstall $(^Name)"
  640 +LangString ^UninstallLink ${LANG_FRENCH} "Uninstall $(^Name)"
  641 +
  642 +
  643 +;====================================================
  644 +; get_NT_environment
  645 +; Returns: the selected environment
  646 +; Output : head of the stack
  647 +;====================================================
  648 +!macro select_NT_profile UN
  649 +Function ${UN}select_NT_profile
  650 + 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)" \
  651 + IDNO environment_single
  652 + DetailPrint "Selected environment for all users"
  653 + Push "all"
  654 + Return
  655 + environment_single:
  656 + DetailPrint "Selected environment for current user only."
  657 + Push "current"
  658 + Return
  659 +FunctionEnd
  660 +!macroend
  661 +!insertmacro select_NT_profile ""
  662 +!insertmacro select_NT_profile "un."
  663 +
  664 +;====================================================
  665 +; StrStr - Finds a given string in another given string.
  666 +; Returns -1 if not found and the pos if found.
  667 +; Input: head of the stack - string to find
  668 +; second in the stack - string to find in
  669 +; Output: head of the stack
  670 +;====================================================
  671 +!macro StrStr UN
  672 +Function ${UN}StrStr
  673 + Push $0
  674 + Exch
  675 + Pop $0 ; $0 now have the string to find
  676 + Push $1
  677 + Exch 2
  678 + Pop $1 ; $1 now have the string to find in
  679 + Exch
  680 + Push $2
  681 + Push $3
  682 + Push $4
  683 + Push $5
  684 +
  685 + StrCpy $2 -1
  686 + StrLen $3 $0
  687 + StrLen $4 $1
  688 + IntOp $4 $4 - $3
  689 +
  690 + ${UN}StrStr_loop:
  691 + IntOp $2 $2 + 1
  692 + IntCmp $2 $4 0 0 ${UN}StrStrReturn_notFound
  693 + StrCpy $5 $1 $3 $2
  694 + StrCmp $5 $0 ${UN}StrStr_done ${UN}StrStr_loop
  695 +
  696 + ${UN}StrStrReturn_notFound:
  697 + StrCpy $2 -1
  698 +
  699 + ${UN}StrStr_done:
  700 + Pop $5
  701 + Pop $4
  702 + Pop $3
  703 + Exch $2
  704 + Exch 2
  705 + Pop $0
  706 + Pop $1
  707 +FunctionEnd
  708 +!macroend
  709 +!insertmacro StrStr ""
  710 +!insertmacro StrStr "un."
  711 +#
  712 +# [un.]IsNT - Pushes 1 if running on NT, 0 if not
  713 +#
  714 +# Example:
  715 +# Call IsNT
  716 +# Pop $0
  717 +# StrCmp $0 1 +3
  718 +# MessageBox MB_OK "Not running on NT!"
  719 +# Goto +2
  720 +# MessageBox MB_OK "Running on NT!"
  721 +#
  722 +!macro IsNT UN
  723 +Function ${UN}IsNT
  724 + Push $0
  725 + ReadRegStr $0 HKLM \
  726 + "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
  727 + StrCmp $0 "" 0 IsNT_yes
  728 + ; we are not NT.
  729 + Pop $0
  730 + Push 0
  731 + Return
  732 +
  733 + IsNT_yes:
  734 + ; NT!!!
  735 + Pop $0
  736 + Push 1
  737 +FunctionEnd
  738 +!macroend
  739 +!insertmacro IsNT ""
  740 +!insertmacro IsNT "un."
  741 +
  742 +;====================================================
  743 +; AddToPath - Adds the given dir to the search path.
  744 +; Input - head of the stack
  745 +; Note - Win9x systems requires reboot
  746 +;====================================================
  747 +Function AddToPath
  748 + Exch $0
  749 + Push $1
  750 + Push $2
  751 +
  752 + Call IsNT
  753 + Pop $1
  754 + StrCmp $1 1 AddToPath_NT
  755 + ; Not on NT
  756 + StrCpy $1 $WINDIR 2
  757 + FileOpen $1 "$1\autoexec.bat" a
  758 + FileSeek $1 0 END
  759 + GetFullPathName /SHORT $0 $0
  760 + FileWrite $1 "$\r$\nSET PATH=%PATH%;$0$\r$\n"
  761 + FileClose $1
  762 + Goto AddToPath_done
  763 +
  764 + AddToPath_NT:
  765 +
  766 + AddToPath_NT_selection_done:
  767 + StrCmp $UserOrSystem "current" read_path_NT_current
  768 + ReadRegStr $1 ${NT_all_env} "PATH"
  769 + Goto read_path_NT_resume
  770 + read_path_NT_current:
  771 + ReadRegStr $1 ${NT_current_env} "PATH"
  772 + read_path_NT_resume:
  773 + StrCpy $2 $0
  774 + StrCmp $1 "" AddToPath_NTdoIt
  775 + StrCpy $2 "$1;$0"
  776 + AddToPath_NTdoIt:
  777 + StrCmp $UserOrSystem "current" write_path_NT_current
  778 + ClearErrors
  779 + WriteRegExpandStr ${NT_all_env} "PATH" $2
  780 + IfErrors 0 write_path_NT_resume
  781 + MessageBox MB_YESNO|MB_ICONQUESTION "The path could not be set for all users$\r$\nShould I try for the current user?" \
  782 + IDNO write_path_NT_failed
  783 + ; change selection
  784 + StrCpy $4 "current"
  785 + Goto AddToPath_NT_selection_done
  786 + write_path_NT_current:
  787 + ClearErrors
  788 + WriteRegExpandStr ${NT_current_env} "PATH" $2
  789 + IfErrors 0 write_path_NT_resume
  790 + MessageBox MB_OK|MB_ICONINFORMATION "The path could not be set for the current user."
  791 + Goto write_path_NT_failed
  792 + write_path_NT_resume:
  793 + SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
  794 + DetailPrint "added path for user ($4), $0"
  795 + write_path_NT_failed:
  796 +
  797 + Pop $4
  798 + AddToPath_done:
  799 + Pop $2
  800 + Pop $1
  801 + Pop $0
  802 +FunctionEnd
  803 +
  804 +;====================================================
  805 +; RemoveFromPath - Remove a given dir from the path
  806 +; Input: head of the stack
  807 +;====================================================
  808 +Function un.RemoveFromPath
  809 + Exch $0
  810 + Push $1
  811 + Push $2
  812 + Push $3
  813 + Push $4
  814 +
  815 + Call un.IsNT
  816 + Pop $1
  817 + StrCmp $1 1 unRemoveFromPath_NT
  818 + ; Not on NT
  819 + StrCpy $1 $WINDIR 2
  820 + FileOpen $1