src/jdk.jpackage/windows/classes/jdk/jpackage/internal/WindowsAppImageBuilder.java
branchJDK-8200758-branch
changeset 57450 82c78b40b39d
parent 57446 5a5b85f00a63
child 57740 9b19a9cd651c
equal deleted inserted replaced
57448:ac7b7fe5f7d8 57450:82c78b40b39d
    72             "WinLauncher.template";
    72             "WinLauncher.template";
    73 
    73 
    74     private final Path root;
    74     private final Path root;
    75     private final Path appDir;
    75     private final Path appDir;
    76     private final Path appModsDir;
    76     private final Path appModsDir;
    77     private final String relativeModsDir;
       
    78     private final Path runtimeDir;
    77     private final Path runtimeDir;
    79     private final Path mdir;
    78     private final Path mdir;
    80     private final Path binDir;
    79     private final Path binDir;
    81 
    80 
    82     private final Map<String, ? super Object> params;
    81     private final Map<String, ? super Object> params;
   123         this.params = config;
   122         this.params = config;
   124 
   123 
   125         this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params));
   124         this.root = imageOutDir.resolve(APP_NAME.fetchFrom(params));
   126         this.appDir = root.resolve("app");
   125         this.appDir = root.resolve("app");
   127         this.appModsDir = appDir.resolve("mods");
   126         this.appModsDir = appDir.resolve("mods");
   128         this.relativeModsDir = "app/mods";
       
   129         this.runtimeDir = root.resolve("runtime");
   127         this.runtimeDir = root.resolve("runtime");
   130         this.mdir = runtimeDir.resolve("lib");
   128         this.mdir = runtimeDir.resolve("lib");
   131         this.binDir = root.resolve("bin");
   129         this.binDir = root.resolve("bin");
   132         Files.createDirectories(appDir);
   130         Files.createDirectories(appDir);
   133         Files.createDirectories(runtimeDir);
   131         Files.createDirectories(runtimeDir);
   141 
   139 
   142         this.params = null;
   140         this.params = null;
   143         this.root = imageOutDir.resolve(jreName);
   141         this.root = imageOutDir.resolve(jreName);
   144         this.appDir = null;
   142         this.appDir = null;
   145         this.appModsDir = null;
   143         this.appModsDir = null;
   146         this.relativeModsDir = null;
       
   147         this.runtimeDir = root;
   144         this.runtimeDir = root;
   148         this.mdir = runtimeDir.resolve("lib");
   145         this.mdir = runtimeDir.resolve("lib");
   149         this.binDir = null;
   146         this.binDir = null;
   150         Files.createDirectories(runtimeDir);
   147         Files.createDirectories(runtimeDir);
   151     }
   148     }
   195     }
   192     }
   196 
   193 
   197     @Override
   194     @Override
   198     public Path getAppModsDir() {
   195     public Path getAppModsDir() {
   199         return appModsDir;
   196         return appModsDir;
   200     }
       
   201 
       
   202     @Override
       
   203     public String getRelativeModsDir() {
       
   204         return relativeModsDir;
       
   205     }
   197     }
   206 
   198 
   207     @Override
   199     @Override
   208     public void prepareApplicationFiles() throws IOException {
   200     public void prepareApplicationFiles() throws IOException {
   209         Map<String, ? super Object> originalParams = new HashMap<>(params);
   201         Map<String, ? super Object> originalParams = new HashMap<>(params);
   320 
   312 
   321         Files.copy(in, iconTarget.toPath(),
   313         Files.copy(in, iconTarget.toPath(),
   322                 StandardCopyOption.REPLACE_EXISTING);
   314                 StandardCopyOption.REPLACE_EXISTING);
   323 
   315 
   324         writeCfgFile(params, root.resolve(
   316         writeCfgFile(params, root.resolve(
   325                 getLauncherCfgName(params)).toFile(), "$APPDIR\\runtime");
   317                 getLauncherCfgName(params)).toFile());
   326 
   318 
   327         prepareExecutableProperties(params);
   319         prepareExecutableProperties(params);
   328 
   320 
   329         // Copy executable to bin folder
   321         // Copy executable to bin folder
   330         Path executableFile = binDir.resolve(getLauncherName(params));
   322         Path executableFile = binDir.resolve(getLauncherName(params));