You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2025/02/13 17:10:52 UTC
(tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 1dc412b8b0 Add makensis as an option for building the Windows installer
1dc412b8b0 is described below
commit 1dc412b8b0fe55cb0a994fc26bb995b7e02d4599
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Feb 12 10:14:58 2025 +0000
Add makensis as an option for building the Windows installer
---
BUILDING.txt | 78 ++++++++++++++++++++---
build.properties.default | 3 +
build.xml | 154 ++++++++++++++++++++++++---------------------
res/install-win/tomcat.nsi | 37 +++--------
webapps/docs/changelog.xml | 8 +++
5 files changed, 170 insertions(+), 110 deletions(-)
diff --git a/BUILDING.txt b/BUILDING.txt
index 4fd85f1266..b45b83a72e 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -248,19 +248,42 @@ You can build them by using the following commands:
cd ${tomcat.source}
ant embed
+(5.4) Building the Windows installer
+
+The Windows installer uses the NSIS installer framework.
+It can be build on Windows, on any other platform which provides
+the Wine Windows emulator or the NSIS binary "makensis".
+
+Linux and MacOS are platforms, on which you can install Wine or
+"makensis".
+
+Selecting between Wine and makensis on non-Windows platforms can
+be done by setting the ant property "nsis.tool" to either "wine"
+or "makensis" in build.properties.
+
+If you want to sign the installer, you will need to set some
+properties with names prefixed with "codesigning" in your build.properties.
+For details see the targets "jsign-installer" and "jsign-uninstaller"
+in build.xml and the default property values in build.properties.default.
+
(6) Building a full release (as provided via the ASF download pages)
+ 1. Remark on building the Windows installer
+
A full release includes the Windows installer which requires a Windows
- environment to be available to create it. If not building in a Windows
- environment, the build scripts assume that Wine is available. If this is not
- the case, the skip.installer property may be set to skip the creation of the
- Windows installer.
+ environment, an installed Wine emulator or an installed native
+ "makensis" binary from the NSIS project. Creating a reproducible
+ installer using the "makensis" option needs a special build of "makensis".
+ For details see below.
- Provided that Wine is available on non-Windows platforms, a full release
- build may be made on Windows, Linux or MacOS.
+ Provided that Wine or "makensis" is available on non-Windows platforms,
+ a full release build may be made on Windows, Linux or MacOS.
- 1. Configure GPG, if needed
+ If you do not want to build the Windows installer, the skip.installer
+ property may be set to skip the creation of the Windows installer.
+
+ 2. Configure GPG, if needed
If the released artifacts have to be cryptographically signed with a
PGP signature, like the official ASF releases are, the following
@@ -277,14 +300,14 @@ You can build them by using the following commands:
You will be prompted for the GPG passphrase when the release build
starts, unless "gpg.passphrase" property is set.
- 2. If building the Windows installer
+ 3. If building the Windows installer on Windows
If running the build in a UAC enabled environment, building the Windows
installer requires elevated privileges. The simplest way to do this is to
open the command prompt used for the build with the "Run as administrator"
option.
- 3. Configure the code signing service
+ 4. Configure the code signing service
ASF committers performing official releases will need to configure the code
signing service so that the Windows installer is signed during the build
@@ -299,7 +322,42 @@ You can build them by using the following commands:
Release managers will be provided with the necessary credentials by the PMC.
- 4. Build the release:
+ If you want to verify the installer from a release by rebuilding it,
+ you can use the detached signatures provided in the official releases.
+ In this case you have to use the sources from the source release
+ archive, which contains these signatures. You also have to build
+ on Windows, or use Wine, or use a special build of makensis to
+ create a reproducible installer, that fits the signature files.
+
+ 5. Using a special "makensis" build on non-Windows (optional)
+
+ If you want to build a reproducible installer on non-Windows
+ by using "makensis" instead of "Wine", you need to build
+ "makensis" from a source download yourself using the following
+ recipe. To build makensis, you need python, scons and a C compiler.
+
+ First detect the needed version by looking for nsis.version
+ in build.properties.default.
+
+ Download and extract NSIS for Windows by running "ant download-dist". Note
+ the NSIS installation PATH from the output or by checking "nsis.home" in
+ build.properties.default. For example:
+ /home/myuser/tomcat-build-libs/nsis-3.10
+
+ Download the correct sources from the same site and run the
+ following command in the extracted source directory:
+
+ scons UNICODE=yes PREFIX=/home/myuser/tomcat-build-libs/nsis-3.10/Bin SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no VERSION=3.10 install-compiler
+
+ You need to specify the correct value in VERSION (this ends up in the installer binary
+ so it needs to match). The PREFIX needs to be the bin directory of the NSIS
+ binary distribution that "ant download-dist" installed.
+
+ Use this "makensis" binary by making sure, that it gets found by setting
+ an appropriate PATH environment variable. In addition set the ant property
+ "nsis.tool" to "makensis" in build.properties.
+
+ 6. Build the release:
Apache Tomcat releases are fully reproducible.
diff --git a/build.properties.default b/build.properties.default
index 468ad54d06..5d33c82b3a 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -36,6 +36,9 @@ version.dev=-dev
# ----- Build tools -----
ant.version.required=1.10.2
+# Which tool to use for building Windows installer
+# on unix platform: wine or makensis.
+nsis.tool=wine
# ----- Build control flags -----
compile.debug=true
diff --git a/build.xml b/build.xml
index fe4624313b..8b9f85e0cd 100644
--- a/build.xml
+++ b/build.xml
@@ -301,6 +301,11 @@
<filter token="JASPIC_SPEC_VERSION" value="${jaspic.spec.version}"/>
</filterset>
+ <!-- Path filter set -->
+ <filterset id="path.filters">
+ <filter token="BASEDIR" value="${basedir}"/>
+ </filterset>
+
<!-- Files to change line endings for depending on target platform -->
<patternset id="text.files" >
<include name="**/INSTALLLICENSE"/>
@@ -2589,19 +2594,35 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
<target name="-installer-pre-init">
<property environment="env" />
<condition property="wine.ok">
+ <or>
+ <and>
+ <equals arg1="${nsis.tool}" arg2="wine" forcestring="true"/>
+ <available file="wine" filepath="${env.PATH}" />
+ </and>
+ </or>
+ </condition>
+ <condition property="makensis.ok">
+ <or>
+ <and>
+ <equals arg1="${nsis.tool}" arg2="makensis" forcestring="true"/>
+ <available file="makensis" filepath="${env.PATH}" />
+ </and>
+ </or>
+ </condition>
+ <condition property="installer.ok">
<or>
<os family="windows" />
- <available file="wine" filepath="${env.PATH}" />
- <isset property="skip.installer"/>
+ <isset property="wine.ok"/>
+ <isset property="makensis.ok"/>
</or>
</condition>
</target>
- <target name="-installer-init" depends="-installer-pre-init" unless="${wine.ok}">
- <fail message="The executable wine was not found on the current path.
-Wine is required to build the Windows installer when running a release build on
-a non-Windows platform. To skip building the Windows installer, set the
-skip.installer property in build.properties" />
+ <target name="-installer-init" depends="-installer-pre-init" unless="${installer.ok}">
+ <fail message="The executable ${nsis.tool} was not found on the current path.
+Either wine or makensis are required to build the Windows installer on a non-Windows platform.
+Choose the tool by setting property nsis.tool in build.properties.
+To skip building the Windows installer, set the skip.installer property in build.properties" />
</target>
<target name="-installer-prep"
@@ -2612,13 +2633,8 @@ skip.installer property in build.properties" />
<include name="*.bmp" />
<include name="*.ico" />
<include name="*.xml" />
- <include name="Uninstall.exe.sig" />
</fileset>
</copy>
- <copy file="res/install-win/tomcat-installer.exe.sig"
- tofile="${tomcat.release}/v${version}/bin/${final.name}.exe.sig"
- failonerror="false"
- quiet="true" />
<copy file="${nsis.installoptions.dll}" todir="${tomcat.dist}" />
<copy file="${nsis.nsexec.dll}" todir="${tomcat.dist}" />
<copy file="${nsis.nsisdl.dll}" todir="${tomcat.dist}" />
@@ -2626,6 +2642,7 @@ skip.installer property in build.properties" />
<copy file="${nsis.nsdialogs.dll}" todir="${tomcat.dist}" />
<copy file="res/install-win/tomcat.nsi" tofile="${tomcat.dist}/tomcat.nsi" overwrite="true" encoding="ISO-8859-1">
<filterset refid="version.filters"/>
+ <filterset refid="path.filters"/>
</copy>
<fixcrlf srcdir="${tomcat.dist}" eol="crlf"
encoding="ISO-8859-1" fixlast="false" >
@@ -2637,44 +2654,54 @@ skip.installer property in build.properties" />
</touch>
</target>
- <target name="-installer-create-tempinstaller"
- unless="skip.installer" depends="-installer-prep">
- <exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
- <arg value="/DUNINSTALLONLY" />
+ <target name="-installer-wine" if="${wine.ok}">
+ <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
+ <arg value="${nsis.exe}" />
<arg value="/DNSISDIR=${nsis.home}" />
<arg value="/V2" />
<arg value="tomcat.nsi" />
</exec>
- <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
- <arg value="${nsis.exe}" />
- <arg value="/DUNINSTALLONLY" />
+ </target>
+
+ <target name="-installer-makensis" if="${makensis.ok}">
+ <exec dir="${tomcat.dist}" executable="makensis" osfamily="unix">
+ <arg value="-DNSISDIR=${nsis.home}" />
+ <arg value="-V2" />
+ <arg value="tomcat.nsi" />
+ </exec>
+ </target>
+
+ <target name="-installer" unless="skip.installer"
+ depends="-installer-prep,-installer-wine,-installer-makensis">
+ <exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
<arg value="/DNSISDIR=${nsis.home}" />
<arg value="/V2" />
<arg value="tomcat.nsi" />
</exec>
</target>
- <target name="-installer-create-uninstaller"
- unless="skip.installer" depends="-installer-create-tempinstaller">
- <!-- Execute the temporary installer to create the uninstaller -->
- <exec dir="${tomcat.dist}" executable="${tomcat.dist}/tempinstaller.exe"
- osfamily="windows" />
- <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
- <arg value="${tomcat.dist}/tempinstaller.exe" />
- </exec>
- <!-- Reproducible builds: consistent timestamps for installer files -->
- <touch datetime="${tstamp.file}" pattern="yyyy-MM-dd HH:mm:ss">
- <fileset dir="${tomcat.dist}"/>
- </touch>
+ <target name="installer-sign"
+ description="Builds and optionally signs the Windows installer"
+ depends="-installer" unless="skip.installer" >
+ <move file="${tomcat.dist}/tomcat-installer.exe" tofile="${tomcat.release}/v${version}/bin/${final.name}.exe" />
+ <!-- .exe has changed so need to redo checksums and OpenPGP signature -->
+ <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.asc" />
+ <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.sha512" />
+ <hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
</target>
- <target name="-installer-sign-uninstaller"
- unless="skip.installer" depends="-installer-create-uninstaller,setup-jsign"
- if="${do.codesigning}">
- <!-- If the detached signature doesn't exist, this will sign the file -->
- <!-- and create the detached signature. If the detached signature does -->
- <!-- exist it will be attached to the file. -->
- <jsign file="${tomcat.dist}/Uninstall.exe"
+ <!-- Called via a callback in the NSIS installer script -->
+ <target name="jsign-installer"
+ depends="setup-jsign" if="${do.codesigning}" >
+ <echo>Signing ${tomcat.dist}/tomcat-installer.exe</echo>
+ <!-- Copy pre-existing detachced signature to signing directory -->
+ <copy file="res/install-win/tomcat-installer.exe.sig"
+ tofile="${tomcat.dist}/tomcat-installer.exe.sig"
+ failonerror="false" />
+ <!-- If the detached signature doesn't exist, this will sign the file -->
+ <!-- and create the detached signature. If the detached signature does -->
+ <!-- exist it will be attached to the file. -->
+ <jsign file="${tomcat.dist}/tomcat-installer.exe"
storepass="${codesigning.storepass}"
storetype="${codesigning.storetype}"
keypass="${codesigning.keypass}"
@@ -2683,35 +2710,22 @@ skip.installer property in build.properties" />
tsaurl="http://ts.ssl.com"
tsmode="RFC3161"
detached="true"/>
- <!-- Copy detached signature to source tree -->
- <copy file="${tomcat.dist}/Uninstall.exe.sig" todir="res/install-win"/>
- <!-- Reproducible builds: consistent timestamps for installer files -->
- <touch datetime="${tstamp.file}" pattern="yyyy-MM-dd HH:mm:ss">
- <fileset dir="${tomcat.dist}"/>
- </touch>
- </target>
-
- <target name="-installer" unless="skip.installer"
- depends="-installer-sign-uninstaller">
- <exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
- <arg value="/DNSISDIR=${nsis.home}" />
- <arg value="/V2" />
- <arg value="tomcat.nsi" />
- </exec>
- <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
- <arg value="${nsis.exe}" />
- <arg value="/DNSISDIR=${nsis.home}" />
- <arg value="/V2" />
- <arg value="tomcat.nsi" />
- </exec>
- <move file="${tomcat.dist}/tomcat-installer.exe" tofile="${tomcat.release}/v${version}/bin/${final.name}.exe" />
- <hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
+ <!-- Move detached signature to source tree -->
+ <move file="${tomcat.dist}/tomcat-installer.exe.sig" tofile="res/install-win/tomcat-installer.exe.sig"/>
</target>
- <target name="installer-sign"
- description="Builds and optionally signs the Windows installer"
- depends="-installer,setup-jsign" if="${do.codesigning}" >
- <jsign file="${tomcat.release}/v${version}/bin/${final.name}.exe"
+ <!-- Called via a callback in the NSIS installer script -->
+ <target name="jsign-uninstaller"
+ depends="setup-jsign" if="${do.codesigning}" >
+ <echo>Signing ${codesigning.file_to_sign}</echo>
+ <!-- Copy pre-existing detachced signature to signing directory -->
+ <copy file="res/install-win/Uninstall.exe.sig"
+ tofile="${codesigning.file_to_sign}.sig"
+ failonerror="false" />
+ <!-- If the detached signature doesn't exist, this will sign the file -->
+ <!-- and create the detached signature. If the detached signature does -->
+ <!-- exist it will be attached to the file. -->
+ <jsign file="${codesigning.file_to_sign}"
storepass="${codesigning.storepass}"
storetype="${codesigning.storetype}"
keypass="${codesigning.keypass}"
@@ -2720,14 +2734,8 @@ skip.installer property in build.properties" />
tsaurl="http://ts.ssl.com"
tsmode="RFC3161"
detached="true" />
- <!-- Copy detached signature to source tree -->
- <copy file="${tomcat.release}/v${version}/bin/${final.name}.exe.sig"
- tofile="res/install-win/tomcat-installer.exe.sig"/>
- <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.sig" />
- <!-- .exe has changed so need to redo checksums and OpenPGP signature -->
- <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.asc" />
- <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.sha512" />
- <hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
+ <!-- Move detached signature to source tree -->
+ <move file="${codesigning.file_to_sign}.sig" tofile="res/install-win/Uninstall.exe.sig"/>
</target>
<target name="-pre-release-lone-target-check">
diff --git a/res/install-win/tomcat.nsi b/res/install-win/tomcat.nsi
index 7a14c58e82..e0cd26e76f 100644
--- a/res/install-win/tomcat.nsi
+++ b/res/install-win/tomcat.nsi
@@ -17,11 +17,7 @@
Unicode true
-!ifdef UNINSTALLONLY
- OutFile "tempinstaller.exe"
-!else
- OutFile tomcat-installer.exe
-!endif
+OutFile tomcat-installer.exe
;Compression options
CRCCheck on
@@ -118,11 +114,9 @@ Var ServiceInstallLog
Page custom CheckUserType
!insertmacro MUI_PAGE_FINISH
- !ifdef UNINSTALLONLY
- ;Uninstall Page order
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
- !endif
+ ;Uninstall Page order
+ !insertmacro MUI_UNPAGE_CONFIRM
+ !insertmacro MUI_UNPAGE_INSTFILES
;Language
!insertmacro MUI_LANGUAGE English
@@ -163,6 +157,9 @@ Var ServiceInstallLog
InstType Minimum
InstType Full
+ !finalize 'ant -f @BASEDIR@/build.xml jsign-installer'
+ !uninstfinalize 'ant -f @BASEDIR@/build.xml -Dcodesigning.file_to_sign=%1 jsign-uninstaller'
+
ReserveFile System.dll
ReserveFile nsDialogs.dll
ReserveFile tomcat-users_1.xml
@@ -201,6 +198,9 @@ Section "Core" SecTomcatCore
SetOutPath $INSTDIR\webapps\ROOT
File /r webapps\ROOT\*.*
+ ;Create uninstaller
+ WriteUninstaller "$INSTDIR\Uninstall.exe"
+
Call configure
DetailPrint "Using Jvm: $JavaHome"
@@ -349,12 +349,6 @@ Section -post
Call createShortcuts
${EndIf}
- !ifndef UNINSTALLONLY
- SetOutPath $INSTDIR
- ; this packages the signed uninstaller
- File Uninstall.exe
- !endif
-
WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\@VERSION_MAJOR_MINOR@\$TomcatServiceName" "InstallPath" $INSTDIR
WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\@VERSION_MAJOR_MINOR@\$TomcatServiceName" "Version" @VERSION@
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat @VERSION_MAJOR_MINOR@ $TomcatServiceName" \
@@ -436,14 +430,6 @@ Function ReadFromConfigIni
FunctionEnd
Function .onInit
- !ifdef UNINSTALLONLY
- ; If UNINSTALLONLY is defined, then we aren't supposed to do anything except write out
- ; the installer. This is better than processing a command line option as it means
- ; this entire code path is not present in the final (real) installer.
- WriteUninstaller "$EXEDIR\Uninstall.exe"
- Quit
- !endif
-
${GetParameters} $R0
ClearErrors
@@ -1248,7 +1234,6 @@ FunctionEnd
;--------------------------------
;Uninstaller Section
-!ifdef UNINSTALLONLY
Section Uninstall
${If} $TomcatServiceName == ""
@@ -1383,6 +1368,4 @@ FunctionEnd
FindClose $1
FunctionEnd
-!endif
-
;eof
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 1b5d1c08de..f6bb695ec4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 9.0.101 (remm)" rtext="in development">
+ <subsection name="Other">
+ <changelog>
+ <add>
+ Add <code>makensis</code> as an option for building the Installer for
+ Windows on non-Windows platforms. (rjung/markt)
+ </add>
+ </changelog>
+ </subsection>
</section>
<section name="Tomcat 9.0.100 (remm)" rtext="release in progress">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Mark,
On 3/3/25 7:27 AM, Mark Thomas wrote:
> On 03/03/2025 10:54, Mark Thomas wrote:
>
> <snip/>
>
>> I don't recall if I tested with wine after the changes were complete.
>> I do recall installing and uninstalling wine multiple times. I'll
>> retest now.
>
> So clearly I didn't test this with Wine. There is no way the current
> build.xml file will work with Wine.
>
> The challenge is that the NSIS build now calls out to Ant to sign the
> uninstaller and the installer during the NSIS build. When that happens
> under Wine, it fails for a couple of reasons:
> - Ant isn't on the path
> - Ant depends on Java and there isn't a Windows JRE on the path
>
> The first point is relatively simple to fix. The second starts to make
> this a bit more complex.
>
> An alternative is that Wine can call out to Linux executables but that
> moves the problem to making sure the NSIS build knows whether it is
> running under Windows or Wine.
>
> Ideally building Tomcat shouldn't be any more complicated than:
> - Install Java
> - Install Ant
> - git checkout ...
> - ant release
>
> Then again, we do require Wine to be installed to do release builds on
> Linux so there are some additional requirements.
>
> I do like the makensis approach as it is a lot simpler. Wine on Mac has
> proven tricky to get working in the past.
In my case, Wine was super simple. I literally just did "brew install
wine" (or similar package name) and everything worked. For makensis, I
have to install scons, download the nsis source, build the binary and
make sure it's installed in the right place, then make sure my
custom-built makensis is on the path. brew install Wine puts wine in my
path.
So it's marginally more complicated to actually build makensis, but
makensis itself is "lighter" than Wine, so I get it.
> I can see the following options:>
> 1. Remove Wine support. Have ant build makensis to the correct recipe
> when on Linux.
Building nsis might be tricky, especially if we need to request scons
and cc to be installed. This includes not only release managers, but
anyone who wants to test build reproducibility.
> 2. Add a requirement for a Windows JRE to make a release build and add
> it and Ant to the path when calling the NSIS installer via Wine.
Oof, no thanks. I'd rather have Wine than install another JRE just for
this. Especially one built for another OS.
> 3. Have the NSIS installer call Ant directly on Windows and via Linux
> when running via wine.
I'm not sure why this isn't already happening. Is it really just a PATH
issue?
> I'm going to start looking at 3 and the building makensis part of 1 and
> see how far I get.
>
> Thoughts?
I'm okay with whatever works best for the largest number of people. If
Rainer wants to be able to test repro builds and isn't willing to
install Wine (which is reasonable), then supporting makensis is a good
solution. If that means everyone moving to makensis then so be it.
I've always hated the build process for httpd. This feels like we are
moving in that direction, where the build environment is so onerous that
only the project authors are ever really able to build it.
What do you think the chances are that Emmanuel wants to write another
indispensable Java-native utility for us? ;)
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Mark,
On 3/3/25 10:54 AM, Mark Thomas wrote:
> On 03/03/2025 15:38, Rémy Maucherat wrote:
>> On Mon, Mar 3, 2025 at 1:45 PM Rémy Maucherat <re...@apache.org> wrote:
>>> On Mon, Mar 3, 2025 at 1:27 PM Mark Thomas <ma...@apache.org> wrote:
>>>> On 03/03/2025 10:54, Mark Thomas wrote:
>
> <snip/>
>
>>>> I do like the makensis approach as it is a lot simpler. Wine on Mac has
>>>> proven tricky to get working in the past. I can see ythe followuing
>>>> options:
>>>>
>>>> 1. Remove Wine support. Have ant build makensis to the correct recipe
>>>> when on Linux.
>>
>> So +1 for 1) since I was able to get it to work and verify 11.0.5.
>> That should mean I can again build the Windows installer properly for
>> 9.0.x.
>
> Excellent.
I was able to do the same, and roll a new RC (somewhat obviously, but
adding here for completeness).
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Mark,
On 3/3/25 1:08 PM, Mark Thomas wrote:
> On 03/03/2025 16:08, Rainer Jung wrote:
>> Am 03.03.25 um 16:54 schrieb Mark Thomas:
>
> <snip/>
>
>>> So, I think we have a different set of options now:
>>>
>>> a) Keep the existing makensis approach and remove Wine support
>>>
>>> b) Revert the change to using callbacks to sign the uninstaller and
>>> installer. Keep the option for makensis or wine.
>>
>> The need for the call-backs has arisen from supporting non-Windows,
>> non- wine. Previously we built a temporary installer in form of a
>> Windows exe. Then executed this temporary installer to get the
>> uninstaller and then finally built the installer. The step of
>> executing the temporary installer was only possible on Windows or
>> wine. So IMHO b) means no longer supporting natively build the Windows
>> installer on non-Windows without wine.
>>
>>> c) Revert all the changes and go back to wine.
>>
>> I think b) and c) are the same for the reasons given above.
>
> Good point. Both b) & c) need wine.
>
>>> and a bonus option d) that is an addition to a) or b):
>>>
>>> d) Try and build a local makensis as part of the build script
>>>
>>>
>>> I'm not sure I see the value in maintaining support for makensis and
>>> wine. I'm prepared to be convinced if someone can see a reason.
>>> Otherwise I prefer a). I'm happy to try and get d) to work if a) (or
>>> b)) is the agreed way forwards.
>>
>> I prefer a), but I am not an RM. Option d) might work, but some
>> prerequisites are of course needed, like a compiler toolchain
>> supported by the SConstruct and maybe a python and scons installation.
>> I don't think we want to do this from the ant build. Downloading the
>> correct nsis source and running the scons command would be possible
>> and inside the ant build we have all the subtle points, like which
>> version, which prefix in our hands.
>
> I have this working in the Ant build. I could move this to an
> independent set of targets so folks can build makensis manually or via
> Ant. What do folks think?
How stable is NSIS? I know we've upgraded the version over time... the
last upgrade was 2024-04-29, less than a year ago. If/when NSIS 3.11
comes out, I'm very unlikely to notice a small commit that increments
that version number and I'll probably use my old makensis local build.
Whether we add an ant target to build makensis or not, I think the
primary build needs to make sure the build is using the expected version
of the tool.
I don't mind another target to run periodically, but I'd like ant to
tell me I need to do it if it's not going to do it by itself.
> I'm also planning on removing Wine support unless there are objections.
No real objection here.
The old release artifacts include information for how to reproduce the
build in BUILDING.TXT (though they are a little vague... I may try to
improve them), so removing all that stuff from BUILDING.txt and the
Release Process wiki would be good. I'm happy to do that work once we
have removed Wine support from git.
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Dimitris Soumis <ds...@apache.org>.
On Mon, Mar 3, 2025 at 8:16 PM Mark Thomas <ma...@apache.org> wrote:
> On 03/03/2025 16:08, Rainer Jung wrote:
> > Am 03.03.25 um 16:54 schrieb Mark Thomas:
>
> <snip/>
>
> >> So, I think we have a different set of options now:
> >>
> >> a) Keep the existing makensis approach and remove Wine support
> >>
> >> b) Revert the change to using callbacks to sign the uninstaller and
> >> installer. Keep the option for makensis or wine.
> >
> > The need for the call-backs has arisen from supporting non-Windows, non-
> > wine. Previously we built a temporary installer in form of a Windows
> > exe. Then executed this temporary installer to get the uninstaller and
> > then finally built the installer. The step of executing the temporary
> > installer was only possible on Windows or wine. So IMHO b) means no
> > longer supporting natively build the Windows installer on non-Windows
> > without wine.
> >
> >> c) Revert all the changes and go back to wine.
> >
> > I think b) and c) are the same for the reasons given above.
>
> Good point. Both b) & c) need wine.
>
> >> and a bonus option d) that is an addition to a) or b):
> >>
> >> d) Try and build a local makensis as part of the build script
> >>
> >>
> >> I'm not sure I see the value in maintaining support for makensis and
> >> wine. I'm prepared to be convinced if someone can see a reason.
> >> Otherwise I prefer a). I'm happy to try and get d) to work if a) (or
> >> b)) is the agreed way forwards.
> >
> > I prefer a), but I am not an RM. Option d) might work, but some
> > prerequisites are of course needed, like a compiler toolchain supported
> > by the SConstruct and maybe a python and scons installation. I don't
> > think we want to do this from the ant build. Downloading the correct
> > nsis source and running the scons command would be possible and inside
> > the ant build we have all the subtle points, like which version, which
> > prefix in our hands.
>
> I have this working in the Ant build. I could move this to an
> independent set of targets so folks can build makensis manually or via
> Ant. What do folks think?
>
+1 on a), by solely running the scons command (without defining a
cross-compiler) in nsis source downloaded in the ant build.
IMHO building a local makensis (option d) ) doesn't add any clear benefits.
+0.5 on having the option of using a manually built makensis. Although this
would benefit cases of users having and using a preinstalled version of
nsis, could raise some confusions when trying to verify the reproduced
build since it will differ from the released one.
> I plan to do so some more work on this tomorrow to clean it up before
> committing the changes.
>
> I'm also planning on removing Wine support unless there are objections.
>
> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Mark Thomas <ma...@apache.org>.
On 03/03/2025 16:08, Rainer Jung wrote:
> Am 03.03.25 um 16:54 schrieb Mark Thomas:
<snip/>
>> So, I think we have a different set of options now:
>>
>> a) Keep the existing makensis approach and remove Wine support
>>
>> b) Revert the change to using callbacks to sign the uninstaller and
>> installer. Keep the option for makensis or wine.
>
> The need for the call-backs has arisen from supporting non-Windows, non-
> wine. Previously we built a temporary installer in form of a Windows
> exe. Then executed this temporary installer to get the uninstaller and
> then finally built the installer. The step of executing the temporary
> installer was only possible on Windows or wine. So IMHO b) means no
> longer supporting natively build the Windows installer on non-Windows
> without wine.
>
>> c) Revert all the changes and go back to wine.
>
> I think b) and c) are the same for the reasons given above.
Good point. Both b) & c) need wine.
>> and a bonus option d) that is an addition to a) or b):
>>
>> d) Try and build a local makensis as part of the build script
>>
>>
>> I'm not sure I see the value in maintaining support for makensis and
>> wine. I'm prepared to be convinced if someone can see a reason.
>> Otherwise I prefer a). I'm happy to try and get d) to work if a) (or
>> b)) is the agreed way forwards.
>
> I prefer a), but I am not an RM. Option d) might work, but some
> prerequisites are of course needed, like a compiler toolchain supported
> by the SConstruct and maybe a python and scons installation. I don't
> think we want to do this from the ant build. Downloading the correct
> nsis source and running the scons command would be possible and inside
> the ant build we have all the subtle points, like which version, which
> prefix in our hands.
I have this working in the Ant build. I could move this to an
independent set of targets so folks can build makensis manually or via
Ant. What do folks think?
I plan to do so some more work on this tomorrow to clean it up before
committing the changes.
I'm also planning on removing Wine support unless there are objections.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rainer Jung <ra...@kippdata.de>.
Am 03.03.25 um 16:54 schrieb Mark Thomas:
> On 03/03/2025 15:38, Rémy Maucherat wrote:
>> On Mon, Mar 3, 2025 at 1:45 PM Rémy Maucherat <re...@apache.org> wrote:
>>> On Mon, Mar 3, 2025 at 1:27 PM Mark Thomas <ma...@apache.org> wrote:
>>>> On 03/03/2025 10:54, Mark Thomas wrote:
>
> <snip/>
>
>>>> I do like the makensis approach as it is a lot simpler. Wine on Mac has
>>>> proven tricky to get working in the past. I can see ythe followuing
>>>> options:
>>>>
>>>> 1. Remove Wine support. Have ant build makensis to the correct recipe
>>>> when on Linux.
>>
>> So +1 for 1) since I was able to get it to work and verify 11.0.5.
>> That should mean I can again build the Windows installer properly for
>> 9.0.x.
>
> Excellent.
>
>>> Ok. I would like it more if using my platform makensis was possible.
>
> That looks to be impossible at the moment. The NSIS installer embeds the
> installer version in the installer binary so for repeatable builds we
> need to ensure the same version as used by the Windows binary is used.
>
>>> I will be working trying to get a custom makensis this afternoon.
>
> Looks like you got that working. Excellent.
>
>>> As it is, Wine suppose is broken, the only way to fix it is to revert
>>> to the way signing was done previously.
>
> If we want to support Wine as well as NSIS then I think revert the
> changes to use call backs to sign the uninstaller and the installer
> should work. That would mean going back to first building the
> uninstaller, then the installer.
>
>>>> 2. Add a requirement for a Windows JRE to make a release build and add
>>>> it and Ant to the path when calling the NSIS installer via Wine.
>>>
>>> -1
>>> No way.
>
> Fine by me. I didn't like the option but presented it for completeness.
>
>>>> 3. Have the NSIS installer call Ant directly on Windows and via Linux
>>>> when running via wine.
>>>
>>> When I run "wine cmd" I get the "Windows" shell, where I can type
>>> commands and see what it is possible to do from there. I think it's
>>> not a good plan.
>
> Having spent a few hours trying to get it to work, I agree with you.
> I've had zero success. And my sense is that if I did manage to get it to
> work, debugging faulty configurations would be difficult.
>
>>>> I'm going to start looking at 3 and the building makensis part of 1 and
>>>> see how far I get.
>>>>
>>>> Thoughts?
>>>
>>> Well, the previous way before all of that was working just fine for
>>> me. Other than that, I'll see if I can have 1) work.
>
> So, I think we have a different set of options now:
>
> a) Keep the existing makensis approach and remove Wine support
>
> b) Revert the change to using callbacks to sign the uninstaller and
> installer. Keep the option for makensis or wine.
The need for the call-backs has arisen from supporting non-Windows,
non-wine. Previously we built a temporary installer in form of a Windows
exe. Then executed this temporary installer to get the uninstaller and
then finally built the installer. The step of executing the temporary
installer was only possible on Windows or wine. So IMHO b) means no
longer supporting natively build the Windows installer on non-Windows
without wine.
> c) Revert all the changes and go back to wine.
I think b) and c) are the same for the reasons given above.
> and a bonus option d) that is an addition to a) or b):
>
> d) Try and build a local makensis as part of the build script
>
>
> I'm not sure I see the value in maintaining support for makensis and
> wine. I'm prepared to be convinced if someone can see a reason.
> Otherwise I prefer a). I'm happy to try and get d) to work if a) (or b))
> is the agreed way forwards.
I prefer a), but I am not an RM. Option d) might work, but some
prerequisites are of course needed, like a compiler toolchain supported
by the SConstruct and maybe a python and scons installation. I don't
think we want to do this from the ant build. Downloading the correct
nsis source and running the scons command would be possible and inside
the ant build we have all the subtle points, like which version, which
prefix in our hands.
Best regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Mark Thomas <ma...@apache.org>.
On 03/03/2025 15:38, Rémy Maucherat wrote:
> On Mon, Mar 3, 2025 at 1:45 PM Rémy Maucherat <re...@apache.org> wrote:
>> On Mon, Mar 3, 2025 at 1:27 PM Mark Thomas <ma...@apache.org> wrote:
>>> On 03/03/2025 10:54, Mark Thomas wrote:
<snip/>
>>> I do like the makensis approach as it is a lot simpler. Wine on Mac has
>>> proven tricky to get working in the past. I can see ythe followuing options:
>>>
>>> 1. Remove Wine support. Have ant build makensis to the correct recipe
>>> when on Linux.
>
> So +1 for 1) since I was able to get it to work and verify 11.0.5.
> That should mean I can again build the Windows installer properly for
> 9.0.x.
Excellent.
>> Ok. I would like it more if using my platform makensis was possible.
That looks to be impossible at the moment. The NSIS installer embeds the
installer version in the installer binary so for repeatable builds we
need to ensure the same version as used by the Windows binary is used.
>> I will be working trying to get a custom makensis this afternoon.
Looks like you got that working. Excellent.
>> As it is, Wine suppose is broken, the only way to fix it is to revert
>> to the way signing was done previously.
If we want to support Wine as well as NSIS then I think revert the
changes to use call backs to sign the uninstaller and the installer
should work. That would mean going back to first building the
uninstaller, then the installer.
>>> 2. Add a requirement for a Windows JRE to make a release build and add
>>> it and Ant to the path when calling the NSIS installer via Wine.
>>
>> -1
>> No way.
Fine by me. I didn't like the option but presented it for completeness.
>>> 3. Have the NSIS installer call Ant directly on Windows and via Linux
>>> when running via wine.
>>
>> When I run "wine cmd" I get the "Windows" shell, where I can type
>> commands and see what it is possible to do from there. I think it's
>> not a good plan.
Having spent a few hours trying to get it to work, I agree with you.
I've had zero success. And my sense is that if I did manage to get it to
work, debugging faulty configurations would be difficult.
>>> I'm going to start looking at 3 and the building makensis part of 1 and
>>> see how far I get.
>>>
>>> Thoughts?
>>
>> Well, the previous way before all of that was working just fine for
>> me. Other than that, I'll see if I can have 1) work.
So, I think we have a different set of options now:
a) Keep the existing makensis approach and remove Wine support
b) Revert the change to using callbacks to sign the uninstaller and
installer. Keep the option for makensis or wine.
c) Revert all the changes and go back to wine.
and a bonus option d) that is an addition to a) or b):
d) Try and build a local makensis as part of the build script
I'm not sure I see the value in maintaining support for makensis and
wine. I'm prepared to be convinced if someone can see a reason.
Otherwise I prefer a). I'm happy to try and get d) to work if a) (or b))
is the agreed way forwards.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rémy Maucherat <re...@apache.org>.
On Mon, Mar 3, 2025 at 1:45 PM Rémy Maucherat <re...@apache.org> wrote:
>
> On Mon, Mar 3, 2025 at 1:27 PM Mark Thomas <ma...@apache.org> wrote:
> >
> > On 03/03/2025 10:54, Mark Thomas wrote:
> >
> > <snip/>
> >
> > > I don't recall if I tested with wine after the changes were complete. I
> > > do recall installing and uninstalling wine multiple times. I'll retest now.
> >
> > So clearly I didn't test this with Wine. There is no way the current
> > build.xml file will work with Wine.
> >
> > The challenge is that the NSIS build now calls out to Ant to sign the
> > uninstaller and the installer during the NSIS build. When that happens
> > under Wine, it fails for a couple of reasons:
> > - Ant isn't on the path
> > - Ant depends on Java and there isn't a Windows JRE on the path
> >
> > The first point is relatively simple to fix. The second starts to make
> > this a bit more complex.
> >
> > An alternative is that Wine can call out to Linux executables but that
> > moves the problem to making sure the NSIS build knows whether it is
> > running under Windows or Wine.
>
> I don't think that will work. The best case I managed is that it did
> call my "Linux native" Ant, with a Windows path. Meh. Once you get
> into the Wine environment, I would say you are stuck in there.
>
> > Ideally building Tomcat shouldn't be any more complicated than:
> > - Install Java
> > - Install Ant
> > - git checkout ...
> > - ant release
> >
> > Then again, we do require Wine to be installed to do release builds on
> > Linux so there are some additional requirements.
> >
> > I do like the makensis approach as it is a lot simpler. Wine on Mac has
> > proven tricky to get working in the past. I can see ythe followuing options:
> >
> > 1. Remove Wine support. Have ant build makensis to the correct recipe
> > when on Linux.
So +1 for 1) since I was able to get it to work and verify 11.0.5.
That should mean I can again build the Windows installer properly for
9.0.x.
Rémy
> Ok. I would like it more if using my platform makensis was possible. I
> will be working trying to get a custom makensis this afternoon.
>
> As it is, Wine suppose is broken, the only way to fix it is to revert
> to the way signing was done previously.
>
> > 2. Add a requirement for a Windows JRE to make a release build and add
> > it and Ant to the path when calling the NSIS installer via Wine.
>
> -1
> No way.
>
> > 3. Have the NSIS installer call Ant directly on Windows and via Linux
> > when running via wine.
>
> When I run "wine cmd" I get the "Windows" shell, where I can type
> commands and see what it is possible to do from there. I think it's
> not a good plan.
>
> > I'm going to start looking at 3 and the building makensis part of 1 and
> > see how far I get.
> >
> > Thoughts?
>
> Well, the previous way before all of that was working just fine for
> me. Other than that, I'll see if I can have 1) work.
>
> Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Mark Thomas <ma...@apache.org>.
On 03/03/2025 23:43, Christopher Schultz wrote:
> On 3/3/25 7:45 AM, Rémy Maucherat wrote:
<snip/>
>> Ok. I would like it more if using my platform makensis was possible.
>
> +1
>
> Is this the kind of thing we could somehow move upstream? I seem to
> recall that the build option we needed to use was just enabling Unicode
> support. Do I remember that correctly?
This issue (for us) is that the installer built by NSIS includes the
version number of the tool used to build it. So that needs to be "3.10"
for us at the moment rather than the, for example, "v3.09-4" I get if I
use the platform version.
For repeatable builds we need makensis on Linux to have the same version
number is it does in the Windows tool. We should be able to add a check
for that. Further, "normal" builds should be able to proceed (with a
warning) if the check fails but "release" builds should fail.
I'm going to spend some time working on the build script.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Rémy,
On 3/3/25 7:45 AM, Rémy Maucherat wrote:
> On Mon, Mar 3, 2025 at 1:27 PM Mark Thomas <ma...@apache.org> wrote:
>>
>> On 03/03/2025 10:54, Mark Thomas wrote:
>>
>> <snip/>
>>
>>> I don't recall if I tested with wine after the changes were complete. I
>>> do recall installing and uninstalling wine multiple times. I'll retest now.
>>
>> So clearly I didn't test this with Wine. There is no way the current
>> build.xml file will work with Wine.
>>
>> The challenge is that the NSIS build now calls out to Ant to sign the
>> uninstaller and the installer during the NSIS build. When that happens
>> under Wine, it fails for a couple of reasons:
>> - Ant isn't on the path
>> - Ant depends on Java and there isn't a Windows JRE on the path
>>
>> The first point is relatively simple to fix. The second starts to make
>> this a bit more complex.
>>
>> An alternative is that Wine can call out to Linux executables but that
>> moves the problem to making sure the NSIS build knows whether it is
>> running under Windows or Wine.
>
> I don't think that will work. The best case I managed is that it did
> call my "Linux native" Ant, with a Windows path. Meh. Once you get
> into the Wine environment, I would say you are stuck in there.
>
>> Ideally building Tomcat shouldn't be any more complicated than:
>> - Install Java
>> - Install Ant
>> - git checkout ...
>> - ant release
>>
>> Then again, we do require Wine to be installed to do release builds on
>> Linux so there are some additional requirements.
>>
>> I do like the makensis approach as it is a lot simpler. Wine on Mac has
>> proven tricky to get working in the past. I can see ythe followuing options:
>>
>> 1. Remove Wine support. Have ant build makensis to the correct recipe
>> when on Linux.
>
> Ok. I would like it more if using my platform makensis was possible.
+1
Is this the kind of thing we could somehow move upstream? I seem to
recall that the build option we needed to use was just enabling Unicode
support. Do I remember that correctly?
-chris
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rémy Maucherat <re...@apache.org>.
On Mon, Mar 3, 2025 at 1:27 PM Mark Thomas <ma...@apache.org> wrote:
>
> On 03/03/2025 10:54, Mark Thomas wrote:
>
> <snip/>
>
> > I don't recall if I tested with wine after the changes were complete. I
> > do recall installing and uninstalling wine multiple times. I'll retest now.
>
> So clearly I didn't test this with Wine. There is no way the current
> build.xml file will work with Wine.
>
> The challenge is that the NSIS build now calls out to Ant to sign the
> uninstaller and the installer during the NSIS build. When that happens
> under Wine, it fails for a couple of reasons:
> - Ant isn't on the path
> - Ant depends on Java and there isn't a Windows JRE on the path
>
> The first point is relatively simple to fix. The second starts to make
> this a bit more complex.
>
> An alternative is that Wine can call out to Linux executables but that
> moves the problem to making sure the NSIS build knows whether it is
> running under Windows or Wine.
I don't think that will work. The best case I managed is that it did
call my "Linux native" Ant, with a Windows path. Meh. Once you get
into the Wine environment, I would say you are stuck in there.
> Ideally building Tomcat shouldn't be any more complicated than:
> - Install Java
> - Install Ant
> - git checkout ...
> - ant release
>
> Then again, we do require Wine to be installed to do release builds on
> Linux so there are some additional requirements.
>
> I do like the makensis approach as it is a lot simpler. Wine on Mac has
> proven tricky to get working in the past. I can see ythe followuing options:
>
> 1. Remove Wine support. Have ant build makensis to the correct recipe
> when on Linux.
Ok. I would like it more if using my platform makensis was possible. I
will be working trying to get a custom makensis this afternoon.
As it is, Wine suppose is broken, the only way to fix it is to revert
to the way signing was done previously.
> 2. Add a requirement for a Windows JRE to make a release build and add
> it and Ant to the path when calling the NSIS installer via Wine.
-1
No way.
> 3. Have the NSIS installer call Ant directly on Windows and via Linux
> when running via wine.
When I run "wine cmd" I get the "Windows" shell, where I can type
commands and see what it is possible to do from there. I think it's
not a good plan.
> I'm going to start looking at 3 and the building makensis part of 1 and
> see how far I get.
>
> Thoughts?
Well, the previous way before all of that was working just fine for
me. Other than that, I'll see if I can have 1) work.
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Mark Thomas <ma...@apache.org>.
On 03/03/2025 10:54, Mark Thomas wrote:
<snip/>
> I don't recall if I tested with wine after the changes were complete. I
> do recall installing and uninstalling wine multiple times. I'll retest now.
So clearly I didn't test this with Wine. There is no way the current
build.xml file will work with Wine.
The challenge is that the NSIS build now calls out to Ant to sign the
uninstaller and the installer during the NSIS build. When that happens
under Wine, it fails for a couple of reasons:
- Ant isn't on the path
- Ant depends on Java and there isn't a Windows JRE on the path
The first point is relatively simple to fix. The second starts to make
this a bit more complex.
An alternative is that Wine can call out to Linux executables but that
moves the problem to making sure the NSIS build knows whether it is
running under Windows or Wine.
Ideally building Tomcat shouldn't be any more complicated than:
- Install Java
- Install Ant
- git checkout ...
- ant release
Then again, we do require Wine to be installed to do release builds on
Linux so there are some additional requirements.
I do like the makensis approach as it is a lot simpler. Wine on Mac has
proven tricky to get working in the past. I can see ythe followuing options:
1. Remove Wine support. Have ant build makensis to the correct recipe
when on Linux.
2. Add a requirement for a Windows JRE to make a release build and add
it and Ant to the path when calling the NSIS installer via Wine.
3. Have the NSIS installer call Ant directly on Windows and via Linux
when running via wine.
I'm going to start looking at 3 and the building makensis part of 1 and
see how far I get.
Thoughts?
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Mark Thomas <ma...@apache.org>.
On 03/03/2025 09:45, Rémy Maucherat wrote:
> On Sun, Mar 2, 2025 at 10:20 PM Rainer Jung <ra...@kippdata.de> wrote:
<snip/>
>> Hmm, I never tried with wine but at least I checked, that the ant
>> download for Windows contains a binary named "ant", not just "ant.exe".
I don't recall if I tested with wine after the changes were complete. I
do recall installing and uninstalling wine multiple times. I'll retest now.
<snip/>
> Yes, ok, I did not use your recipe since I had not seen it.
> I tried Wine, which failed. I thought this was tested, apparently not.
> I moved on to makensis after a while. Since Fedora had a package, I
> simply used that. The package was imperfect (some dependency had to be
> added manually), but it worked. Guess it does not follow the recipe,
> so the installer generated is different. The problem is that I do not
> understand the recipe.
I can try and improve the wording. Can you post the extract of the text
you don't understand?
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rémy Maucherat <re...@apache.org>.
On Sun, Mar 2, 2025 at 10:20 PM Rainer Jung <ra...@kippdata.de> wrote:
>
> Am 02.03.25 um 21:00 schrieb Rémy Maucherat:
> > On Sun, Mar 2, 2025 at 5:10 PM Rainer Jung <ra...@kippdata.de> wrote:
> >>
> >> Hi Rémy,
> >>
> >> Am 02.03.25 um 11:06 schrieb Rémy Maucherat:
> >>> On Thu, Feb 13, 2025 at 6:11 PM <ma...@apache.org> wrote:
> >>>> @@ -163,6 +157,9 @@ Var ServiceInstallLog
> >>>> InstType Minimum
> >>>> InstType Full
> >>>>
> >>>> + !finalize 'ant -f @BASEDIR@/build.xml jsign-installer'
> >>>> + !uninstfinalize 'ant -f @BASEDIR@/build.xml -Dcodesigning.file_to_sign=%1 jsign-uninstaller'
> >>>
> >>> This fails for me with Can't recognize xxx as an internal or external
> >>> command, or batch script.
> >>> I tried a few things without much success so far.
> >>
> >> First the original nsi script should automatically be run by ant through
> >> a filter to generate one without @ template strings. Originally the
> >> filter replaced version numbers, but in the new build.xml it also
> >> replaces BASEDIR. The resulting file would be the one used by makensis.
> >> Maybe it makes sense to check, how those lines look like in your
> >> environment in the generated file.
> >>
> >> The other possible problem could be, that ant is not found via PATH.
> >> What is "xxx"? just the full "ant -f ...jsign-installer"? With or
> >> without replaced BASEDIR? What is your platform? Maybe we would have to
> >> change something on Windows?
> >
> > IMO it simply does not work. If you run on Wine, then you're inside a
> > fake Windows env, not the original platform. So if you try to run the
> > "ant" command in there, it might simply fail and there's no way at all
> > to do it. It does the same for installer and uninstaller, the issue is
> > with running command "ant".
>
> Hmm, I never tried with wine but at least I checked, that the ant
> download for Windows contains a binary named "ant", not just "ant.exe".
>
> But yes, it would mean wine has to find a windows executable ant and
> maybe it is also a problem, that the resolved BUILDDIR does not work
> under the wine Windows emulation :(
Another problem is that it seems makensis does not build the same
Windows installer (the .dll runtimes in $PLUGINSDIR are different).
> > Was this retested with Wine ? It seems the 10.1 tag is bad too so I'm
> > likely not the only one having an issue.
> >
> > Installing makensis worked (installing it was annoying since the
> > Fedora packaging was messy - probably it can be installed without
> > distro packaging). So if that's "ok", then you should remove the Wine
> > support since there are only 2-3 users for this.
>
> It seems it has to be installed from source. I had added the info from
> Mark, how it was build, to the BUILDING.txt. Using this recipe, I could
> recreate the TC 11.0.5 installer on my system.
>
> For 9.0.101 it didn't work, but I do mot yet know, whether this is true
> to "your" makensis not having been build with that recipe, or for
> instance because the Windows installer contains some of the Javadoc
> pages that my Java/Filesystem always generates different from the ones
> others get. But since my generated exe and the one in the release vote
> differ by about 140KB in size, I guess it is not only Javadocs
> differences, but also makensis binary differences.
Yes, ok, I did not use your recipe since I had not seen it.
I tried Wine, which failed. I thought this was tested, apparently not.
I moved on to makensis after a while. Since Fedora had a package, I
simply used that. The package was imperfect (some dependency had to be
added manually), but it worked. Guess it does not follow the recipe,
so the installer generated is different. The problem is that I do not
understand the recipe.
Rémy
> Best regards,
>
> Rainer
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rainer Jung <ra...@kippdata.de>.
Am 02.03.25 um 21:00 schrieb Rémy Maucherat:
> On Sun, Mar 2, 2025 at 5:10 PM Rainer Jung <ra...@kippdata.de> wrote:
>>
>> Hi Rémy,
>>
>> Am 02.03.25 um 11:06 schrieb Rémy Maucherat:
>>> On Thu, Feb 13, 2025 at 6:11 PM <ma...@apache.org> wrote:
>>>> @@ -163,6 +157,9 @@ Var ServiceInstallLog
>>>> InstType Minimum
>>>> InstType Full
>>>>
>>>> + !finalize 'ant -f @BASEDIR@/build.xml jsign-installer'
>>>> + !uninstfinalize 'ant -f @BASEDIR@/build.xml -Dcodesigning.file_to_sign=%1 jsign-uninstaller'
>>>
>>> This fails for me with Can't recognize xxx as an internal or external
>>> command, or batch script.
>>> I tried a few things without much success so far.
>>
>> First the original nsi script should automatically be run by ant through
>> a filter to generate one without @ template strings. Originally the
>> filter replaced version numbers, but in the new build.xml it also
>> replaces BASEDIR. The resulting file would be the one used by makensis.
>> Maybe it makes sense to check, how those lines look like in your
>> environment in the generated file.
>>
>> The other possible problem could be, that ant is not found via PATH.
>> What is "xxx"? just the full "ant -f ...jsign-installer"? With or
>> without replaced BASEDIR? What is your platform? Maybe we would have to
>> change something on Windows?
>
> IMO it simply does not work. If you run on Wine, then you're inside a
> fake Windows env, not the original platform. So if you try to run the
> "ant" command in there, it might simply fail and there's no way at all
> to do it. It does the same for installer and uninstaller, the issue is
> with running command "ant".
Hmm, I never tried with wine but at least I checked, that the ant
download for Windows contains a binary named "ant", not just "ant.exe".
But yes, it would mean wine has to find a windows executable ant and
maybe it is also a problem, that the resolved BUILDDIR does not work
under the wine Windows emulation :(
> Was this retested with Wine ? It seems the 10.1 tag is bad too so I'm
> likely not the only one having an issue.
>
> Installing makensis worked (installing it was annoying since the
> Fedora packaging was messy - probably it can be installed without
> distro packaging). So if that's "ok", then you should remove the Wine
> support since there are only 2-3 users for this.
It seems it has to be installed from source. I had added the info from
Mark, how it was build, to the BUILDING.txt. Using this recipe, I could
recreate the TC 11.0.5 installer on my system.
For 9.0.101 it didn't work, but I do mot yet know, whether this is true
to "your" makensis not having been build with that recipe, or for
instance because the Windows installer contains some of the Javadoc
pages that my Java/Filesystem always generates different from the ones
others get. But since my generated exe and the one in the release vote
differ by about 140KB in size, I guess it is not only Javadocs
differences, but also makensis binary differences.
Best regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rémy Maucherat <re...@apache.org>.
On Sun, Mar 2, 2025 at 5:10 PM Rainer Jung <ra...@kippdata.de> wrote:
>
> Hi Rémy,
>
> Am 02.03.25 um 11:06 schrieb Rémy Maucherat:
> > On Thu, Feb 13, 2025 at 6:11 PM <ma...@apache.org> wrote:
> >> @@ -163,6 +157,9 @@ Var ServiceInstallLog
> >> InstType Minimum
> >> InstType Full
> >>
> >> + !finalize 'ant -f @BASEDIR@/build.xml jsign-installer'
> >> + !uninstfinalize 'ant -f @BASEDIR@/build.xml -Dcodesigning.file_to_sign=%1 jsign-uninstaller'
> >
> > This fails for me with Can't recognize xxx as an internal or external
> > command, or batch script.
> > I tried a few things without much success so far.
>
> First the original nsi script should automatically be run by ant through
> a filter to generate one without @ template strings. Originally the
> filter replaced version numbers, but in the new build.xml it also
> replaces BASEDIR. The resulting file would be the one used by makensis.
> Maybe it makes sense to check, how those lines look like in your
> environment in the generated file.
>
> The other possible problem could be, that ant is not found via PATH.
> What is "xxx"? just the full "ant -f ...jsign-installer"? With or
> without replaced BASEDIR? What is your platform? Maybe we would have to
> change something on Windows?
IMO it simply does not work. If you run on Wine, then you're inside a
fake Windows env, not the original platform. So if you try to run the
"ant" command in there, it might simply fail and there's no way at all
to do it. It does the same for installer and uninstaller, the issue is
with running command "ant".
Was this retested with Wine ? It seems the 10.1 tag is bad too so I'm
likely not the only one having an issue.
Installing makensis worked (installing it was annoying since the
Fedora packaging was messy - probably it can be installed without
distro packaging). So if that's "ok", then you should remove the Wine
support since there are only 2-3 users for this.
Rémy
> Thanks and regards,
>
> Rainer
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rainer Jung <ra...@kippdata.de>.
Am 02.03.25 um 17:07 schrieb Rainer Jung:
> Hi Rémy,
>
> Am 02.03.25 um 11:06 schrieb Rémy Maucherat:
>> On Thu, Feb 13, 2025 at 6:11 PM <ma...@apache.org> wrote:
>>> @@ -163,6 +157,9 @@ Var ServiceInstallLog
>>> InstType Minimum
>>> InstType Full
>>>
>>> + !finalize 'ant -f @BASEDIR@/build.xml jsign-installer'
>>> + !uninstfinalize 'ant -f @BASEDIR@/build.xml -
>>> Dcodesigning.file_to_sign=%1 jsign-uninstaller'
>>
>> This fails for me with Can't recognize xxx as an internal or external
>> command, or batch script.
>> I tried a few things without much success so far.
>
> First the original nsi script should automatically be run by ant through
> a filter to generate one without @ template strings. Originally the
> filter replaced version numbers, but in the new build.xml it also
> replaces BASEDIR. The resulting file would be the one used by makensis.
> Maybe it makes sense to check, how those lines look like in your
> environment in the generated file.
>
> The other possible problem could be, that ant is not found via PATH.
> What is "xxx"? just the full "ant -f ...jsign-installer"? With or
> without replaced BASEDIR? What is your platform? Maybe we would have to
> change something on Windows?
I should add: if it only happens for the uninstfinalize and not for
finalize, there is one major difference between the two. The file to
sign for finalize has the final name of the installer file. The file to
sign in uninstfinalize is a temporary file generated by makensis during
running the installer generation script. So this temporary mapth might
also be interesting (hidden in "%1" and passed to ant via
codesigning.file_to_sign.
Best regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rainer Jung <ra...@kippdata.de>.
Hi Rémy,
Am 02.03.25 um 11:06 schrieb Rémy Maucherat:
> On Thu, Feb 13, 2025 at 6:11 PM <ma...@apache.org> wrote:
>> @@ -163,6 +157,9 @@ Var ServiceInstallLog
>> InstType Minimum
>> InstType Full
>>
>> + !finalize 'ant -f @BASEDIR@/build.xml jsign-installer'
>> + !uninstfinalize 'ant -f @BASEDIR@/build.xml -Dcodesigning.file_to_sign=%1 jsign-uninstaller'
>
> This fails for me with Can't recognize xxx as an internal or external
> command, or batch script.
> I tried a few things without much success so far.
First the original nsi script should automatically be run by ant through
a filter to generate one without @ template strings. Originally the
filter replaced version numbers, but in the new build.xml it also
replaces BASEDIR. The resulting file would be the one used by makensis.
Maybe it makes sense to check, how those lines look like in your
environment in the generated file.
The other possible problem could be, that ant is not found via PATH.
What is "xxx"? just the full "ant -f ...jsign-installer"? With or
without replaced BASEDIR? What is your platform? Maybe we would have to
change something on Windows?
Thanks and regards,
Rainer
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: (tomcat) branch 9.0.x updated: Add makensis as an option for building the Windows installer
Posted by Rémy Maucherat <re...@apache.org>.
On Thu, Feb 13, 2025 at 6:11 PM <ma...@apache.org> wrote:
>
> This is an automated email from the ASF dual-hosted git repository.
>
> markt pushed a commit to branch 9.0.x
> in repository https://gitbox.apache.org/repos/asf/tomcat.git
>
>
> The following commit(s) were added to refs/heads/9.0.x by this push:
> new 1dc412b8b0 Add makensis as an option for building the Windows installer
> 1dc412b8b0 is described below
>
> commit 1dc412b8b0fe55cb0a994fc26bb995b7e02d4599
> Author: Mark Thomas <ma...@apache.org>
> AuthorDate: Wed Feb 12 10:14:58 2025 +0000
>
> Add makensis as an option for building the Windows installer
> ---
> BUILDING.txt | 78 ++++++++++++++++++++---
> build.properties.default | 3 +
> build.xml | 154 ++++++++++++++++++++++++---------------------
> res/install-win/tomcat.nsi | 37 +++--------
> webapps/docs/changelog.xml | 8 +++
> 5 files changed, 170 insertions(+), 110 deletions(-)
>
> diff --git a/BUILDING.txt b/BUILDING.txt
> index 4fd85f1266..b45b83a72e 100644
> --- a/BUILDING.txt
> +++ b/BUILDING.txt
> @@ -248,19 +248,42 @@ You can build them by using the following commands:
> cd ${tomcat.source}
> ant embed
>
> +(5.4) Building the Windows installer
> +
> +The Windows installer uses the NSIS installer framework.
> +It can be build on Windows, on any other platform which provides
> +the Wine Windows emulator or the NSIS binary "makensis".
> +
> +Linux and MacOS are platforms, on which you can install Wine or
> +"makensis".
> +
> +Selecting between Wine and makensis on non-Windows platforms can
> +be done by setting the ant property "nsis.tool" to either "wine"
> +or "makensis" in build.properties.
> +
> +If you want to sign the installer, you will need to set some
> +properties with names prefixed with "codesigning" in your build.properties.
> +For details see the targets "jsign-installer" and "jsign-uninstaller"
> +in build.xml and the default property values in build.properties.default.
> +
>
> (6) Building a full release (as provided via the ASF download pages)
>
> + 1. Remark on building the Windows installer
> +
> A full release includes the Windows installer which requires a Windows
> - environment to be available to create it. If not building in a Windows
> - environment, the build scripts assume that Wine is available. If this is not
> - the case, the skip.installer property may be set to skip the creation of the
> - Windows installer.
> + environment, an installed Wine emulator or an installed native
> + "makensis" binary from the NSIS project. Creating a reproducible
> + installer using the "makensis" option needs a special build of "makensis".
> + For details see below.
>
> - Provided that Wine is available on non-Windows platforms, a full release
> - build may be made on Windows, Linux or MacOS.
> + Provided that Wine or "makensis" is available on non-Windows platforms,
> + a full release build may be made on Windows, Linux or MacOS.
>
> - 1. Configure GPG, if needed
> + If you do not want to build the Windows installer, the skip.installer
> + property may be set to skip the creation of the Windows installer.
> +
> + 2. Configure GPG, if needed
>
> If the released artifacts have to be cryptographically signed with a
> PGP signature, like the official ASF releases are, the following
> @@ -277,14 +300,14 @@ You can build them by using the following commands:
> You will be prompted for the GPG passphrase when the release build
> starts, unless "gpg.passphrase" property is set.
>
> - 2. If building the Windows installer
> + 3. If building the Windows installer on Windows
>
> If running the build in a UAC enabled environment, building the Windows
> installer requires elevated privileges. The simplest way to do this is to
> open the command prompt used for the build with the "Run as administrator"
> option.
>
> - 3. Configure the code signing service
> + 4. Configure the code signing service
>
> ASF committers performing official releases will need to configure the code
> signing service so that the Windows installer is signed during the build
> @@ -299,7 +322,42 @@ You can build them by using the following commands:
>
> Release managers will be provided with the necessary credentials by the PMC.
>
> - 4. Build the release:
> + If you want to verify the installer from a release by rebuilding it,
> + you can use the detached signatures provided in the official releases.
> + In this case you have to use the sources from the source release
> + archive, which contains these signatures. You also have to build
> + on Windows, or use Wine, or use a special build of makensis to
> + create a reproducible installer, that fits the signature files.
> +
> + 5. Using a special "makensis" build on non-Windows (optional)
> +
> + If you want to build a reproducible installer on non-Windows
> + by using "makensis" instead of "Wine", you need to build
> + "makensis" from a source download yourself using the following
> + recipe. To build makensis, you need python, scons and a C compiler.
> +
> + First detect the needed version by looking for nsis.version
> + in build.properties.default.
> +
> + Download and extract NSIS for Windows by running "ant download-dist". Note
> + the NSIS installation PATH from the output or by checking "nsis.home" in
> + build.properties.default. For example:
> + /home/myuser/tomcat-build-libs/nsis-3.10
> +
> + Download the correct sources from the same site and run the
> + following command in the extracted source directory:
> +
> + scons UNICODE=yes PREFIX=/home/myuser/tomcat-build-libs/nsis-3.10/Bin SKIPPLUGINS=all SKIPUTILS=all SKIPMISC=all NSIS_CONFIG_CONST_DATA_PATH=no VERSION=3.10 install-compiler
> +
> + You need to specify the correct value in VERSION (this ends up in the installer binary
> + so it needs to match). The PREFIX needs to be the bin directory of the NSIS
> + binary distribution that "ant download-dist" installed.
> +
> + Use this "makensis" binary by making sure, that it gets found by setting
> + an appropriate PATH environment variable. In addition set the ant property
> + "nsis.tool" to "makensis" in build.properties.
> +
> + 6. Build the release:
>
> Apache Tomcat releases are fully reproducible.
>
> diff --git a/build.properties.default b/build.properties.default
> index 468ad54d06..5d33c82b3a 100644
> --- a/build.properties.default
> +++ b/build.properties.default
> @@ -36,6 +36,9 @@ version.dev=-dev
>
> # ----- Build tools -----
> ant.version.required=1.10.2
> +# Which tool to use for building Windows installer
> +# on unix platform: wine or makensis.
> +nsis.tool=wine
>
> # ----- Build control flags -----
> compile.debug=true
> diff --git a/build.xml b/build.xml
> index fe4624313b..8b9f85e0cd 100644
> --- a/build.xml
> +++ b/build.xml
> @@ -301,6 +301,11 @@
> <filter token="JASPIC_SPEC_VERSION" value="${jaspic.spec.version}"/>
> </filterset>
>
> + <!-- Path filter set -->
> + <filterset id="path.filters">
> + <filter token="BASEDIR" value="${basedir}"/>
> + </filterset>
> +
> <!-- Files to change line endings for depending on target platform -->
> <patternset id="text.files" >
> <include name="**/INSTALLLICENSE"/>
> @@ -2589,19 +2594,35 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
> <target name="-installer-pre-init">
> <property environment="env" />
> <condition property="wine.ok">
> + <or>
> + <and>
> + <equals arg1="${nsis.tool}" arg2="wine" forcestring="true"/>
> + <available file="wine" filepath="${env.PATH}" />
> + </and>
> + </or>
> + </condition>
> + <condition property="makensis.ok">
> + <or>
> + <and>
> + <equals arg1="${nsis.tool}" arg2="makensis" forcestring="true"/>
> + <available file="makensis" filepath="${env.PATH}" />
> + </and>
> + </or>
> + </condition>
> + <condition property="installer.ok">
> <or>
> <os family="windows" />
> - <available file="wine" filepath="${env.PATH}" />
> - <isset property="skip.installer"/>
> + <isset property="wine.ok"/>
> + <isset property="makensis.ok"/>
> </or>
> </condition>
> </target>
>
> - <target name="-installer-init" depends="-installer-pre-init" unless="${wine.ok}">
> - <fail message="The executable wine was not found on the current path.
> -Wine is required to build the Windows installer when running a release build on
> -a non-Windows platform. To skip building the Windows installer, set the
> -skip.installer property in build.properties" />
> + <target name="-installer-init" depends="-installer-pre-init" unless="${installer.ok}">
> + <fail message="The executable ${nsis.tool} was not found on the current path.
> +Either wine or makensis are required to build the Windows installer on a non-Windows platform.
> +Choose the tool by setting property nsis.tool in build.properties.
> +To skip building the Windows installer, set the skip.installer property in build.properties" />
> </target>
>
> <target name="-installer-prep"
> @@ -2612,13 +2633,8 @@ skip.installer property in build.properties" />
> <include name="*.bmp" />
> <include name="*.ico" />
> <include name="*.xml" />
> - <include name="Uninstall.exe.sig" />
> </fileset>
> </copy>
> - <copy file="res/install-win/tomcat-installer.exe.sig"
> - tofile="${tomcat.release}/v${version}/bin/${final.name}.exe.sig"
> - failonerror="false"
> - quiet="true" />
> <copy file="${nsis.installoptions.dll}" todir="${tomcat.dist}" />
> <copy file="${nsis.nsexec.dll}" todir="${tomcat.dist}" />
> <copy file="${nsis.nsisdl.dll}" todir="${tomcat.dist}" />
> @@ -2626,6 +2642,7 @@ skip.installer property in build.properties" />
> <copy file="${nsis.nsdialogs.dll}" todir="${tomcat.dist}" />
> <copy file="res/install-win/tomcat.nsi" tofile="${tomcat.dist}/tomcat.nsi" overwrite="true" encoding="ISO-8859-1">
> <filterset refid="version.filters"/>
> + <filterset refid="path.filters"/>
> </copy>
> <fixcrlf srcdir="${tomcat.dist}" eol="crlf"
> encoding="ISO-8859-1" fixlast="false" >
> @@ -2637,44 +2654,54 @@ skip.installer property in build.properties" />
> </touch>
> </target>
>
> - <target name="-installer-create-tempinstaller"
> - unless="skip.installer" depends="-installer-prep">
> - <exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
> - <arg value="/DUNINSTALLONLY" />
> + <target name="-installer-wine" if="${wine.ok}">
> + <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
> + <arg value="${nsis.exe}" />
> <arg value="/DNSISDIR=${nsis.home}" />
> <arg value="/V2" />
> <arg value="tomcat.nsi" />
> </exec>
> - <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
> - <arg value="${nsis.exe}" />
> - <arg value="/DUNINSTALLONLY" />
> + </target>
> +
> + <target name="-installer-makensis" if="${makensis.ok}">
> + <exec dir="${tomcat.dist}" executable="makensis" osfamily="unix">
> + <arg value="-DNSISDIR=${nsis.home}" />
> + <arg value="-V2" />
> + <arg value="tomcat.nsi" />
> + </exec>
> + </target>
> +
> + <target name="-installer" unless="skip.installer"
> + depends="-installer-prep,-installer-wine,-installer-makensis">
> + <exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
> <arg value="/DNSISDIR=${nsis.home}" />
> <arg value="/V2" />
> <arg value="tomcat.nsi" />
> </exec>
> </target>
>
> - <target name="-installer-create-uninstaller"
> - unless="skip.installer" depends="-installer-create-tempinstaller">
> - <!-- Execute the temporary installer to create the uninstaller -->
> - <exec dir="${tomcat.dist}" executable="${tomcat.dist}/tempinstaller.exe"
> - osfamily="windows" />
> - <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
> - <arg value="${tomcat.dist}/tempinstaller.exe" />
> - </exec>
> - <!-- Reproducible builds: consistent timestamps for installer files -->
> - <touch datetime="${tstamp.file}" pattern="yyyy-MM-dd HH:mm:ss">
> - <fileset dir="${tomcat.dist}"/>
> - </touch>
> + <target name="installer-sign"
> + description="Builds and optionally signs the Windows installer"
> + depends="-installer" unless="skip.installer" >
> + <move file="${tomcat.dist}/tomcat-installer.exe" tofile="${tomcat.release}/v${version}/bin/${final.name}.exe" />
> + <!-- .exe has changed so need to redo checksums and OpenPGP signature -->
> + <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.asc" />
> + <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.sha512" />
> + <hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
> </target>
>
> - <target name="-installer-sign-uninstaller"
> - unless="skip.installer" depends="-installer-create-uninstaller,setup-jsign"
> - if="${do.codesigning}">
> - <!-- If the detached signature doesn't exist, this will sign the file -->
> - <!-- and create the detached signature. If the detached signature does -->
> - <!-- exist it will be attached to the file. -->
> - <jsign file="${tomcat.dist}/Uninstall.exe"
> + <!-- Called via a callback in the NSIS installer script -->
> + <target name="jsign-installer"
> + depends="setup-jsign" if="${do.codesigning}" >
> + <echo>Signing ${tomcat.dist}/tomcat-installer.exe</echo>
> + <!-- Copy pre-existing detachced signature to signing directory -->
> + <copy file="res/install-win/tomcat-installer.exe.sig"
> + tofile="${tomcat.dist}/tomcat-installer.exe.sig"
> + failonerror="false" />
> + <!-- If the detached signature doesn't exist, this will sign the file -->
> + <!-- and create the detached signature. If the detached signature does -->
> + <!-- exist it will be attached to the file. -->
> + <jsign file="${tomcat.dist}/tomcat-installer.exe"
> storepass="${codesigning.storepass}"
> storetype="${codesigning.storetype}"
> keypass="${codesigning.keypass}"
> @@ -2683,35 +2710,22 @@ skip.installer property in build.properties" />
> tsaurl="http://ts.ssl.com"
> tsmode="RFC3161"
> detached="true"/>
> - <!-- Copy detached signature to source tree -->
> - <copy file="${tomcat.dist}/Uninstall.exe.sig" todir="res/install-win"/>
> - <!-- Reproducible builds: consistent timestamps for installer files -->
> - <touch datetime="${tstamp.file}" pattern="yyyy-MM-dd HH:mm:ss">
> - <fileset dir="${tomcat.dist}"/>
> - </touch>
> - </target>
> -
> - <target name="-installer" unless="skip.installer"
> - depends="-installer-sign-uninstaller">
> - <exec dir="${tomcat.dist}" executable="${nsis.exe}" osfamily="windows">
> - <arg value="/DNSISDIR=${nsis.home}" />
> - <arg value="/V2" />
> - <arg value="tomcat.nsi" />
> - </exec>
> - <exec dir="${tomcat.dist}" executable="wine" osfamily="unix">
> - <arg value="${nsis.exe}" />
> - <arg value="/DNSISDIR=${nsis.home}" />
> - <arg value="/V2" />
> - <arg value="tomcat.nsi" />
> - </exec>
> - <move file="${tomcat.dist}/tomcat-installer.exe" tofile="${tomcat.release}/v${version}/bin/${final.name}.exe" />
> - <hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
> + <!-- Move detached signature to source tree -->
> + <move file="${tomcat.dist}/tomcat-installer.exe.sig" tofile="res/install-win/tomcat-installer.exe.sig"/>
> </target>
>
> - <target name="installer-sign"
> - description="Builds and optionally signs the Windows installer"
> - depends="-installer,setup-jsign" if="${do.codesigning}" >
> - <jsign file="${tomcat.release}/v${version}/bin/${final.name}.exe"
> + <!-- Called via a callback in the NSIS installer script -->
> + <target name="jsign-uninstaller"
> + depends="setup-jsign" if="${do.codesigning}" >
> + <echo>Signing ${codesigning.file_to_sign}</echo>
> + <!-- Copy pre-existing detachced signature to signing directory -->
> + <copy file="res/install-win/Uninstall.exe.sig"
> + tofile="${codesigning.file_to_sign}.sig"
> + failonerror="false" />
> + <!-- If the detached signature doesn't exist, this will sign the file -->
> + <!-- and create the detached signature. If the detached signature does -->
> + <!-- exist it will be attached to the file. -->
> + <jsign file="${codesigning.file_to_sign}"
> storepass="${codesigning.storepass}"
> storetype="${codesigning.storetype}"
> keypass="${codesigning.keypass}"
> @@ -2720,14 +2734,8 @@ skip.installer property in build.properties" />
> tsaurl="http://ts.ssl.com"
> tsmode="RFC3161"
> detached="true" />
> - <!-- Copy detached signature to source tree -->
> - <copy file="${tomcat.release}/v${version}/bin/${final.name}.exe.sig"
> - tofile="res/install-win/tomcat-installer.exe.sig"/>
> - <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.sig" />
> - <!-- .exe has changed so need to redo checksums and OpenPGP signature -->
> - <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.asc" />
> - <delete file="${tomcat.release}/v${version}/bin/${final.name}.exe.sha512" />
> - <hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.exe" />
> + <!-- Move detached signature to source tree -->
> + <move file="${codesigning.file_to_sign}.sig" tofile="res/install-win/Uninstall.exe.sig"/>
> </target>
>
> <target name="-pre-release-lone-target-check">
> diff --git a/res/install-win/tomcat.nsi b/res/install-win/tomcat.nsi
> index 7a14c58e82..e0cd26e76f 100644
> --- a/res/install-win/tomcat.nsi
> +++ b/res/install-win/tomcat.nsi
> @@ -17,11 +17,7 @@
>
> Unicode true
>
> -!ifdef UNINSTALLONLY
> - OutFile "tempinstaller.exe"
> -!else
> - OutFile tomcat-installer.exe
> -!endif
> +OutFile tomcat-installer.exe
>
> ;Compression options
> CRCCheck on
> @@ -118,11 +114,9 @@ Var ServiceInstallLog
> Page custom CheckUserType
> !insertmacro MUI_PAGE_FINISH
>
> - !ifdef UNINSTALLONLY
> - ;Uninstall Page order
> - !insertmacro MUI_UNPAGE_CONFIRM
> - !insertmacro MUI_UNPAGE_INSTFILES
> - !endif
> + ;Uninstall Page order
> + !insertmacro MUI_UNPAGE_CONFIRM
> + !insertmacro MUI_UNPAGE_INSTFILES
>
> ;Language
> !insertmacro MUI_LANGUAGE English
> @@ -163,6 +157,9 @@ Var ServiceInstallLog
> InstType Minimum
> InstType Full
>
> + !finalize 'ant -f @BASEDIR@/build.xml jsign-installer'
> + !uninstfinalize 'ant -f @BASEDIR@/build.xml -Dcodesigning.file_to_sign=%1 jsign-uninstaller'
This fails for me with Can't recognize xxx as an internal or external
command, or batch script.
I tried a few things without much success so far.
Rémy
> +
> ReserveFile System.dll
> ReserveFile nsDialogs.dll
> ReserveFile tomcat-users_1.xml
> @@ -201,6 +198,9 @@ Section "Core" SecTomcatCore
> SetOutPath $INSTDIR\webapps\ROOT
> File /r webapps\ROOT\*.*
>
> + ;Create uninstaller
> + WriteUninstaller "$INSTDIR\Uninstall.exe"
> +
> Call configure
>
> DetailPrint "Using Jvm: $JavaHome"
> @@ -349,12 +349,6 @@ Section -post
> Call createShortcuts
> ${EndIf}
>
> - !ifndef UNINSTALLONLY
> - SetOutPath $INSTDIR
> - ; this packages the signed uninstaller
> - File Uninstall.exe
> - !endif
> -
> WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\@VERSION_MAJOR_MINOR@\$TomcatServiceName" "InstallPath" $INSTDIR
> WriteRegStr HKLM "SOFTWARE\Apache Software Foundation\Tomcat\@VERSION_MAJOR_MINOR@\$TomcatServiceName" "Version" @VERSION@
> WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Apache Tomcat @VERSION_MAJOR_MINOR@ $TomcatServiceName" \
> @@ -436,14 +430,6 @@ Function ReadFromConfigIni
> FunctionEnd
>
> Function .onInit
> - !ifdef UNINSTALLONLY
> - ; If UNINSTALLONLY is defined, then we aren't supposed to do anything except write out
> - ; the installer. This is better than processing a command line option as it means
> - ; this entire code path is not present in the final (real) installer.
> - WriteUninstaller "$EXEDIR\Uninstall.exe"
> - Quit
> - !endif
> -
> ${GetParameters} $R0
> ClearErrors
>
> @@ -1248,7 +1234,6 @@ FunctionEnd
> ;--------------------------------
> ;Uninstaller Section
>
> -!ifdef UNINSTALLONLY
> Section Uninstall
>
> ${If} $TomcatServiceName == ""
> @@ -1383,6 +1368,4 @@ FunctionEnd
> FindClose $1
> FunctionEnd
>
> -!endif
> -
> ;eof
> diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
> index 1b5d1c08de..f6bb695ec4 100644
> --- a/webapps/docs/changelog.xml
> +++ b/webapps/docs/changelog.xml
> @@ -105,6 +105,14 @@
> issues do not "pop up" wrt. others).
> -->
> <section name="Tomcat 9.0.101 (remm)" rtext="in development">
> + <subsection name="Other">
> + <changelog>
> + <add>
> + Add <code>makensis</code> as an option for building the Installer for
> + Windows on non-Windows platforms. (rjung/markt)
> + </add>
> + </changelog>
> + </subsection>
> </section>
> <section name="Tomcat 9.0.100 (remm)" rtext="release in progress">
> <subsection name="Catalina">
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org