From fc79f013c4c9bc3b5782e064ea63315b3c90859e Mon Sep 17 00:00:00 2001 From: lotus Date: Thu, 12 Jun 2008 20:04:32 +0000 Subject: [PATCH] better solution to update shortcut git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4920 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- addon/YaCy-Search.html | 1 + addon/YaCy-Search.url | 2 -- htroot/ConfigBasic.java | 3 +-- source/de/anomic/yacy/yacyAccessible.java | 10 +++------- yacy.nsi | 6 +++--- 5 files changed, 8 insertions(+), 14 deletions(-) create mode 100644 addon/YaCy-Search.html delete mode 100644 addon/YaCy-Search.url diff --git a/addon/YaCy-Search.html b/addon/YaCy-Search.html new file mode 100644 index 000000000..fbfeb8a8d --- /dev/null +++ b/addon/YaCy-Search.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/addon/YaCy-Search.url b/addon/YaCy-Search.url deleted file mode 100644 index 1e3b94082..000000000 --- a/addon/YaCy-Search.url +++ /dev/null @@ -1,2 +0,0 @@ -[InternetShortcut] -URL=http://localhost:8080/ diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index a91cc3584..aa4f80911 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -143,8 +143,7 @@ public class ConfigBasic { prop.put("nextStep_sslSupport", theServerCore.withSSL() ? "1" : "0"); // generate new shortcut (used for Windows) - //yacyAccessible.setNewPortLink(Integer.parseInt(port)); - // TODO: Windows doesn't open new location even when new content is written to file (some cache seem to be active) + yacyAccessible.setNewPortLink(Integer.parseInt(port)); // force reconnection in 7 seconds theServerCore.reconnect(7000); diff --git a/source/de/anomic/yacy/yacyAccessible.java b/source/de/anomic/yacy/yacyAccessible.java index e566bd73d..afc7289ed 100644 --- a/source/de/anomic/yacy/yacyAccessible.java +++ b/source/de/anomic/yacy/yacyAccessible.java @@ -58,18 +58,14 @@ public class yacyAccessible { public boolean IWasAccessed; /** - * updates Shortcut /addon/YaCy-Search.url + * updates Shortcut /addon/YaCy-Search.html * @param newPort */ public static void setNewPortLink(int newPort){ try { plasmaSwitchboard sb = plasmaSwitchboard.getSwitchboard(); - File shortcut = new File(sb.getRootPath() + "/addon/YaCy-Search.url".replace("/", File.separator)); - // FIXME (doesn't work) try destroying some Windows cache - shortcut.delete(); - String content = - "[InternetShortcut]" + serverCore.LF_STRING + - "URL=http://localhost:" + newPort + "/" + serverCore.LF_STRING; + File shortcut = new File(sb.getRootPath() + "/addon/YaCy-Search.html".replace("/", File.separator)); + String content = ""; serverFileUtils.copy(content.getBytes(), shortcut); } catch (Exception e) { return; diff --git a/yacy.nsi b/yacy.nsi index d1f69da8b..0d8e3c02f 100755 --- a/yacy.nsi +++ b/yacy.nsi @@ -201,7 +201,7 @@ Section "Shortcuts in the Start Menu" CreateShortCut "$SMPROGRAMS\YaCy\stop YaCy.lnk" "$INSTDIR\stopYACY.bat" "" "$INSTDIR\addon\YaCy.ico" CreateShortCut "$SMPROGRAMS\YaCy\Readme.lnk" "$INSTDIR\readme.txt" CreateShortCut "$SMPROGRAMS\YaCy\Uninstall.lnk" "$INSTDIR\Uninstall.exe" - CreateShortCut "$SMPROGRAMS\YaCy\YaCy-Search.lnk" "$INSTDIR\addon\YaCy-Search.url" "" "$INSTDIR\addon\YaCy.ico" + CreateShortCut "$SMPROGRAMS\YaCy\YaCy-Search.lnk" "$INSTDIR\addon\YaCy-Search.html" "" "$INSTDIR\addon\YaCy.ico" SectionEnd #Section "YACY on the Desktop" @@ -216,12 +216,12 @@ Section "YaCy on the Desktop" SectionEnd Section "Searchpage on the Desktop" - CreateShortCut "$DESKTOP\YaCy-Search.lnk" "$INSTDIR\addon\YaCy-Search.url" "" "$INSTDIR\addon\YaCy.ico" + CreateShortCut "$DESKTOP\YaCy-Search.lnk" "$INSTDIR\addon\YaCy-Search.html" "" "$INSTDIR\addon\YaCy.ico" SectionEnd Section "Searchpage in the Quicklaunch" SectionIn 1 2 3 - CreateShortCut "$QUICKLAUNCH\YaCy-Search.lnk" "$INSTDIR\addon\YaCy-Search.url" "" "$INSTDIR\addon\YaCy.ico" + CreateShortCut "$QUICKLAUNCH\YaCy-Search.lnk" "$INSTDIR\addon\YaCy-Search.html" "" "$INSTDIR\addon\YaCy.ico" SectionEnd Section "YaCy in Startup"