RFR: 8378877: jpackage: improve rebranding of exe files on Windows
Change how jpackage embeds icons, version and other properties in .exe files. Don't print 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>. warning. Instead, run the operation with retries. Additionally, throw JPackageException instead of RuntimeException to report errors; fail if invalid data is passed in the ctor instead of logging and ignoring it. ------------- Commit messages: - ExecutableRebrander: replace the warning about Windows defender with running the rebrander with retries - ExecutableRebrander: throw JPackageException instead of RuntimeException to report errors; fail if invalid data is passed in ctor instead of logging and ignoring it Changes: https://git.openjdk.org/jdk/pull/29906/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=29906&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8378877 Stats: 293 lines in 4 files changed: 37 ins; 208 del; 48 mod Patch: https://git.openjdk.org/jdk/pull/29906.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/29906/head:pull/29906 PR: https://git.openjdk.org/jdk/pull/29906
On Wed, 25 Feb 2026 02:09:13 GMT, Alexey Semenyuk <asemenyuk@openjdk.org> wrote:
Change how jpackage embeds icons, version and other properties in .exe files. Don't print
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>.
warning. Instead, run the operation with retries.
Additionally, throw JPackageException instead of RuntimeException to report errors; fail if invalid data is passed in the ctor instead of logging and ignoring it.
@sashamatveev PTAL ------------- PR Comment: https://git.openjdk.org/jdk/pull/29906#issuecomment-3975563674
On Wed, 25 Feb 2026 02:09:13 GMT, Alexey Semenyuk <asemenyuk@openjdk.org> wrote:
Change how jpackage embeds icons, version and other properties in .exe files. Don't print
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>.
warning. Instead, run the operation with retries.
Additionally, throw JPackageException instead of RuntimeException to report errors; fail if invalid data is passed in the ctor instead of logging and ignoring it.
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/ExecutableRebrander.java line 220:
218: Objects.requireNonNull(v); 219: if (v.contains("\r") || v.contains("\n")) { 220: throw new IllegalArgumentException("Configuration parameter contains multiple lines of text");
Should we have localized error for user input? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29906#discussion_r2875508765
On Tue, 3 Mar 2026 01:12:13 GMT, Alexander Matveev <almatvee@openjdk.org> wrote:
Change how jpackage embeds icons, version and other properties in .exe files. Don't print
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>.
warning. Instead, run the operation with retries.
Additionally, throw JPackageException instead of RuntimeException to report errors; fail if invalid data is passed in the ctor instead of logging and ignoring it.
src/jdk.jpackage/windows/classes/jdk/jpackage/internal/ExecutableRebrander.java line 220:
218: Objects.requireNonNull(v); 219: if (v.contains("\r") || v.contains("\n")) { 220: throw new IllegalArgumentException("Configuration parameter contains multiple lines of text");
Should we have localized error for user input?
No. It is internal and should never occur. If it does, it would indicate a bug in higher level input data validation code. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/29906#discussion_r2875551531
On Wed, 25 Feb 2026 02:09:13 GMT, Alexey Semenyuk <asemenyuk@openjdk.org> wrote:
Change how jpackage embeds icons, version and other properties in .exe files. Don't print
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>.
warning. Instead, run the operation with retries.
Additionally, throw JPackageException instead of RuntimeException to report errors; fail if invalid data is passed in the ctor instead of logging and ignoring it.
Looks good. ------------- Marked as reviewed by almatvee (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/29906#pullrequestreview-3879682124
On Wed, 25 Feb 2026 02:09:13 GMT, Alexey Semenyuk <asemenyuk@openjdk.org> wrote:
Change how jpackage embeds icons, version and other properties in .exe files. Don't print
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>.
warning. Instead, run the operation with retries.
Additionally, throw JPackageException instead of RuntimeException to report errors; fail if invalid data is passed in the ctor instead of logging and ignoring it.
This pull request has now been integrated. Changeset: c13fdc04 Author: Alexey Semenyuk <asemenyuk@openjdk.org> URL: https://git.openjdk.org/jdk/commit/c13fdc044d188d2266b2a96c4d1803b014a00633 Stats: 293 lines in 4 files changed: 37 ins; 208 del; 48 mod 8378877: jpackage: improve rebranding of exe files on Windows Reviewed-by: almatvee ------------- PR: https://git.openjdk.org/jdk/pull/29906
participants (2)
-
Alexander Matveev
-
Alexey Semenyuk