JDK-8183109 : EXEs produced by the packager lack the manifest settings that the java.exe has
  • Type: Bug
  • Component: deploy
  • Sub-Component: packager
  • Affected Version: 8u131
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: other
  • CPU: x86
  • Submitted: 2017-06-16
  • Updated: 2019-03-13
  • Resolved: 2019-03-13
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
1.8.0_131-b11

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Versions 10.0.14393]

A DESCRIPTION OF THE PROBLEM :
java.exe contains a manifest file that, amongst other things, sets 'dpi aware' to 'true'.  Something like this:

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  
  <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <asmv3:windowsSettings
         xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>True/PM</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</asmv1:assembly>

Thus when you run an app using java.exe you get correct scaling behaviour on high DPI displays.  However if you then package the app into an exe file, this file has no manifest.  So 'dpi aware' is not set, and the scaling behaviour is wrong.




REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
Work around is to manually use the mt.exe tool to copy the manifest from java.exe to your exe.


Comments
I think the problem with dpiAware only applies to JDK8u trying to reproduce problem using runtime-image.sh from packager-tests.jar (see https://wiki.se.oracle.com/display/JPG/JPackager+notes), by using an instance of JDK8u182 as jdk pointed to by runtime-image property, however any attempt to use older JDK results in exe that cannot run.
15-08-2018

According to the submitter, the executable produced from Java packager does not contain the manifest file to support dpi awareness value.
28-06-2017