diff --git a/nsis/src/plugin-resources/templates/setup.jelly b/nsis/src/plugin-resources/templates/setup.jelly
index 554f4906..c491f0c8 100644
--- a/nsis/src/plugin-resources/templates/setup.jelly
+++ b/nsis/src/plugin-resources/templates/setup.jelly
@@ -75,46 +75,31 @@ Section "$${PROJECT_NAME} v$${PROJECT_VERSION} Binaries"
; Write the installation path into the registry
WriteRegStr HKLM "$${PROJECT_REG_KEY}" "Install_Dir" "$$INSTDIR"
-
- ; Write the environment variables to the Registry
- ; FIXME: This should be a project include.
- ; $${MAVEN_HOME}
- Push "MAVEN_HOME"
- Push "$$INSTDIR"
- Call WriteEnvStr
- ; TODO - Add MAVEN_HOME to the path
-
- ; TODO Prompt and write other environment variables to the Registry
- ; WriteRegStr HKCU "Environment" "MAVEN_LOCAL_HOME" "$$INSTDIR"
+ ; Write the environment variables to the Registry
+
+ !include "registry.nsh"
+
; Write the uninstall keys for Windows
WriteRegStr HKLM "$${PROJECT_REG_UNINSTALL_KEY}" "DisplayName" "$${PROJECT_NAME} $${PROJECT_VERSION} (remove only)"
WriteRegStr HKLM "$${PROJECT_REG_UNINSTALL_KEY}" "UninstallString" '"$$INSTDIR\Uninst.exe"'
SectionEnd
+
; -------------------------------------------------------------- Create Shortcuts
Section "Create Start Menu Shortcut(s)"
CreateDirectory "$${PROJECT_STARTMENU_FOLDER}"
-; it would be nice to get all this from navigation.xml :-)
-; FIXME: This should be a project include.
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Maven.lnk" "$$INSTDIR\bin\maven.bat" "" "$$INSTDIR\bin\maven.bat" 0
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Install Maven Repository.lnk" "$$INSTDIR\bin\install_repo.bat" "" "$$INSTDIR\install_repo.bat" 0
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Uninstall.lnk" "$$INSTDIR\Uninst.exe" "" "$$INSTDIR\Uninst.exe" 0
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Homepage.lnk" "http://maven.apache.org/"
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\User Guide.lnk" "http://maven.apache.org/reference/user-guide.html"
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Core Plugins.lnk" "http://maven.apache.org/reference/plugins/core-plugins.html"
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Optional Plugins.lnk" "http://maven.apache.org/reference/plugins/optional/optional.html"
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Reference.lnk" "http://maven.apache.org/reference/index.html"
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Report a Bug.lnk" "http://jira.codehaus.org/secure/BrowseProject.jspa?id=10030"
- CreateShortCut "$${PROJECT_STARTMENU_FOLDER}\Frequently Asked Questions.lnk" "http://maven.apache.org/faq.html"
+ !include "startmenu-shortcuts.nsh"
SectionEnd
+
-; FIXME: This should be a project include.
+
; OPTIONAL Desktop Shortcut
-; Section "Create Desktop Shortcut"
-; CreateShortCut "$$DESKTOP\Maven.lnk" "$$INSTDIR\bin\maven.bat" "" "$$INSTDIR\bin\maven.bat"
+Section "Create Desktop Shortcut"
+ !include "desktop-shortcuts.nsh"
;SectionEnd
+
; -------------------------------------------------------------- Section to Install the Uninstaller
Section "Install Uninstaller"
@@ -128,10 +113,9 @@ Section "Uninstall"
DeleteRegKey HKLM "$${PROJECT_REG_UNINSTALL_KEY}"
DeleteRegKey HKLM "$${PROJECT_REG_KEY}"
- ; FIXME: This should be a project include.
- ; Remove $${MAVEN_HOME}
- Push "MAVEN_HOME"
- Call un.DeleteEnvStr
+
+ !include "registry-uninstall.nsh"
+
; remove files
Delete $$INSTDIR\*.*
@@ -142,10 +126,12 @@ Section "Uninstall"
; remove shortcuts, if any.
Delete "$${PROJECT_STARTMENU_FOLDER}\*.*"
RMDir "$${PROJECT_STARTMENU_FOLDER}"
- ; Delete "$$DESKTOP\Maven.lnk"
+ ; Delete "$$DESKTOP\$${PROJECT_NAME}.lnk"
+
; Recursively remove files and directories used
; this should also take care of the installer
RMDir /r "$$INSTDIR"
+
MessageBox MB_OK|MB_ICONEXCLAMATION "$${PROJECT_NAME} has been uninstalled"
SectionEnd
@@ -153,18 +139,16 @@ SectionEnd
Function .onGUIInit
!ifdef PROJECT_LOGO
!insertmacro BrandingImage "$${PROJECT_LOGO}" ""
- ; FIXME: Make an include
- ; TODO Check for a JAVA_HOME environment variable
- Call AssertJavaHome
!endif
-
+
+ !include "before-install.nsh"
+
FunctionEnd
; add the logo to the un-installer
Function un.onGUIInit
!ifdef PROJECT_LOGO
!insertmacro BrandingImage "$${PROJECT_LOGO}" ""
- ; FIXME: Make an include
!endif
FunctionEnd