macos fixes

This commit is contained in:
crschnick 2024-04-02 07:07:13 +00:00
parent fa7b6d66bd
commit ac36f7043a
3 changed files with 16 additions and 4 deletions

View file

@ -65,9 +65,21 @@ public class DesktopShortcuts {
pc.executeSimpleCommand("chmod ugo+x \"" + executable + "\"");
pc.getShellDialect()
.createScriptTextFileWriteCommand(pc, "APPL????", base + "/PkgInfo")
.createTextFileWriteCommand(pc, "APPL????", base + "/Contents/PkgInfo")
.execute();
pc.executeSimpleCommand("cp \"" + icon + "\" \"" + base + "/Contents/Resources/" + name + ".icns\"");
pc.getShellDialect()
.createTextFileWriteCommand(pc, """
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
</dict>
</plist>
""", base + "/Contents/Info.plist")
.execute();
pc.executeSimpleCommand("cp \"" + icon + "\" \"" + base + "/Contents/Resources/icon.icns\"");
}
}

View file

@ -85,9 +85,9 @@ public class ShellTemp {
public static String getSubDirectory(ShellControl proc, String... sub) throws Exception {
var base = proc.getSystemTemporaryDirectory();
var arr = Stream.concat(Stream.of(base), Arrays.stream(sub)).toArray(String[]::new);
var arr = Stream.concat(Stream.of(base.toString()), Arrays.stream(sub)).toArray(String[]::new);
var dir = FileNames.join(arr);
// We assume that this directory does not exist yet and therefore don't perform any checks
proc.getShellDialect().prepareUserTempDirectory(proc, dir).execute();

BIN
dist/logo/logo.icns vendored

Binary file not shown.