|
6 | 6 | <import file="${basedir}/ant/signing.xml"/> |
7 | 7 | <property environment="env"/> |
8 | 8 |
|
9 | | - <target name="build-exe" depends="get-version,platform-detect"> |
| 9 | + <target name="copy-nsis-plugins" depends="find-nsisbin"> |
| 10 | + <property name="plugins.path" value="${out.dir}/nsis/Plugins"/> |
| 11 | + <mkdir dir="${plugins.path}"/> |
| 12 | + |
| 13 | + <!-- |
| 14 | + ======================== |
| 15 | + Project-specific Plugins |
| 16 | + ======================== |
| 17 | + --> |
| 18 | + <echo message="Copying NSIS project-specific Plugins: ant/windows/nsis/Plugins"/> |
| 19 | + <copy todir="${plugins.path}" verbose="true"> |
| 20 | + <fileset dir="ant/windows/nsis/Plugins"> |
| 21 | + <include name="**/*.dll"/> |
| 22 | + <include name="**/*.exe"/> |
| 23 | + </fileset> |
| 24 | + </copy> |
| 25 | + |
| 26 | + <!-- |
| 27 | + =================== |
| 28 | + System-wide Plugins |
| 29 | + =================== |
| 30 | + --> |
| 31 | + <!-- Call makensis -HDRINFO to get environment details --> |
| 32 | + <exec executable="${nsisbin}" outputproperty="nsisbin.output"> |
| 33 | + <arg value="-HDRINFO"/> |
| 34 | + </exec> |
| 35 | + |
| 36 | + <!-- Extract "NSISDIR" --> |
| 37 | + <loadresource property="nsisdir.path"> |
| 38 | + <propertyresource name="nsisbin.output"/> |
| 39 | + <filterchain> |
| 40 | + <linecontainsregexp> |
| 41 | + <regexp pattern="NSISDIR="/> |
| 42 | + </linecontainsregexp> |
| 43 | + <replaceregex pattern=".*NSISDIR=([^,]+).*" replace="\1" flags="s"/> |
| 44 | + <striplinebreaks/> |
| 45 | + </filterchain> |
| 46 | + </loadresource> |
| 47 | + <property name="nsisdir.path" value="error occurred" description="fallback value"/> |
| 48 | + |
| 49 | + <!-- Merge system-wide "x86-unicode" files directly into "Release_Unicode" --> |
| 50 | + <echo message="Copying NSIS system-wide Plugins: ${nsisdir.path}/Plugins"/> |
| 51 | + <copy todir="${plugins.path}/Release_Unicode" verbose="true" overwrite="false"> |
| 52 | + <fileset dir="${nsisdir.path}/Plugins"> |
| 53 | + <include name="**/*-unicode/*.*"/> |
| 54 | + </fileset> |
| 55 | + <mapper type="flatten"/> |
| 56 | + </copy> |
| 57 | + |
| 58 | + <!-- Merge system-wide "x86-ansi" files directly into "Release_ANSI" --> |
| 59 | + <copy todir="${plugins.path}/Release_ANSI" verbose="true" overwrite="false"> |
| 60 | + <fileset dir="${nsisdir.path}/Plugins"> |
| 61 | + <include name="**/*-ansi/*.*"/> |
| 62 | + </fileset> |
| 63 | + <mapper type="flatten"/> |
| 64 | + </copy> |
| 65 | + </target> |
| 66 | + |
| 67 | + <target name="sign-nsis-plugins" depends="copy-nsis-plugins"> |
| 68 | + <!-- Sign Plugins before NSIS bundles them --> |
| 69 | + <fileset dir="${plugins.path}" id="plugins.dlls"> |
| 70 | + <include name="**/*.dll"/> |
| 71 | + <include name="**/*.exe"/> |
| 72 | + </fileset> |
| 73 | + |
| 74 | + <!-- Pass all files at once, wrapped in quotes --> |
| 75 | + <pathconvert pathsep="" "" property="plugins.dlls.separated" refid="plugins.dlls"/> |
| 76 | + <antcall target="sign-file"> |
| 77 | + <param name="sign.file" value=""${plugins.dlls.separated}""/> |
| 78 | + </antcall> |
| 79 | + </target> |
| 80 | + |
| 81 | + <target name="build-exe" depends="get-version,platform-detect,sign-nsis-plugins"> |
10 | 82 | <!-- Get the os-preferred name for the target architecture --> |
11 | 83 | <condition property="windows.target.arch" value="arm64"> |
12 | 84 | <isset property="target.arch.aarch64"/> |
|
0 commit comments