diff --git a/nsis/xdocs/customizing.xml b/nsis/xdocs/customizing.xml index ae38ed02..1ff1ac2a 100644 --- a/nsis/xdocs/customizing.xml +++ b/nsis/xdocs/customizing.xml @@ -171,6 +171,87 @@
+

+ There are several .nsh files that you can place in ${maven.nsis.src} + directory to add functionality to the installer. In this section, we'll look + at an example for each of the scripts included by the default template that + will be overridden. +

+ + +

+ This file is used to do any pre-installation checks. It can hold any + valid NSIS code. +

+

+ One example is to check the environment has been correctly set up, e.g. +

+ Call AssertJavaHome +

+ This will check, using the function provided in JDK.nsh, + that an environment variable for JAVA_HOME is available, + and abort the installation if it's not. +

+
+ + +

+ If you provide this file, the installer will allow the user to choose + whether or not to create shortcuts on the desktop. The shortcuts specified + in this file will be created. +

+

+ As always, see the NSIS docs + for details on the code to use. The example below creates a shortcut + on the desktop to maven.bat from the installation directory + the user has chosen. +

+ CreateShortCut "$DESKTOP\Maven.lnk" "$INSTDIR\bin\maven.bat" "" "$INSTDIR\bin\maven.bat" 0 +
+ + +

+ During installation, you may want to add entries to the user's registry + or environment for use either in your application, the installation process, or uninstall. + Here's a small example that adds an environment variable called MYAPP_HOME + with the value of the installation directory. +

+ +Push "MYAPP_HOME" +Push "$INSTDIR" +Call WriteEnvStr + +

+ Note: this relies on the included functions from Environment.nsh. +

+
+ + +

+ During uninstallation, you must remove any entries to the user's registry + or environment. Here's a small example that removes an environment variable + called MYAPP_HOME. +

+ +Push "MYAPP_HOME" +Call un.DeleteEnvStr + +
+ + +

+ If you provide this file, the installer will allow the user to choose + whether or not to create shortcuts in the Start Menu. + The shortcuts specified in this file will be created. +

+ +CreateShortCut "${PROJECT_STARTMENU_FOLDER}\Myapp.lnk" "$INSTDIR\bin\myapp.bat" "" "$INSTDIR\bin\myapp.bat" 0 +CreateShortCut "${PROJECT_STARTMENU_FOLDER}\Uninstall.lnk" "$INSTDIR\Uninst.exe" "" "$INSTDIR\Uninst.exe" 0 +CreateShortCut "${PROJECT_STARTMENU_FOLDER}\Homepage.lnk" "http://www.myapp.nfi/" +CreateShortCut "${PROJECT_STARTMENU_FOLDER}\User Guide.lnk" "http://www.myapp.nfi/user-guide.html" + +
+