jpackage: improve rebranding of exe files on Windows

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 27
    • Component/s: tools
    • None
    • generic
    • windows

      On Windows, jpackage changes icons, version, and other properties of .exe files (launchers and EXE installers).

      This functionality is encapsulated in jdk.jpackage.internal.ExecutableRebrander class [1].

      Before jpackage edits an .exe file, it prints to the console the following message:

      ```
      Warning: Windows Defender may prevent jpackage from functioning. If there is an issue, it can be addressed by either disabling realtime monitoring, or adding an exclusion for the directory <TMPDIR>.
      ```

      where <TMPDIR> is the directory where jpackage assembles the output package.

      This warning is merely helpful when the user uses the "--temp" option and has control over the jpackage's work directory. This is an uncommon scenario. This warning makes little to no sense when jpackage creates a new, unique work directory.

      Rework ExecutableRebrander class so that instead of printing the warning, it would perform its operation on .exe files with retries.

      [1] https://github.com/openjdk/jdk/blob/e0b040a6c6713827033e9ba51c9ded920dd0203b/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/ExecutableRebrander.java

            Assignee:
            Alexey Semenyuk
            Reporter:
            Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: