Skip to content

Commit

Permalink
Merge pull request #948 from AdoptOpenJDK/improve_logging_desktop_int…
Browse files Browse the repository at this point in the history
…egration

OWS-630: add more logging for desktop shortcuts
  • Loading branch information
janakmulani authored Jun 12, 2024
2 parents 5b82cc5 + 9e071eb commit bffd064
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void createShortcutOnWindowsDesktop() throws IOException {
sl.setIconLocation(iconLocation.get());
}
final String path = getDesktopLnkPath();
LOG.debug("Desktop Link Path : {}", path);
LOG.debug("Desktop Entry Link Path : {}", path);
sl.saveTo(path);
// write shortcut path to list
manageShortcutList(path);
Expand Down Expand Up @@ -144,11 +144,14 @@ public void createWindowsMenu() throws IOException {
ul.setIconLocation(iconLocation.get());
}
final String link = getShortcutFileName();
sl.saveTo(path + "/" + link);
ul.saveTo(path + "/Uninstall " + link);
final String menuLinkpath = path + "/" + link;
LOG.debug("Menu Entry Link Path : {}", menuLinkpath);
sl.saveTo(menuLinkpath);
final String uninstallLinkPath = path + "/Uninstall " + link;
ul.saveTo(uninstallLinkPath);
// write shortcuts to list
manageShortcutList(path + "/" + link);
manageShortcutList(path + "/Uninstall " + link);
manageShortcutList(menuLinkpath);
manageShortcutList(uninstallLinkPath);
}

private void manageShortcutList(String path) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private void installMenuLauncher(AccessWarningPaneComplexReturn.ShortcutResult i
try {
File f = getLinuxMenuIconFile();
FileUtils.saveFileUtf8(getContent(true, info), f);
LOG.info("Menu item created: {}", f.getAbsolutePath());
LOG.info("Installing Menu Launcher : Menu item created: {}", f.getAbsolutePath());
} catch (FileNotFoundException e) {
LOG.error(IcedTeaWebConstants.DEFAULT_ERROR_MESSAGE, e);
} catch (IOException e) {
Expand Down Expand Up @@ -262,7 +262,7 @@ private void installDesktopLauncher(AccessWarningPaneComplexReturn.ShortcutResul

String[] execString = new String[] { "xdg-desktop-icon", "install", "--novendor",
shortcutFile.getCanonicalPath() };
LOG.debug("Executing: " + Arrays.toString(execString));
LOG.debug("Installing Desktop Launcher : Executing: " + Arrays.toString(execString));
ProcessBuilder pb = new ProcessBuilder(execString);
pb.inheritIO();
Process installer = pb.start();
Expand Down

0 comments on commit bffd064

Please sign in to comment.