117 }
118
119 private File getConfig_VolumeIcon(Map<String, ? super Object> params) {
120 return new File(CONFIG_ROOT.fetchFrom(params),
121 APP_NAME.fetchFrom(params) + "-volume.icns");
122 }
123
124 private File getConfig_LicenseFile(Map<String, ? super Object> params) {
125 return new File(CONFIG_ROOT.fetchFrom(params),
126 APP_NAME.fetchFrom(params) + "-license.plist");
127 }
128
129 private void prepareLicense(Map<String, ? super Object> params) {
130 try {
131 String licFileStr = LICENSE_FILE.fetchFrom(params);
132 if (licFileStr == null) {
133 return;
134 }
135
136 File licFile = new File(licFileStr);
137 byte[] licenseContentOriginal = Files.readAllBytes(licFile.toPath());
138 String licenseInBase64 =
139 Base64.getEncoder().encodeToString(licenseContentOriginal);
140
141 Map<String, String> data = new HashMap<>();
142 data.put("APPLICATION_LICENSE_TEXT", licenseInBase64);
143
144 try (Writer w = Files.newBufferedWriter(
145 getConfig_LicenseFile(params).toPath())) {
146 w.write(preprocessTextResource(
147 getConfig_LicenseFile(params).getName(),
148 I18N.getString("resource.license-setup"),
149 DEFAULT_LICENSE_PLIST, data, VERBOSE.fetchFrom(params),
150 RESOURCE_DIR.fetchFrom(params)));
151 }
152
153 } catch (IOException ex) {
154 Log.verbose(ex);
155 }
156 }
157
|
117 }
118
119 private File getConfig_VolumeIcon(Map<String, ? super Object> params) {
120 return new File(CONFIG_ROOT.fetchFrom(params),
121 APP_NAME.fetchFrom(params) + "-volume.icns");
122 }
123
124 private File getConfig_LicenseFile(Map<String, ? super Object> params) {
125 return new File(CONFIG_ROOT.fetchFrom(params),
126 APP_NAME.fetchFrom(params) + "-license.plist");
127 }
128
129 private void prepareLicense(Map<String, ? super Object> params) {
130 try {
131 String licFileStr = LICENSE_FILE.fetchFrom(params);
132 if (licFileStr == null) {
133 return;
134 }
135
136 File licFile = new File(licFileStr);
137 byte[] licenseContentOriginal =
138 Files.readAllBytes(licFile.toPath());
139 String licenseInBase64 =
140 Base64.getEncoder().encodeToString(licenseContentOriginal);
141
142 Map<String, String> data = new HashMap<>();
143 data.put("APPLICATION_LICENSE_TEXT", licenseInBase64);
144
145 try (Writer w = Files.newBufferedWriter(
146 getConfig_LicenseFile(params).toPath())) {
147 w.write(preprocessTextResource(
148 getConfig_LicenseFile(params).getName(),
149 I18N.getString("resource.license-setup"),
150 DEFAULT_LICENSE_PLIST, data, VERBOSE.fetchFrom(params),
151 RESOURCE_DIR.fetchFrom(params)));
152 }
153
154 } catch (IOException ex) {
155 Log.verbose(ex);
156 }
157 }
158
|