|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
24 | 24 | */
|
25 | 25 | package jdk.jpackage.internal;
|
26 | 26 |
|
27 |
| -import jdk.jpackage.internal.model.WinExePackage; |
28 |
| -import jdk.jpackage.internal.model.ConfigException; |
29 |
| -import jdk.jpackage.internal.model.PackagerException; |
| 27 | +import static jdk.jpackage.internal.StandardBundlerParam.ICON; |
| 28 | +import static jdk.jpackage.internal.util.function.ThrowingRunnable.toRunnable; |
| 29 | + |
30 | 30 | import java.io.IOException;
|
31 |
| -import java.io.InputStream; |
32 | 31 | import java.nio.file.Files;
|
33 | 32 | import java.nio.file.Path;
|
34 | 33 | import java.nio.file.StandardCopyOption;
|
35 | 34 | import java.util.Map;
|
36 |
| -import static jdk.jpackage.internal.util.function.ThrowingRunnable.toRunnable; |
37 |
| -import static jdk.jpackage.internal.StandardBundlerParam.ICON; |
38 |
| -import jdk.jpackage.internal.resources.ResourceLocator; |
| 35 | +import jdk.jpackage.internal.model.ConfigException; |
| 36 | +import jdk.jpackage.internal.model.PackagerException; |
| 37 | +import jdk.jpackage.internal.model.WinExePackage; |
39 | 38 |
|
40 | 39 | @SuppressWarnings("restricted")
|
41 | 40 | public class WinExeBundler extends AbstractBundler {
|
@@ -114,9 +113,11 @@ private Path buildEXE(BuildEnv env, WinExePackage pkg, Path msi,
|
114 | 113 |
|
115 | 114 | // Copy template msi wrapper next to msi file
|
116 | 115 | final Path exePath = msi.getParent().resolve(pkg.packageFileNameWithSuffix());
|
117 |
| - try (InputStream is = ResourceLocator.class.getResourceAsStream("msiwrapper.exe")) { |
118 |
| - Files.copy(is, exePath); |
119 |
| - } |
| 116 | + |
| 117 | + env.createResource("msiwrapper.exe") |
| 118 | + .setCategory(I18N.getString("resource.installer-exe")) |
| 119 | + .setPublicName("installer.exe") |
| 120 | + .saveToFile(exePath); |
120 | 121 |
|
121 | 122 | new ExecutableRebrander(pkg, env::createResource, resourceLock -> {
|
122 | 123 | // Embed msi in msi wrapper exe.
|
|
0 commit comments