83 return bundle(params, outputParentDir); |
83 return bundle(params, outputParentDir); |
84 } |
84 } |
85 |
85 |
86 @Override |
86 @Override |
87 public boolean supported(boolean platformInstaller) { |
87 public boolean supported(boolean platformInstaller) { |
88 return WinMsiBundler.isSupported(); |
88 return msiBundler.supported(platformInstaller); |
89 } |
89 } |
90 |
90 |
91 @Override |
91 @Override |
92 public boolean isDefault() { |
92 public boolean isDefault() { |
93 return true; |
93 return true; |
94 } |
94 } |
95 |
95 |
96 @Override |
96 @Override |
97 public boolean validate(Map<String, ? super Object> params) |
97 public boolean validate(Map<String, ? super Object> params) |
98 throws ConfigException { |
98 throws ConfigException { |
99 return new WinMsiBundler().validate(params); |
99 return msiBundler.validate(params); |
100 } |
100 } |
101 |
101 |
102 public File bundle(Map<String, ? super Object> params, File outdir) |
102 public File bundle(Map<String, ? super Object> params, File outdir) |
103 throws PackagerException { |
103 throws PackagerException { |
104 |
104 |
105 IOUtils.writableOutputDir(outdir.toPath()); |
105 IOUtils.writableOutputDir(outdir.toPath()); |
106 |
106 |
107 File exeImageDir = EXE_IMAGE_DIR.fetchFrom(params); |
107 File exeImageDir = EXE_IMAGE_DIR.fetchFrom(params); |
108 |
108 |
109 // Write msi to temporary directory. |
109 // Write msi to temporary directory. |
110 File msi = new WinMsiBundler().bundle(params, exeImageDir); |
110 File msi = msiBundler.bundle(params, exeImageDir); |
111 |
111 |
112 try { |
112 try { |
113 return buildEXE(msi, outdir); |
113 return buildEXE(msi, outdir); |
114 } catch (IOException ex) { |
114 } catch (IOException ex) { |
115 Log.verbose(ex); |
115 Log.verbose(ex); |
149 private static String getString(String key) |
149 private static String getString(String key) |
150 throws MissingResourceException { |
150 throws MissingResourceException { |
151 return I18N.getString(key); |
151 return I18N.getString(key); |
152 } |
152 } |
153 |
153 |
|
154 private final WinMsiBundler msiBundler = new WinMsiBundler(); |
|
155 |
154 private static native int embedMSI(String exePath, String msiPath); |
156 private static native int embedMSI(String exePath, String msiPath); |
155 } |
157 } |