JavaPackager icon indicating copy to clipboard operation
JavaPackager copied to clipboard

winrun4j don't support 32bit EXE

Open gfek2001zz opened this issue 1 year ago • 6 comments

help

gfek2001zz avatar Feb 18 '24 05:02 gfek2001zz

Hi @gfek2001zz! Please, could you explain your issue a bit more? AFAIK winrun4j binary file is compiled for 32 bit architecture, but have to check it to be 100% sure

fvarrui avatar Feb 21 '24 15:02 fvarrui

Hi @gfek2001zz! Please, could you explain your issue a bit more? AFAIK winrun4j binary file is compiled for 32 bit architecture, but have to check it to be 100% sure

Sorry, you are right. JP just distributes WinRun4J64.exe (64-bit version). I'm going to add support for 32-bit.

fvarrui avatar Feb 27 '24 17:02 fvarrui

Hi again!

Changes pushed into issue-395 branch. I also used this branch to do some more improvements, as remove winrun4j-launcher auxiliary library (not needed anymore).

Tests

64-bit

JP keeps the current behaviour:

<configuration>
	<platform>windows</platform>
	<winConfig>
		<exeCreationTool>winrun4j</exeCreationTool>
	</winConfig>
</configuration>

Simplified configuration just to illustrate JP behavior

After building, you can check (using Sysinternals SisCheck tool, e.g.) that the EXE is 64-bit:

C:\Users\fvarrui\GitHub\HelloWorldMaven>sigcheck target\helloworldmaven\HelloWorldMaven.exe

Sigcheck v2.90 - File version and signature viewer
Copyright (C) 2004-2022 Mark Russinovich
Sysinternals - www.sysinternals.com

C:\Users\fvarrui\GitHub\HelloWorldMaven\target\helloworldmaven\HelloWorldMaven.exe:
        Verified:       Unsigned
        Link date:      23:47 13/04/2013
        Publisher:      n/a
        Company:        ACME
        Description:    HelloWorldMaven
        Product:        HelloWorldMaven
        Prod version:   1.0.0.0
        File version:   1.0.0.0
        MachineType:    64-bit

And the bundled java (generated with jlink):

C:\Users\fvarrui\GitHub\HelloWorldMaven>sigcheck target\HelloWorldMaven\jre\bin\server\jvm.dll

Sigcheck v2.90 - File version and signature viewer
Copyright (C) 2004-2022 Mark Russinovich
Sysinternals - www.sysinternals.com

C:\Users\fvarrui\GitHub\HelloWorldMaven\target\helloworldmaven\jre\bin\server\jvm.dll:
        Verified:       Signed
        Signing date:   4:30 17/01/2024
        Publisher:      Eclipse.org Foundation, Inc.
        Company:        Eclipse Adoptium
        Description:    OpenJDK 64-Bit server VM
        Product:        OpenJDK Platform 21.0.2
        Prod version:   21.0.2.0
        File version:   21.0.2.0
        MachineType:    64-bit

32-bit

I have to bundle a 32-bit JRE (see jrePath) since I'm building on a 64-bit Windows, because WinRun4J 32-bit needs it, unless your system has a 32-bit JRE installed (not my case). Notice that now when using WinRun4J you can set arch=x86 if you want a 32-bit WinRun4J.exe (on a 64-bit Windows system arch=x64 by default).

<configuration>
	<platform>windows</platform>
	<jrePath>C:\Users\fvarrui\jdks\windows\jdk-11.0.22+7-jre</jrePath>
	<arch>x86</arch>
	<winConfig>
		<exeCreationTool>winrun4j</exeCreationTool>
	</winConfig>
</configuration>

Simplified configuration just to illustrate JP behavior

And now, after building:

C:\Users\fvarrui\GitHub\HelloWorldMaven>sigcheck target\HelloWorldMaven\HelloWorldMaven.exe

Sigcheck v2.90 - File version and signature viewer
Copyright (C) 2004-2022 Mark Russinovich
Sysinternals - www.sysinternals.com

C:\Users\fvarrui\GitHub\HelloWorldMaven\target\helloworldmaven\HelloWorldMaven.exe:
        Verified:       Unsigned
        Link date:      23:47 13/04/2013
        Publisher:      n/a
        Company:        ACME
        Description:    HelloWorldMaven
        Product:        HelloWorldMaven
        Prod version:   1.0.0.0
        File version:   1.0.0.0
        MachineType:    32-bit

And the bundled java (copied from jrePath):


C:\Users\fvarrui\GitHub\HelloWorldMaven>sigcheck target\HelloWorldMaven\jre\bin\server\jvm.dll

Sigcheck v2.90 - File version and signature viewer
Copyright (C) 2004-2022 Mark Russinovich
Sysinternals - www.sysinternals.com

C:\Users\fvarrui\GitHub\HelloWorldMaven\target\helloworldmaven\jre\bin\server\jvm.dll:
        Verified:       Signed
        Signing date:   0:21 17/01/2024
        Publisher:      Eclipse.org Foundation, Inc.
        Company:        Eclipse Adoptium
        Description:    OpenJDK server VM
        Product:        OpenJDK 11.0.22
        Prod version:   11.0.22.0
        File version:   11.0.22.0
        MachineType:    32-bit

Release

Just released a snapshot version which supports WinRun4j 32-bit EXE: 1.7.6-20240227.185320-2. Take a look at how to use JP snapshot versions in the README.

Please, try it and give me some feedback. Thanks!

fvarrui avatar Feb 27 '24 19:02 fvarrui

New snapshot version released with several improvements: 1.7.6-20240228.024956-3.

Now also checks if the bundled JRE matches the target architecture, preventing an invalid app from being generated.

fvarrui avatar Feb 28 '24 02:02 fvarrui

thanks !!!

gfek2001zz avatar Mar 21 '24 03:03 gfek2001zz

Branch issue-395 merged into devel, ready to be released to Maven Central asap.

fvarrui avatar Mar 30 '24 15:03 fvarrui

v1.7.6 released to Maven Central

fvarrui avatar Jun 30 '24 12:06 fvarrui