mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Build self-contained APP bundle (non-MAS)
This commit is contained in:
parent
f932ac3901
commit
155c5cd5f9
@ -567,7 +567,7 @@
|
||||
<get-macos-jre dest="${dir.staging}" />
|
||||
|
||||
|
||||
<bundleapp jvmrequired="${jvm.version}" minimumsystemversion="${mac.version}" outputdirectory="${dir.staging}" executablename="filebot.launcher" name="${application.name}" displayname="${application.name}.launcher" version="${revision}" shortversion="${application.version}" identifier="${package.identifier}" mainclassname="${main.class}" icon="${dir.installer}/app/filebot.icns" copyright="${tstamp.year} ${package.company}" applicationcategory="${mac.application.category}" highresolutioncapable="true" supportsautomaticgraphicsswitching="true">
|
||||
<bundleapp jvmrequired="${jvm.version}" minimumsystemversion="${mac.version}" outputdirectory="${dir.staging}" executablename="filebot.launcher" name="${application.name}" displayname="${application.name}.launcher" version="${revision}" shortversion="${application.version}" identifier="${package.identifier}" mainclassname="${main.class}" icon="${dir.installer}/icons/filebot.icns" copyright="${tstamp.year} ${package.company}" applicationcategory="${mac.application.category}" highresolutioncapable="true" supportsautomaticgraphicsswitching="true">
|
||||
<arch name="x86_64" />
|
||||
<runtime dir="${dir.staging}/jre-${java.version}.jre/Contents/Home">
|
||||
<include name="**/*" />
|
||||
|
@ -114,9 +114,11 @@ public class Main {
|
||||
// CLI mode => run command-line interface and then exit
|
||||
if (args.runCLI()) {
|
||||
// just import and print license when running with --license option
|
||||
if (LICENSE.isFile() && args.getLicenseFile() != null) {
|
||||
configureLicense(args);
|
||||
System.exit(0);
|
||||
if (LICENSE.isFile()) {
|
||||
args.getLicenseFile().ifPresent(f -> {
|
||||
configureLicense(f);
|
||||
System.exit(0);
|
||||
});
|
||||
}
|
||||
|
||||
int status = new ArgumentProcessor().run(args);
|
||||
@ -162,9 +164,9 @@ public class Main {
|
||||
}
|
||||
}
|
||||
|
||||
private static void configureLicense(ArgumentBean args) {
|
||||
private static void configureLicense(File f) {
|
||||
try {
|
||||
License license = License.configure(args.getLicenseFile());
|
||||
License license = License.configure(f);
|
||||
log.info(license + " has been activated.");
|
||||
} catch (Throwable e) {
|
||||
log.severe("License Error: " + e.getMessage());
|
||||
@ -180,9 +182,7 @@ public class Main {
|
||||
|
||||
if (LICENSE.isFile()) {
|
||||
// import license if launched with license file
|
||||
if (args.getLicenseFile() != null) {
|
||||
configureLicense(args);
|
||||
}
|
||||
args.getLicenseFile().ifPresent(f -> configureLicense(f));
|
||||
|
||||
// make sure license is validated and cached
|
||||
try {
|
||||
@ -252,7 +252,13 @@ public class Main {
|
||||
// configure main window
|
||||
if (isMacApp()) {
|
||||
// Mac specific configuration
|
||||
MacAppUtilities.initializeApplication(FileBotMenuBar.createHelp(), files -> SwingEventBus.getInstance().post(new FileTransferable(files)));
|
||||
MacAppUtilities.initializeApplication(FileBotMenuBar.createHelp(), files -> {
|
||||
if (LICENSE.isFile() && files.size() == 1 && files.get(0).getName().endsWith(".psm")) {
|
||||
configureLicense(files.get(0));
|
||||
} else {
|
||||
SwingEventBus.getInstance().post(new FileTransferable(files));
|
||||
}
|
||||
});
|
||||
} else if (isUbuntuApp()) {
|
||||
// Ubuntu/Debian specific configuration
|
||||
frame.setIconImages(ResourceManager.getApplicationIconImages());
|
||||
|
@ -352,8 +352,8 @@ public class ArgumentBean {
|
||||
}).orElseThrow(error("Illegal mode", mode));
|
||||
}
|
||||
|
||||
public File getLicenseFile() {
|
||||
return license == null ? null : new File(license);
|
||||
public Optional<File> getLicenseFile() {
|
||||
return optional(license).map(File::new);
|
||||
}
|
||||
|
||||
private final String[] args;
|
||||
|
Loading…
x
Reference in New Issue
Block a user