| 1 | <?xml version="1.0" encoding="UTF-8"?>
|
|---|
| 2 | <!--
|
|---|
| 3 | * LICENCE[[
|
|---|
| 4 | * Version: MPL 1.1/GPL 2.0/LGPL 2.1/CeCILL 2.O
|
|---|
| 5 | *
|
|---|
| 6 | * The contents of this file are subject to the Mozilla Public License Version
|
|---|
| 7 | * 1.1 (the "License"); you may not use this file except in compliance with
|
|---|
| 8 | * the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
|
|---|
| 9 | *
|
|---|
| 10 | * Software distributed under the License is distributed on an "AS IS" basis,
|
|---|
| 11 | * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|---|
| 12 | * for the specific language governing rights and limitations under the
|
|---|
| 13 | * License.
|
|---|
| 14 | *
|
|---|
| 15 | * The Original Code is utc.fr code.
|
|---|
| 16 | *
|
|---|
| 17 | * The Initial Developer of the Original Code is
|
|---|
| 18 | * Universite de Technologie de Compiegne.
|
|---|
| 19 | *
|
|---|
| 20 | * Portions created by the Initial Developer are Copyright (C) 2005
|
|---|
| 21 | * the Initial Developer. All Rights Reserved.
|
|---|
| 22 | *
|
|---|
| 23 | * Contributor(s):
|
|---|
| 24 | *
|
|---|
| 25 | *
|
|---|
| 26 | * Alternatively, the contents of this file may be used under the terms of
|
|---|
| 27 | * either of the GNU General Public License Version 2 or later (the "GPL"),
|
|---|
| 28 | * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|---|
| 29 | * or the CeCILL Licence Version 2.0 (http://www.cecill.info/licences.en.html),
|
|---|
| 30 | * in which case the provisions of the GPL, the LGPL or the CeCILL are applicable
|
|---|
| 31 | * instead of those above. If you wish to allow use of your version of this file
|
|---|
| 32 | * only under the terms of either the GPL or the LGPL, and not to allow others
|
|---|
| 33 | * to use your version of this file under the terms of the MPL, indicate your
|
|---|
| 34 | * decision by deleting the provisions above and replace them with the notice
|
|---|
| 35 | * and other provisions required by the GPL or the LGPL. If you do not delete
|
|---|
| 36 | * the provisions above, a recipient may use your version of this file under
|
|---|
| 37 | * the terms of any one of the MPL, the GPL, the LGPL or the CeCILL.
|
|---|
| 38 | * ]]LICENCE
|
|---|
| 39 | -->
|
|---|
| 40 |
|
|---|
| 41 | <project name="Bui_Nsis" default="All" basedir=".">
|
|---|
| 42 |
|
|---|
| 43 | <!-- Emplacement des sources -->
|
|---|
| 44 | <property name="coreNsisDir" value="${corePackagingDir}/nsis"/>
|
|---|
| 45 | <property name="nsis.execute" value="true"/><!-- Executer les scripts nsis aprés création. Purge également du répertoire temporaire -->
|
|---|
| 46 | <property name="nsis.pathExe" value="${appsdir}/nsis/makensis"/>
|
|---|
| 47 | <property name="nsis.setupDir" value="${basedir}/tmp/setupDir"/>
|
|---|
| 48 | <property name="nsis.configFile" value="${appAbout}"/>
|
|---|
| 49 |
|
|---|
| 50 | <!--***
|
|---|
| 51 | * Main : création des différents fichiers NSIS
|
|---|
| 52 | *-->
|
|---|
| 53 | <target name="package.win" description="permet de creer l'environnement NSIS">
|
|---|
| 54 | <!--
|
|---|
| 55 | A déclarer ds l'appelant:
|
|---|
| 56 | - nsis.setupDir;
|
|---|
| 57 | - nsisFile : file dans lequel on veut concaténer ces propriétés
|
|---|
| 58 | - app.name;
|
|---|
| 59 | - app.version;
|
|---|
| 60 | - app.version(developmentStage);
|
|---|
| 61 | - app.publisher;
|
|---|
| 62 | - app.publisher(url);
|
|---|
| 63 | - appExePath
|
|---|
| 64 | - destapprootdir
|
|---|
| 65 | - destinstallerdir
|
|---|
| 66 | -->
|
|---|
| 67 | <echo message="Packaging WINDOWS"/>
|
|---|
| 68 | <property name="nsis.tmpDir" value="${nsis.setupDir}/tmp"/>
|
|---|
| 69 | <property name="nsis.buildFull" value="${nsis.setupDir}/buildFull.nsi"/>
|
|---|
| 70 | <property name="nsis.buildLibs" value="${nsis.setupDir}/buildLibs.nsi"/>
|
|---|
| 71 | <property name="nsis.buildNoLibs" value="${nsis.setupDir}/buildNoLibs.nsi"/>
|
|---|
| 72 | <!-- Initialisations -->
|
|---|
| 73 | <delete dir="${nsis.tmpDir}"/>
|
|---|
| 74 | <mkdir dir="${nsis.tmpDir}"/>
|
|---|
| 75 |
|
|---|
| 76 | <!-- # S'assurer que les fichiers de licence sont au bon format -->
|
|---|
| 77 | <fixcrlf srcdir="${destapprootdir}" eol="crlf" eof="add" includes="license*"/>
|
|---|
| 78 | |
|---|
| 79 | <foreach target="xAppendToLogFile" param="pNewPath"> |
|---|
| 80 | <param name="pLogFile" value="${destapprootdir}/uninst.log"/> |
|---|
| 81 | <path> |
|---|
| 82 | <dirset dir="${destapprootdir}"> |
|---|
| 83 | <include name="*"/> |
|---|
| 84 | </dirset> |
|---|
| 85 | <fileset dir="${destapprootdir}"> |
|---|
| 86 | <include name="*"/> |
|---|
| 87 | </fileset> |
|---|
| 88 | </path> |
|---|
| 89 | </foreach> |
|---|
| 90 |
|
|---|
| 91 | <concat destfile="${nsis.setupDir}/readme.txt">ATTENTION : les fichiers de ce répertoire sont générés dynamiquement. Vos éventuelles modifications seront perdues lors de la prochaine execution de build.xml .</concat>
|
|---|
| 92 | <!-- # Création du fichier "buildLibs.nsi" -->
|
|---|
| 93 | <concat destfile="${nsis.buildLibs}">!define INSTALLER_NAME_SUFFIX "Libs"</concat>
|
|---|
| 94 | <ant target="xCreateNsisConfigSection"><property name="nsisFile" value="${nsis.buildLibs}"/></ant>
|
|---|
| 95 | <concat destfile="${nsis.buildLibs}" append="true">
|
|---|
| 96 | <fileset dir="${coreNsisDir}" includes="common.nsi"/>
|
|---|
| 97 | <fileset dir="${coreNsisDir}" includes="libs.nsi"/>
|
|---|
| 98 | </concat>
|
|---|
| 99 | <!-- # Création du fichier "buildNoLibs.nsi" -->
|
|---|
| 100 | <concat destfile="${nsis.buildNoLibs}">
|
|---|
| 101 | !define BUILD_TYPE "NoLibs"
|
|---|
| 102 | !define INSTALLER_NAME_SUFFIX "${BUILD_TYPE}"
|
|---|
| 103 | !define COPY_OPTIONS "/r /x jre /x xulrunner"
|
|---|
| 104 | </concat><!-- /x javalib -->
|
|---|
| 105 | <ant target="xCreateNsisConfigSection"><property name="nsisFile" value="${nsis.buildNoLibs}"/></ant>
|
|---|
| 106 | <concat destfile="${nsis.buildNoLibs}" append="true">
|
|---|
| 107 | <fileset dir="${coreNsisDir}" includes="common.nsi"/>
|
|---|
| 108 | </concat>
|
|---|
| 109 | <ant target="xCreateNsisInstallerSection"><property name="nsisFile" value="${nsis.buildNoLibs}"/></ant>
|
|---|
| 110 | <!-- # Création du fichier "buildFull.nsi" -->
|
|---|
| 111 | <concat destfile="${nsis.buildFull}">
|
|---|
| 112 | !define BUILD_TYPE "Full"
|
|---|
| 113 | !define INSTALLER_NAME_SUFFIX "${BUILD_TYPE}"
|
|---|
| 114 | !define COPY_OPTIONS "/r"
|
|---|
| 115 | </concat>
|
|---|
| 116 | <ant target="xCreateNsisConfigSection"><property name="nsisFile" value="${nsis.buildFull}"/></ant>
|
|---|
| 117 | <concat destfile="${nsis.buildFull}" append="true">
|
|---|
| 118 | <fileset dir="${coreNsisDir}" includes="common.nsi"/>
|
|---|
| 119 | </concat>
|
|---|
| 120 | <ant target="xCreateNsisInstallerSection"><property name="nsisFile" value="${nsis.buildFull}"/></ant>
|
|---|
| 121 |
|
|---|
| 122 | <!-- # Execution de ces sripts -->
|
|---|
| 123 | <echo message="Execution des scripts NSIS"/>
|
|---|
| 124 | <ant target="xCompilNsis"/>
|
|---|
| 125 | </target> |
|---|
| 126 | |
|---|
| 127 | <!--** |
|---|
| 128 | * Ajoute une path à un fichier de log (création du fichier uninst.log) |
|---|
| 129 | **--> |
|---|
| 130 | <target name="xAppendToLogFile" description=""> |
|---|
| 131 | <basename property="vBaseName" file="${pNewPath}"/> |
|---|
| 132 | <concat destfile="${pLogFile}" append="yes">${vBaseName} |
|---|
| 133 | </concat> |
|---|
| 134 | </target> |
|---|
| 135 | |
|---|
| 136 | <!--** |
|---|
| 137 | * Execute les scripts NSIS SSi nsis.execute=true |
|---|
| 138 | **--> |
|---|
| 139 | <target name="xCompilNsis" description="Execute les scripts NSIS"> |
|---|
| 140 | <if>
|
|---|
| 141 | <equals arg1="${nsis.execute}" arg2="true"/><!-- création de tous les installeurs -->
|
|---|
| 142 | <then>
|
|---|
| 143 | <echo>${nsis.setupDir} ${nsis.pathExe}</echo>
|
|---|
| 144 | <exec dir="${nsis.setupDir}" executable="${nsis.pathExe}">
|
|---|
| 145 | <arg line="${nsis.setupDir}/buildFull.nsi"/>
|
|---|
| 146 | </exec>
|
|---|
| 147 | <exec dir="${nsis.setupDir}" executable="${nsis.pathExe}">
|
|---|
| 148 | <arg line="${nsis.setupDir}/buildNoLibs.nsi"/>
|
|---|
| 149 | </exec>
|
|---|
| 150 | </then>
|
|---|
| 151 | <elseif>
|
|---|
| 152 | <equals arg1="${nsis.execute}" arg2="fullOnly"/><!-- création que de l'installeur full seul -->
|
|---|
| 153 | <then>
|
|---|
| 154 | <echo>${nsis.setupDir} ${nsis.pathExe}</echo>
|
|---|
| 155 | <exec dir="${nsis.setupDir}" executable="${nsis.pathExe}">
|
|---|
| 156 | <arg line="${nsis.setupDir}/buildFull.nsi"/>
|
|---|
| 157 | </exec>
|
|---|
| 158 | </then>
|
|---|
| 159 | </elseif>
|
|---|
| 160 | <elseif>
|
|---|
| 161 | <equals arg1="${nsis.execute}" arg2="nolibsOnly"/><!-- création que de l'installeur nolibs seul -->
|
|---|
| 162 | <then>
|
|---|
| 163 | <echo>${nsis.setupDir} ${nsis.pathExe}</echo>
|
|---|
| 164 | <exec dir="${nsis.setupDir}" executable="${nsis.pathExe}">
|
|---|
| 165 | <arg line="${nsis.setupDir}/buildNoLibs.nsi"/>
|
|---|
| 166 | </exec>
|
|---|
| 167 | </then>
|
|---|
| 168 | </elseif>
|
|---|
| 169 | </if>
|
|---|
| 170 | <!-- # suppression du répertoires ou ces scripts ont été créés -->
|
|---|
| 171 | <delete dir="${nsis.setupDir}"/>
|
|---|
| 172 | </target>
|
|---|
| 173 |
|
|---|
| 174 | <!--**
|
|---|
| 175 | * Création de la partie "variables de paramétrage" des fichiers NSIS
|
|---|
| 176 | **-->
|
|---|
| 177 | <target name="xCreateNsisConfigSection" description="création des éléments de paramétrage de l'installeur">
|
|---|
| 178 | <!--
|
|---|
| 179 | A déclarer ds l'appelant:
|
|---|
| 180 | - nsisFile : file dans lequel on veut concaténer ces propriétés
|
|---|
| 181 | - app.name;
|
|---|
| 182 | - app.version;
|
|---|
| 183 | - app.version(developmentStage);
|
|---|
| 184 | - app.publisher;
|
|---|
| 185 | - app.projectName
|
|---|
| 186 | - app.publisher(url);
|
|---|
| 187 | - appExePath
|
|---|
| 188 | - destapprootdir
|
|---|
| 189 | - destinstallerdir
|
|---|
| 190 | - fileInputExt
|
|---|
| 191 | - fileInputDesc
|
|---|
| 192 | - fileOutputExt
|
|---|
| 193 | - fileOutputDesc
|
|---|
| 194 | -->
|
|---|
| 195 | <ant target="app.projectName.define"/>
|
|---|
| 196 | <concat destfile="${nsisFile}" append="true">
|
|---|
| 197 | ; Debug mode : compression normale, pas de autoclose sur inst et uninst. |
|---|
| 198 | ; !define DEBUG_MODE "" |
|---|
| 199 | |
|---|
| 200 | ;=== Product desc constants |
|---|
| 201 | !define PRODUCT_NAME "${app.name}" |
|---|
| 202 | !define PRODUCT_NAME_FULL "${app.name} ${app.version(major)}.${app.version(medium)}"
|
|---|
| 203 |
|
|---|
| 204 | !define PRODUCT_VERSION "${app.version(major)}.${app.version(medium)}"
|
|---|
| 205 | !define PRODUCT_VERSION_FULL "${app.version}"
|
|---|
| 206 | !define PRODUCT_VERSION_FULL_H "${app.version(full)}"
|
|---|
| 207 |
|
|---|
| 208 | !define PRODUCT_INSTALLPATH "${app.publisher}\${app.name}${app.version(major)}.${app.version(medium)}"
|
|---|
| 209 | !define PRODUCT_ID "${app.name(shortName)}${app.version(major)}.${app.version(medium)}"
|
|---|
| 210 | !define PRODUCT_PROFILE "${app.profile(name)}"
|
|---|
| 211 |
|
|---|
| 212 | !define PRODUCT_DEVELOPMENT_STAGE "${app.version(developmentStage)}"
|
|---|
| 213 | !define PRODUCT_PUBLISHER "${app.publisher}"
|
|---|
| 214 | !define PRODUCT_WEB_SITE "${app.publisher(url)}" |
|---|
| 215 | !define PRODUCT_DESC "${app.description}" |
|---|
| 216 | !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\${PRODUCT_ID}.exe"
|
|---|
| 217 | !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_ID}"
|
|---|
| 218 | !define PRODUCT_UNINST_ROOT_KEY "HKLM"
|
|---|
| 219 | !define PRODUCT_LICENCE "${destapprootdir}\${license.app.filename}"
|
|---|
| 220 | !define PRODUCT_EXE "$INSTDIR\${appExePath}"
|
|---|
| 221 | !define PRODUCT_DATA "${destapprootdir}"
|
|---|
| 222 | !define PRODUCT_OUTDIR "${destinstallerdir}"
|
|---|
| 223 |
|
|---|
| 224 | !define PRODUCT_LANGUAGE "${app.localization(target)}"
|
|---|
| 225 |
|
|---|
| 226 | !define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
|
|---|
| 227 |
|
|---|
| 228 | ;=== File type association config |
|---|
| 229 | !define PRODUCT_FILE_TYPE "${app.name}${app.version(major)}.${app.version(medium)}" |
|---|
| 230 | |
|---|
| 231 | !define FILE_INPUT_EXT ".${fileInputExt}"
|
|---|
| 232 | !define FILE_INPUT_TYPE "${PRODUCT_FILE_TYPE}.${fileInputExt}"
|
|---|
| 233 | !define FILE_INPUT_DESC "${fileInputDesc}" |
|---|
| 234 | !define FILE_INPUT_PRIORITY "${fileInputPriority}" |
|---|
| 235 | !define SHORTCUT_INPUT_ICO "${shortcutFileInputIco}"
|
|---|
| 236 |
|
|---|
| 237 | !define FILE_OUTPUT_EXT ".${fileOutputExt}"
|
|---|
| 238 | !define FILE_OUTPUT_TYPE "${PRODUCT_FILE_TYPE}.${fileOutputExt}"
|
|---|
| 239 | !define FILE_OUTPUT_DESC "${fileOutputDesc}"
|
|---|
| 240 | !define FILE_OUTPUT_PRIORITY "${fileOutputPriority}" |
|---|
| 241 | !define SHORTCUT_OUTPUT_ICO "${shortcutFileOutputIco}"
|
|---|
| 242 |
|
|---|
| 243 | !define FILE_RES1_EXT ".${fileRes1Ext}"
|
|---|
| 244 | !define FILE_RES1_TYPE "${PRODUCT_FILE_TYPE}.${fileRes1Ext}"
|
|---|
| 245 | !define FILE_RES1_DESC "${fileRes1Desc}"
|
|---|
| 246 | !define FILE_RES1_PRIORITY "${fileRes1Priority}" |
|---|
| 247 | !define SHORTCUT_RES1_ICO "${shortcutFileRes1Ico}"
|
|---|
| 248 |
|
|---|
| 249 | !define SHORTCUT_ICON_DEST_PATH "${shortcutIconDestPath}"
|
|---|
| 250 |
|
|---|
| 251 | ;=== Installer graphical config
|
|---|
| 252 | !define MUI_WELCOMEFINISHPAGE_BITMAP "${installerResDir}\vsplash.bmp"
|
|---|
| 253 | !define MUI_ICON "${installerResDir}\install.ico"
|
|---|
| 254 | !define MUI_UNICON "${installerResDir}\uninstall.ico"
|
|---|
| 255 |
|
|---|
| 256 | </concat>
|
|---|
| 257 | </target>
|
|---|
| 258 | <target name="app.projectName.define" if="app.projectName">
|
|---|
| 259 | <concat destfile="${nsisFile}" append="true">
|
|---|
| 260 | !define PROJECT_NAME "${app.projectName}"
|
|---|
| 261 | </concat>
|
|---|
| 262 | </target>
|
|---|
| 263 |
|
|---|
| 264 | <!--**
|
|---|
| 265 | * Création des fenetres d'installation des sripts NSIS (Full et NoLibs)
|
|---|
| 266 | **-->
|
|---|
| 267 | <target name="xCreateNsisInstallerSection" description="création de l'environnement d'installation">
|
|---|
| 268 | <!--
|
|---|
| 269 | A déclarer ds l'appelant:
|
|---|
| 270 | - nsisFile : file dans lequel on veut concaténer ces propriétés
|
|---|
| 271 | - nsis.configFile
|
|---|
| 272 | - nsis.tmpDir
|
|---|
| 273 | -->
|
|---|
| 274 | <xslt in="${nsis.configFile}" out="${nsis.tmpDir}/installer.nsi" style="${coreNsisDir}/installer.nsi.xsl">
|
|---|
| 275 | <outputproperty name="method" value="text"/>
|
|---|
| 276 | <param name="genModelsDir" expression="${nsis.tmpDir}/wsppacks"/>
|
|---|
| 277 | </xslt>
|
|---|
| 278 | <xslt in="${nsis.configFile}" out="${nsis.setupDir}/locales/lang_en.nsh" style="${coreNsisDir}/locales/lang_en.nsh.xsl">
|
|---|
| 279 | <outputproperty name="method" value="text"/>
|
|---|
| 280 | </xslt>
|
|---|
| 281 | <xslt in="${nsis.configFile}" out="${nsis.setupDir}/locales/lang_fr.nsh" style="${coreNsisDir}/locales/lang_fr.nsh.xsl">
|
|---|
| 282 | <outputproperty name="method" value="text"/>
|
|---|
| 283 | </xslt> |
|---|
| 284 | <copydir src="${coreNsisDir}/includes" dest="${nsis.setupDir}/includes"/>
|
|---|
| 285 | <xslt in="${nsis.configFile}" out="${nsis.tmpDir}/compilWspPacks.ant" style="${coreNsisDir}/compilWspPacks.ant.xsl">
|
|---|
| 286 | <outputproperty name="method" value="xml"/>
|
|---|
| 287 | <param name="genModelsDir" expression="${nsis.tmpDir}/wsppacks"/>
|
|---|
| 288 | </xslt>
|
|---|
| 289 | <ant antfile="${nsis.tmpDir}/compilWspPacks.ant"/>
|
|---|
| 290 | <concat destfile="${nsisFile}" append="true">
|
|---|
| 291 | <fileset dir="${nsis.tmpDir}" includes="installer.nsi"/>
|
|---|
| 292 | </concat>
|
|---|
| 293 | </target>
|
|---|
| 294 |
|
|---|
| 295 | </project>
|
|---|
| 296 |
|
|---|