dion 2004/07/04 22:29:02 Modified: nsis/xdocs customizing.xml Log: Details on the scripts available for customising the default templates Revision Changes Path 1.4 +81 -0 maven-plugins/nsis/xdocs/customizing.xml Index: customizing.xml =================================================================== RCS file: /home/cvs/maven-plugins/nsis/xdocs/customizing.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- customizing.xml 5 Jul 2004 04:45:42 -0000 1.3 +++ customizing.xml 5 Jul 2004 05:29:02 -0000 1.4 @@ -171,6 +171,87 @@ </section> <section name="Default Template Scripts"> + <p> + There are several .nsh files that you can place in <code>${maven.nsis.src}</code> + 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. + </p> + + <subsection name="before-install.nsh"> + <p> + This file is used to do any pre-installation checks. It can hold any + <a href="http://nsis.sourceforge.net/Docs/">valid NSIS code</a>. + </p> + <p> + One example is to check the environment has been correctly set up, e.g. + </p> + <source>Call AssertJavaHome</source> + <p> + This will check, using the function provided in <code>JDK.nsh</code>, + that an environment variable for <code>JAVA_HOME</code> is available, + and abort the installation if it's not. + </p> + </subsection> + + <subsection name="desktop-shortcuts.nsh"> + <p> + 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. + </p> + <p> + As always, see the <a href="http://nsis.sourceforge.net/Docs/">NSIS docs</a> + for details on the code to use. The example below creates a shortcut + on the desktop to <code>maven.bat</code> from the installation directory + the user has chosen. + </p> + <source>CreateShortCut "$DESKTOP\Maven.lnk" "$INSTDIR\bin\maven.bat" "" "$INSTDIR\bin\maven.bat" 0</source> + </subsection> + + <subsection name="registry.nsh"> + <p> + 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 <code>MYAPP_HOME</code> + with the value of the installation directory. + </p> + <source> +Push "MYAPP_HOME" +Push "$INSTDIR" +Call WriteEnvStr +</source> + <p> + Note: this relies on the included functions from <code>Environment.nsh</code>. + </p> + </subsection> + + <subsection name="registry-uninstall.nsh"> + <p> + 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 <code>MYAPP_HOME</code>. + </p> + <source> +Push "MYAPP_HOME" +Call un.DeleteEnvStr + </source> + </subsection> + + <subsection name="startmenu-shortcuts.nsh"> + <p> + If you provide this file, the installer will allow the user to choose + whether or not to create shortcuts in the <code>Start Menu</code>. + The shortcuts specified in this file will be created. + </p> + <source> +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" + </source> + </subsection> + </section> <section name="Custom Templates">
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]