source: versions/3.5.201/Bui_postPackWin/build.xml @ 10673

Revision 10673, 7.2 KB checked in by sam, 4 years ago (diff)

postPack Win : si pas de licence alors pas de page de licence (trunk)

  • Property svn:mime-type set to text/plain
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
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 kelis.fr code.
16 *
17 * The Initial Developer of the Original Code is
18 * samuel.monsarrat@kelis.fr
19 *
20 * Portions created by the Initial Developer are Copyright (C) 2007
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<project name="Bui_postPackWin.core" default="All.appNoDefine" basedir=".">
41        <import file="${basedir}/properties.xml"/>
42
43        <!-- Post packaging work folder -->
44        <property name="app.work.path" value="${releasedir}/postPackWin/${appFolder}"/>
45
46        <!-- Post packaging source folder -->
47        <property name="app.src.path" value="${app.work.path}/src"/>
48
49        <!-- Post packaging build folder -->
50        <property name="app.bui.path" value="${app.work.path}/bui"/>
51       
52        <property name="nsi.installer" value="${app.bui.path}/installer.nsi"/>
53        <property name="nsi.locales.path" value="${basedir}/resources/locales"/>
54       
55        <!-- Run principal -->
56        <target name="All.appNoDefine">
57                <echo message="Aucune application n'est spécifié. Veuillez lancer le build.xml des sous projets." level="error"/>
58        </target>
59
60        <target name="main.package">
61                <echo message="Post-packaging Windows de l'scApp ${app.zip.path}"/>
62                <antcall target="xInit"/>
63                <antcall target="xCreateNsi"/>
64                <antcall target="xExecuteNsi"/>
65
66                <!-- Cleanup
67                <antcall target="xCleanup.core"/> -->
68        </target>
69
70        <target name="xInit" description="Init : décompression et préparation">
71                <echo message="Init : décompression de ${app.zip.path}"/>
72                <fail message="ATTENTION: le paramètre nsi.bin.path ne semble pas pointer pas vers un exécutable makensis, avez-vous bien installé NSIS ?">
73                        <condition><not><or><available file="${nsi.bin.path}" type="file"/><available file="${nsi.bin.path}.exe" type="file"/></or></not></condition>
74                </fail>
75               
76                <delete dir="${app.bui.path}"/>
77                <unzip src="${app.zip.path}" dest="${app.bui.path}/${app.name}"/>
78               
79                <if><not><equals arg1="${app.embed.oo}" arg2="none"/></not>
80                        <then>
81                                <echo message="Init : Embeding ${app.embed.oo} OpenOffice..."/>
82                                <unzip src="${basedir}/resources/openoffice/OOo.${app.embed.oo}.zip" dest="${app.bui.path}/${app.name}/bin"/>
83                                <concat destfile="${app.bui.path}/${app.name}/bin/${app.clientName}/defaults/preferences/confGeneral.js" append="true" encoding="ISO-8859-1">
84pref("scenari.tools.oo.dirMode", 1);
85pref("scenari.tools.oo.embed.path", "OOo\\program");
86</concat>
87                                <concat destfile="${app.bui.path}/${app.name}/bin/OOo/program/bootstrap.ini" append="true" encoding="ISO-8859-1">
88ProductKey=oo${app.name}${app.version(major)}.${app.version(medium)}
89UserInstallation=$SYSUSERCONFIG/${app.publisher}/${app.profile(name)}/OOo
90</concat>
91                        </then>
92                </if>
93               
94               
95                <foreach target="xAppendToLogFile" param="pNewPath">
96                        <param name="pLogFile" value="${app.bui.path}/${app.name}/uninst.log"/>
97                        <path>
98                                <dirset dir="${app.bui.path}/${app.name}">
99                                        <include name="*"/>
100                                </dirset>
101                                <fileset dir="${app.bui.path}/${app.name}">
102                                        <include name="*"/>
103                                </fileset>
104                        </path>
105                </foreach>
106        </target>
107       
108        <target name="xAppendToLogFile" description="">
109                <basename property="vBaseName" file="${pNewPath}"/>
110                <concat destfile="${pLogFile}" append="yes">${vBaseName}
111</concat>
112        </target>
113       
114        <target name="xCleanup.core" description="Cleanup">
115                <delete dir="${app.work.path}"/>
116        </target>
117       
118        <target name="xCreateNsi" description="création du script NSI de l'installeur">
119                <echo message="création du script NSI de l'installeur"/>
120                <antcall target="xCreateNsiConfig"/>
121                <concat destfile="${nsi.installer}" append="true">
122                        <fileset dir="${basedir}/resources" includes="installer.nsi"/>
123                </concat>
124        </target>
125
126        <target name="xCreateNsiConfig" description="création des éléments de paramétrage de l'installeur">
127                <tstamp>
128                        <format property="ts" pattern="yyMMdd-HHmm"/>
129                </tstamp>
130                <concat destfile="${nsi.installer}" append="true">
131!define APP_NAME "${app.name}"
132!define APP_NAME_FULL "${app.name} ${app.version(major)}.${app.version(medium)}"
133!define APP_VERSION_MAX_MED "${app.version(major)}.${app.version(medium)}"
134!define APP_VERSION_FULL "${app.version}"
135!define APP_INSTALLPATH "${app.name}${app.version(major)}.${app.version(medium)}"
136!define APP_UID "${app.profile(name)}"
137!define APP_PROFILE "${app.profile(name)}"
138!define APP_PUBLISHER "${app.publisher}"
139!define APP_URL "${app(url)}"
140!define APP_DESC "${app.description}"
141!define TS "${ts}"
142!define SCAPP_RES_PATH "${app.res.path}"
143!define SCAPP_SRC_PATH "${scapp.src.path}/_win"
144!define NSI_LOCALES_PATH "${nsi.locales.path}"
145!define OUTPUT_PATH "${releasedir}"
146!define LANG_EN "${nsi.lang.en}"
147!define LANG_FR "${nsi.lang.fr}"
148!define APP_EMBED_OO "${app.embed.oo}"
149                </concat>
150                <if><available file="${scapp.src.path}/_win/license.txt" type="file"/>
151                        <then>
152                                <concat destfile="${nsi.installer}" append="true">!define PRODUCT_LICENCE "${SCAPP_SRC_PATH}/license.txt"
153</concat>
154                        </then>
155                </if>
156                <if><available file="${app.res.path}/instbkgnd.bmp" type="file"/>
157                        <then>
158                                <concat destfile="${nsi.installer}" append="true">!define MUI_WELCOMEFINISHPAGE_BITMAP "${SCAPP_RES_PATH}/instbkgnd.bmp"
159</concat>
160                        </then>
161                </if>
162                <if><available file="${app.res.path}/install.ico" type="file"/>
163                        <then>
164                                <concat destfile="${nsi.installer}" append="true">!define MUI_ICON "${SCAPP_RES_PATH}/install.ico"
165</concat>
166                        </then>
167                </if>
168                <if><available file="${app.res.path}/uninstall.ico" type="file"/>
169                        <then>
170                                <concat destfile="${nsi.installer}" append="true">!define MUI_UNICON "${SCAPP_RES_PATH}/uninstall.ico"
171</concat>
172                        </then>
173                </if>
174        </target>
175
176        <target name="xExecuteNsi" description="Exécution du script NSI">
177                <echo message="Exécution du script NSI"/>
178                <exec dir="${basedir}" executable="${nsi.bin.path}">
179                        <arg line="${nsi.installer}"/>
180                </exec>
181        </target>
182</project>
Note: See TracBrowser for help on using the repository browser.