Index: trunk/native/windows/MLConsole.properties
===================================================================
--- trunk/native/windows/MLConsole.properties	(revision 18155)
+++ trunk/native/windows/MLConsole.properties	(revision 18155)
@@ -0,0 +1,1 @@
+win-console=true
Index: trunk/native/windows/win-jpackage.sh
===================================================================
--- trunk/native/windows/win-jpackage.sh	(revision 18153)
+++ trunk/native/windows/win-jpackage.sh	(revision 18155)
@@ -18,5 +18,5 @@
 fi
 
-echo "Building JOSM Windows Installer package"
+echo "Building JOSM Windows Installer packages"
 
 mkdir app
@@ -25,5 +25,5 @@
 then
     echo "SIGN_CERT, SIGN_STOREPASS and SIGN_TSA are not set in the environment."
-    echo "A JOSM.msi will be created but not signed."
+    echo "A JOSM.exe and JOSM.msi will be created but not signed."
     SIGNAPP=false
 else
@@ -35,8 +35,10 @@
 JPACKAGEOPTIONS=""
 
-echo "Building MSI"
-jpackage $JPACKAGEOPTIONS -n "JOSM" --input dist --main-jar josm-custom.jar \
+echo "Building EXE and MSI"
+for type in exe msi
+do
+    jpackage $JPACKAGEOPTIONS -n "JOSM" --input dist --main-jar josm-custom.jar \
     --main-class org.openstreetmap.josm.gui.MainApplication \
-    --icon ./native/windows/logo.ico --type msi --dest app \
+    --icon ./native/windows/logo.ico --type $type --dest app \
     --java-options "--add-exports=java.base/sun.security.action=ALL-UNNAMED" \
     --java-options "--add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED" \
@@ -60,7 +62,14 @@
     --file-associations native/file-associations/osm.properties \
     --file-associations native/file-associations/zip.properties \
+    --add-launcher HWConsole=native/windows/MLConsole.properties \
     --add-modules java.base,java.datatransfer,java.desktop,java.logging,java.management,java.naming,java.net.http,java.prefs,java.rmi,java.scripting,java.sql,java.transaction.xa,java.xml,jdk.crypto.ec,jdk.jfr,jdk.jsobject,jdk.unsupported,jdk.unsupported.desktop,jdk.xml.dom
+done
 
+mv app/JOSM-1.5.$1.exe app/JOSM.exe
 mv app/JOSM-1.5.$1.msi app/JOSM.msi
+
+# Workaround to https://bugs.openjdk.java.net/browse/JDK-8261845
+# to remove after we switch to Java 17+ for jpackage builds
+chmod u+w app/JOSM.exe
 
 echo "Building done."
@@ -69,5 +78,8 @@
     CERTIFICATE_P12=certificate.p12
     echo "$SIGN_CERT" | base64 --decode > $CERTIFICATE_P12
-    signtool.exe sign //f $CERTIFICATE_P12 //d "Java OpenStreetMap Editor" //du "https://josm.openstreetmap.de" //p "$SIGN_STOREPASS" //v //fd SHA256 //tr "$SIGN_TSA" //td SHA256 "app/JOSM.msi"
+    for ext in exe msi
+    do
+        signtool.exe sign //f $CERTIFICATE_P12 //d "Java OpenStreetMap Editor" //du "https://josm.openstreetmap.de" //p "$SIGN_STOREPASS" //v //fd SHA256 //tr "$SIGN_TSA" //td SHA256 "app/JOSM.$ext"
+    done
     rm $CERTIFICATE_P12
 fi
