Snap specific browser with absolute path

This commit is contained in:
RetGal 2021-02-26 17:51:33 +01:00
parent 27fb12fb45
commit a925a0acc5
2 changed files with 4 additions and 1 deletions

View File

@ -273,7 +273,7 @@ public class Assistant implements Configurable<AssistantConfiguration>, Clipboar
help.addActionListener(ev1 -> {
if (isSnapped()) {
try {
new ProcessBuilder("dayon.browser", getQuickStartURI(FrameType.ASSISTANT).toString()).start();
new ProcessBuilder(getSnapBrowserCommand(), getQuickStartURI(FrameType.ASSISTANT).toString()).start();
} catch (URISyntaxException | IOException ex) {
Log.warn("Help Error!", ex);
}

View File

@ -206,6 +206,9 @@ public abstract class SystemUtilities {
return System.getProperty("java.class.path").startsWith("/snap/");
}
/**
* Computes the absolute path to dayon.browser
*/
public static String getSnapBrowserCommand() {
String cp = System.getProperty("java.class.path");
return cp.substring(0, cp.indexOf("jar")) + "bin/dayon.browser";