Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8267764

jpackage cannot handle window screensaver files when EXE renamed as SCR

XMLWordPrintable

    • 17
    • b26
    • x86_64
    • windows_10
    • Verified

      ADDITIONAL SYSTEM INFORMATION :
      Windows 10

      A DESCRIPTION OF THE PROBLEM :
      A Windows screensaver can be created from EXE simply by renaming or copying from extension .EXE to .SCR.

      REGRESSION : Last worked in version 16.0.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Use jpackage with --type app-image and --dest "build/jpackage.dir" to create exploded release directory.
      2) Copy any generated EXE to .SCR - say test.exe => test.scr
      3) Use jpackage with --type exe --app-image to create an installer
      4) Install the application
      5) Run test.exe
      6) Run test.scr


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      In JDK16 steps 5+6 the same application will run as expected

      ACTUAL -
      In JDK17 EA jpackage the application runs as expected for step 5, but the test.scr launches with error message:
      Error opening "C:\Program Files\APPNAME\app\test.scr.cfg" file: No such file or directory

      ---------- BEGIN SOURCE ----------
      package duncan.panama.screensaver;

      import java.util.Arrays;

      /**
       * Test issues with command line launch after using jpackage.
       * <p>Build a launcher for this class as test.exe and copy to test.scr
       */
      public class Test
      {
          public static void main(String[] args)
          {
              System.out.println("Application args: "+Arrays.toString(args));

              try {
                  String[] props = new String[]{"jpackage.app-path", "java.library.path"};
                  for (String prop : props) {
                      System.out.println("System.getProperty(\""+prop+"\") => "+System.getProperty(prop));
                  }

                  String[] libs = new String[]{"ole32", "user32", "advapi32","shell32","kernel32"};
                  for (String lib : libs) {
                      System.out.println("System.loadLibrary(\""+lib+"\")");
                      System.loadLibrary(lib);
                  }
              } catch(Throwable t) {
                  System.err.println("*** System load library FAILED *** "+ t.toString());
                  t.printStackTrace();
              }
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


        1. jpackage1.txt
          0.1 kB
        2. jpackage2.txt
          0.1 kB
        3. Test.java
          0.9 kB

            herrick Andy Herrick (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: