Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
fixed windows installer; updated download path for java installer
Michael Peter Christen3ecb0b459ee8
diff --git a/README.md b/README.mdindex fac273ffa..b0538b7f3 100644--- a/README.md+++ b/README.md@@ -87,6 +87,25 @@ Stop YaCy on the console with./stopYACY.sh```+### Build the Windows installer++Windows installers are built with NSIS and require the release payload produced by Ant.+Install NSIS (`makensis`) and then run:++```+ant distWinInstaller+```++This runs the full build, stages files into `RELEASE/MAIN`, and produces the installer+in `RELEASE/` as `yacy_v<version>_*.exe`.++If you want it in two steps, you can run:++```+ant copyMain4Dist+makensis RELEASE/WINDOWS/build.nsi+```+### Run YaCy using DockerThe Official YaCy Image is `yacy/yacy_search_server:latest`. It is hosted on Dockerhub at [https://hub.docker.com/r/yacy/yacy_search_server](https://hub.docker.com/r/yacy/yacy_search_server)diff --git a/build.nsi b/build.nsiindex b4badbb0e..379d60196 100644--- a/build.nsi+++ b/build.nsi@@ -1,391 +1,739 @@-;yacy.nsi-; -----------------------------------------;(C) 2004-2006 by Alexander Schier-;(C) 2008-2010 by David Wieditz-;(C) 2011 by Rene Kluge-;(C) 2018 by luccioman; https://github.com/luccioman-/*-----------------------------------------MANUALS-http://nsis.sourceforge.net/Docs/-http://nsis.sourceforge.net/Docs/Modern%20UI%202/Readme.html------------------------------------------COMMAND LINE OPTIONS (case sensitive):-/S - silent install/uninstall-/D="C:\yacy" - installation folder-----------------------------------------*/--; -----------------------------------------; MODERN UI+; YaCy Windows Installer (NSIS)!include MUI2.nsh!include x64.nsh!include FileFunc.nsh-!include WinVer.nsh--; -----------------------------------------; GENERAL--;Unicode true+!include LogicLib.nsh+!include WordFunc.nsh+!include WinMessages.nsh++!ifndef WS_SIZEBOX+!define WS_SIZEBOX 0x00040000+!endif+!ifndef WS_MAXIMIZEBOX+!define WS_MAXIMIZEBOX 0x00010000+!endif+!ifndef GWL_STYLE+!define GWL_STYLE -16+!endif++!ifndef SWP_NOMOVE+!define SWP_NOMOVE 0x0002+!endif+!ifndef SWP_NOSIZE+!define SWP_NOSIZE 0x0001+!endif+!ifndef SWP_NOZORDER+!define SWP_NOZORDER 0x0004+!endif+!ifndef SWP_FRAMECHANGED+!define SWP_FRAMECHANGED 0x0020+!endifVIProductVersion "@[email protected]"VIAddVersionKey "ProductName" "YaCy"VIAddVersionKey "LegalCopyright" "YaCy"VIAddVersionKey "FileVersion" "@REPL_VERSION@"VIAddVersionKey "FileDescription" "YaCy"-VIAddVersionKey "OriginalFilename" "yacy_v@REPL_VERSION@_@REPL_REPVERDATE@@REPL_REPVERTIME@_@[email protected]"+VIAddVersionKey "OriginalFilename" "@[email protected]"Name "YaCy @REPL_VERSION@"-OutFile "RELEASE\WINDOWS\yacy_v@REPL_VERSION@_@REPL_REPVERDATE@@REPL_REPVERTIME@_@[email protected]"--;default installation folder-InstallDir "$PROFILE\YaCy"-InstallDirRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString"+OutFile "@REPL_RELEASE_WINDOWS_ABS@/@[email protected]"-;recommend free space in GB for YaCy-!define RecommendSpace "4"--; commands for firewall config, see http://support.microsoft.com/kb/947709/en-us-!define WinXPAddFwRulePort 'netsh firewall add portopening TCP 8090 name="YaCy"'-!define WinXPDelFwRulePort 'netsh firewall del portopening TCP 8090'-!define WinVistaAddFwRulePort 'netsh advfirewall firewall add rule name="YaCy" dir=in action=allow enable=yes protocol=TCP localport=8090'-!define WinVistaDelFwRulePort 'netsh advfirewall firewall del rule name="YaCy"'-var WinAddFwRulePort-var WinDelFwRulePort--;requested execution level on Vista / 7-RequestExecutionLevel admin+InstallDir "$LOCALAPPDATA\Programs\YaCy"+InstallDirRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "InstallLocation"+RequestExecutionLevel userSetCompressor /SOLID LZMA-!insertmacro MUI_RESERVEFILE_LANGDLL ;loads faster--; -----------------------------------------; GENERAL APPEARANCE+!insertmacro MUI_RESERVEFILE_LANGDLL-;BrandingText "yacy.net"--!define MUI_ICON "RELEASE\MAIN\addon\YaCy.ico"+!define MUI_ICON "@REPL_RELEASE_MAIN_ABS@/addon/YaCy.ico"!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"+!define MUI_ABORTWARNING-!define MUI_WELCOMEFINISHPAGE_BITMAP "RELEASE\MAIN\addon\installer\network.bmp"--!define MUI_HEADERIMAGE-!define MUI_HEADERIMAGE_BITMAP "RELEASE\MAIN\addon\installer\logo.bmp"-!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH--!define MUI_ABORTWARNING ;display warning before aborting installation+!define MUI_CUSTOMFUNCTION_GUIINIT YaCyGuiInit-; -----------------------------------------; INSTALLER PAGES--!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyWelcomeShowCallback!insertmacro MUI_PAGE_WELCOME--Function MyWelcomeShowCallback- SendMessage $mui.WelcomePage.Text ${WM_SETTEXT} 0 "STR:$(MUI_TEXT_WELCOME_INFO_TEXT)$\r$\n$\r$\nThe YaCy project needs a maintainer for this installer!$\r$\nSee github.com/yacy/yacy_search_server/labels/Windows"-FunctionEnd--!insertmacro MUI_PAGE_LICENSE gpl.txt--!define MUI_COMPONENTSPAGE_NODESC-!insertmacro MUI_PAGE_COMPONENTS-ComponentText "YaCy v@REPL_VERSION@"--!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckDriveSpace+!insertmacro MUI_PAGE_LICENSE "@REPL_ROOT_ABS@/gpl.txt"!insertmacro MUI_PAGE_DIRECTORY-!insertmacro MUI_PAGE_INSTFILES--!define MUI_PAGE_CUSTOMFUNCTION_SHOW SHOW_PageFinish_custom-!define MUI_FINISHPAGE_SHOWREADME https://www.youtube.com/yacy_tutorials-!define MUI_FINISHPAGE_SHOWREADME_TEXT $(finishPage)+!define MUI_FINISHPAGE_SHOWREADME "$TEMP\\yacy-installer.log"+!define MUI_FINISHPAGE_SHOWREADME_TEXT "Open installer log"+!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED!insertmacro MUI_PAGE_FINISH-; -----------------------------------------; UNINSTALLER PAGES-!insertmacro MUI_UNPAGE_CONFIRM-!insertmacro MUI_UNPAGE_INSTFILES-; -----------------------------------------; LANGUAGES-!insertmacro MUI_LANGUAGE "English"-!insertmacro MUI_LANGUAGE "French"-!insertmacro MUI_LANGUAGE "German"--LangString stillRunning ${LANG_ENGLISH} "YaCy is still active. Please stop YaCy first."-LangString keepData 0 "Do you want to keep the data?"-LangString finishPage 0 "Show how to configure the Windows Firewall for YaCy."-LangString yacyNoHd 0 "YaCy should be installed on a hard disk. Continue with selected folder?"-LangString yacyNeedSpace 0 "We recommend ${RecommendSpace} GB free space for YaCy. There are only $TempDriveFree GB left. Continue anyway?"-LangString yacyNeedOs 0 "Please run Windows 2000 or better (e.g. Windows XP, Vista or Windows 7) for YaCy."-LangString yacyNoJavaFoundOpenBrowser ${LANG_ENGLISH} "Java 8 has not been found in the Windows registry!$\r$\n(Key: SOFTWARE\JavaSoft\Java Runtime Environment)$\r$\nOpen download location (adoptium.net) in Browser?"-LangString yacyNoJavaFoundContinue ${LANG_ENGLISH} "Click Retry to check again for installed Java version!"--LangString stillRunning ${LANG_FRENCH} "YaCy is still active. Please stop YaCy first."-LangString keepData 0 "Do you want to keep the data?"-LangString finishPage 0 "Show how to configure the Windows Firewall for YaCy."-LangString yacyNoHd 0 "YaCy should be installed on a hard disk. Continue with selected folder?"-LangString yacyNeedSpace 0 "We recommend ${RecommendSpace} GB free space for YaCy. There are only $TempDriveFree GB left. Continue anyway?"-LangString yacyNeedOs 0 "Please run Windows 2000 or better (e.g. Windows XP, Vista or Windows 7) for YaCy."-LangString yacyNoJavaFoundOpenBrowser 0 "Java 8 has not been found in the Windows registry!$\r$\n(Key: SOFTWARE\JavaSoft\Java Runtime Environment)$\r$\nOpen download location (adoptium.net) in Browser?"-LangString yacyNoJavaFoundContinue 0 "Click Retry to check again for installed Java version!"--LangString stillRunning ${LANG_GERMAN} "YaCy ist noch aktiv. Bitte beenden Sie YaCy."-LangString keepData 0 "Möchten Sie die Daten behalten?"-LangString finishPage 0 "Zeige die Windows Firewall Konfiguration fuer YaCy."-LangString yacyNoHd 0 "YaCy sollte auf einer Festplatte installiert werden. Soll der gewählte Ordner trotzdem verwendet werden?"-LangString yacyNeedSpace 0 "Wir empfehlen ${RecommendSpace} GB für YaCy. Es sind noch $TempDriveFree GB frei. Trotzdem fortfahren?"-LangString yacyNeedOs 0 "YaCy benoetigt Windows 2000 oder besser (z.B. Windows XP, Vista oder Windows 7)."-LangString yacyNoJavaFoundOpenBrowser 0 "Java 8 wurde in der Windows registry nicht gefunden!$\r$\n(Key: SOFTWARE\JavaSoft\Java Runtime Environment)$\r$\nDie Downloadseite (adoptium.net) im Browser öffnen?"-LangString yacyNoJavaFoundContinue 0 "Wähle Wiederholen, um erneut zu versuchen, Java zu finden!"--; -----------------------------------------; INSTALLABLE MODULES--;InstType "Normal"--Section "check Java 8 installed" Sec_Java_id- SectionIn 1 RO- SetShellVarContext current-- ; init of JRE section- ; detect JRE first- var /global InstalledJREVersion- ${If} ${RunningX64}- SetRegView 64- ${EndIf}- Retry:- ReadRegStr $InstalledJREVersion HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"-- ${If} $InstalledJREVersion != "11"- MessageBox MB_ICONEXCLAMATION|MB_YESNO "$(yacyNoJavaFoundOpenBrowser)" IDNO ContinueWithoutJava- ExecShell open "https://adoptium.net/de/temurin/releases/?version=8"-- MessageBox MB_ICONEXCLAMATION|MB_ABORTRETRYIGNORE "$(yacyNoJavaFoundContinue)" IDIGNORE ContinueWithoutJava IDRETRY Retry- Abort- ${EndIf}- ContinueWithoutJava:-SectionEnd--Section "YaCy"- SectionIn 1 RO- SetShellVarContext current ; use system variables (folders) for current user- RMDir /r "$INSTDIR\lib" ;remove old libraries in case of update- RMDir /r "$SMPROGRAMS\YaCy" ;clear old shortcuts- Delete "$QUICKLAUNCH\YaCy-Search.lnk" ;old- Delete "$DESKTOP\YaCy-Search.lnk" ;old- Delete "$SMSTARTUP\start YaCy (no console).lnk" ;old-- SetOutPath $INSTDIR- ;set noindex attribute for windows indexing service- nsExec::Exec 'attrib +I "$INSTDIR"'- nsExec::Exec 'attrib +I "$INSTDIR\*" /S /D'-- File /r /x *.sh "RELEASE\MAIN\*"-- WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DisplayName" "YaCy"- WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString" '"$INSTDIR\uninstall.exe"'- WriteUninstaller "uninstall.exe"-SectionEnd--Section "Start Menu Group"- SectionIn 1- SetShellVarContext current- CreateDirectory "$SMPROGRAMS\YaCy"- CreateShortCut "$SMPROGRAMS\YaCy\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED- CreateShortCut "$SMPROGRAMS\YaCy\Readme.lnk" "$INSTDIR\readme.txt"- CreateShortCut "$SMPROGRAMS\YaCy\Uninstall.lnk" "$INSTDIR\Uninstall.exe"-SectionEnd-Section "Desktop Icon"- SectionIn 1- SetShellVarContext current- CreateShortCut "$DESKTOP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED+LangString javaMissing 0 "Java 11 or newer is required to run YaCy. Download and install the latest Temurin JRE now?"+LangString javaDownloadFail 0 "Java download failed. Please install Java 11+ manually."+LangString javaInstallFail 0 "Java 11+ was not found after installation. YaCy may not start until Java is installed."+LangString keepData 0 "Remove YaCy user data as well?"++Var JavaVersion+Var JavaMajor+Var JavaFound+Var JavaInstallerUrl+Var JavaInstallerPath+Var DataDir+Var LogFile+Var JavaHome++Section "YaCy" Sec_YaCy+ SetDetailsView show+ Push "Installer log: $LogFile"+ Call LogLine+ Call EnsureJava+ SetShellVarContext current++ SetOutPath $INSTDIR+ RMDir /r "$INSTDIR\lib"+ RMDir /r "$SMPROGRAMS\YaCy"+ Delete "$DESKTOP\YaCy.lnk"++ File /r /x *.sh "@REPL_RELEASE_MAIN_ABS@/*"++ WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DisplayName" "YaCy"+ WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "InstallLocation" "$INSTDIR"+ WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString" '"$INSTDIR\uninstall.exe"'+ WriteRegStr HKCU "Software\YaCy" "DataDir" "$LOCALAPPDATA\YaCy"+ WriteUninstaller "$INSTDIR\uninstall.exe"++ CreateDirectory "$SMPROGRAMS\YaCy"+ CreateShortCut "$SMPROGRAMS\YaCy\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED+ CreateShortCut "$SMPROGRAMS\YaCy\Readme.lnk" "$INSTDIR\readme.txt"+ CreateShortCut "$SMPROGRAMS\YaCy\Uninstall.lnk" "$INSTDIR\uninstall.exe"+ CreateShortCut "$DESKTOP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZEDSectionEnd-Section "Configure Firewall" Sec_Firewall_id- SectionIn 1- SetShellVarContext current- call OpenFirewall-SectionEnd--/*-Section "YaCy in Startup"- SetShellVarContext current- CreateShortCut "$SMSTARTUP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED-SectionEnd-*/--; -----------------------------------------; UNINSTALLER-Section "Uninstall"- ClearErrors- Delete "$INSTDIR\DATA\yacy.running"- IfErrors 0 uninstall- MessageBox MB_ICONSTOP "$(stillRunning)" /SD IDOK- Goto nouninstall-- uninstall:- Call un.CloseFirewall- SetShellVarContext current-- RMDir /r "$INSTDIR\addon"- RMDir /r "$INSTDIR\bin"- RMDir /r "$INSTDIR\classes"- RMDir /r "$INSTDIR\defaults"- RMDir /r "$INSTDIR\htroot"- RMDir /r "$INSTDIR\langstats"- RMDir /r "$INSTDIR\lib"- RMDir /r "$INSTDIR\libbuild"- RMDir /r "$INSTDIR\libx"- RMDir /r "$INSTDIR\locales"- RMDir /r "$INSTDIR\ranking"- RMDir /r "$INSTDIR\skins"- RMDir /r "$INSTDIR\source"- Delete "$INSTDIR\*.*"-- MessageBox MB_YESNO|MB_ICONQUESTION "$(keepData)" /SD IDYES IDYES keepdata-- ;delete all- RMDir /r "$INSTDIR"-- ;or jump to this- keepdata:- RMDir /r "$SMPROGRAMS\YaCy"- Delete "$DESKTOP\YaCy.lnk"- Delete "$SMSTARTUP\YaCy.lnk"-- DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy"- nouninstall:+ SetShellVarContext current++ RMDir /r "$INSTDIR\addon"+ RMDir /r "$INSTDIR\bin"+ RMDir /r "$INSTDIR\classes"+ RMDir /r "$INSTDIR\defaults"+ RMDir /r "$INSTDIR\htroot"+ RMDir /r "$INSTDIR\langstats"+ RMDir /r "$INSTDIR\langdetect"+ RMDir /r "$INSTDIR\lib"+ RMDir /r "$INSTDIR\libbuild"+ RMDir /r "$INSTDIR\libx"+ RMDir /r "$INSTDIR\locales"+ RMDir /r "$INSTDIR\ranking"+ RMDir /r "$INSTDIR\skins"+ RMDir /r "$INSTDIR\source"+ Delete "$INSTDIR\*.*"++ RMDir /r "$SMPROGRAMS\YaCy"+ Delete "$DESKTOP\YaCy.lnk"++ ReadRegStr $DataDir HKCU "Software\YaCy" "DataDir"+ ${If} $DataDir == ""+ StrCpy $DataDir "$LOCALAPPDATA\YaCy"+ ${EndIf}+ MessageBox MB_YESNO|MB_ICONQUESTION "$(keepData)" IDYES RemoveData+ Goto SkipRemoveData+ RemoveData:+ RMDir /r "$DataDir"+ SkipRemoveData:++ DeleteRegKey HKCU "Software\YaCy"+ DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy"SectionEnd-; -----------------------------------------; FUNCTIONS--Function .onInit- ; check Windows-Version, need Win 2000 or higher- ${If} ${AtMostWinME}- MessageBox MB_ICONSTOP "$(yacyNeedOs)"- Abort- ${EndIf}-- ; init of Firewall section, only valid for WindowsXP SP2/SP3 and Vista/Win 7 with Admin- var /global FirewallServiceStart- IntOp $FirewallServiceStart 3 + 0-- ${If} ${IsWinVista}- ${OrIf} ${IsWin7}- StrCpy $WinAddFwRulePort '${WinVistaAddFwRulePort}'- StrCpy $WinDelFwRulePort '${WinVistaDelFwRulePort}'- ReadRegDWORD $FirewallServiceStart HKLM "SYSTEM\CurrentControlSet\services\MpsSvc" "Start"- ${EndIf}-- ${If} ${IsWinXP}- ${AndIf} ${AtLeastServicePack} 2- StrCpy $WinAddFwRulePort '${WinXPAddFwRulePort}'- StrCpy $WinDelFwRulePort '${WinXPDelFwRulePort}'- ReadRegDWORD $FirewallServiceStart HKLM "SYSTEM\CurrentControlSet\services\SharedAccess" "Start"- ${EndIf}-- ;need Admin for firewall-config- ${IfNot} $0 = "Admin"- IntOp $FirewallServiceStart 3 + 0- ${EndIf}-- ; hide and deselect Firewall if no proper configuration- ${If} $FirewallServiceStart > 2- SectionSetText ${Sec_Firewall_id} ""- SectionSetFlags ${Sec_Firewall_id} 0- ${EndIf}+Function EnsureJava+ Push "Java detection: starting"+ Call LogLine+ Call GetJavaVersion+ Push "Java detection: found=$JavaFound version='$JavaVersion' major=$JavaMajor"+ Call LogLine+ StrCmp $JavaFound "1" JavaOk JavaMissing+ JavaMissing:+ Push "Java detection: no Java found"+ Call LogLine+ MessageBox MB_ICONEXCLAMATION|MB_YESNO "$(javaMissing)" IDYES JavaDownload IDNO JavaContinue+ Goto JavaContinue+ JavaOk:+ Push "Java detection: OK"+ Call LogLine+ Goto JavaContinue++ JavaDownload:+ Push "Java install: downloading Temurin JRE"+ Call LogLine+ Call DownloadJava+ Push "Java install: download/install finished, re-checking"+ Call LogLine+ Call GetJavaVersion+ Push "Java detection (post-install): found=$JavaFound version='$JavaVersion' major=$JavaMajor"+ Call LogLine+ StrCmp $JavaFound "1" 0 JavaStillLow+ JavaStillLow:+ MessageBox MB_ICONEXCLAMATION "$(javaInstallFail)"+ JavaContinue:FunctionEnd-Function CheckDriveSpace- var /global RootFolder- var /global TempDriveFree- var /global RootFolderType-- ; if "\\Folder" it's a Network-Folder- StrCpy $RootFolder $InstDir 2- StrCmp $RootFolder "\\" NetworkFolder Driveletter+Function GetJavaVersion+ StrCpy $JavaVersion ""+ StrCpy $JavaMajor "0"+ StrCpy $JavaFound "0"++ ${If} ${RunningX64}+ SetRegView 64+ Push "Java detection: registry view 64"+ Call LogLine+ Call FindJavaVersionKeys+ SetRegView 32+ Push "Java detection: registry view 32"+ Call LogLine+ Call FindJavaVersionKeys+ ${Else}+ Push "Java detection: registry view default"+ Call LogLine+ Call FindJavaVersionKeys+ ${EndIf}++ Push "Java detection: registry done, found=$JavaFound version='$JavaVersion' major=$JavaMajor"+ Call LogLine+ Call FindJavaFromEnv+ Call FindJavaFromProgramFiles+ Call FindJavaFromPath+ ${If} $JavaFound == "1"+ ${If} $JavaMajor == "0"+ StrCpy $JavaMajor "11"+ Push "Java detection: version unknown, assuming >=11"+ Call LogLine+ ${EndIf}+ ${EndIf}+ Push "Java detection: PATH/env/fs check done, found=$JavaFound version='$JavaVersion' major=$JavaMajor"+ Call LogLine+FunctionEnd- Networkfolder:- ; prepare String for DriveSpace- ${GetRoot} $RootFolder $InstDir- goto NoHDD+Function FindJavaVersionKeys+ Push "SOFTWARE\JavaSoft\Java Runtime Environment"+ Call FindJavaVersionInKeyHKLM+ Push "SOFTWARE\JavaSoft\JDK"+ Call FindJavaVersionInKeyHKLM+ Push "SOFTWARE\Eclipse Adoptium\JRE"+ Call FindJavaVersionInKeyHKLM+ Push "SOFTWARE\Eclipse Adoptium\JDK"+ Call FindJavaVersionInKeyHKLM+ Push "SOFTWARE\Adoptium\JRE"+ Call FindJavaVersionInKeyHKLM+ Push "SOFTWARE\Adoptium\JDK"+ Call FindJavaVersionInKeyHKLM+ Push "SOFTWARE\Microsoft\JDK"+ Call FindJavaVersionInKeyHKLM+ Push "SOFTWARE\Microsoft\JRE"+ Call FindJavaVersionInKeyHKLM++ Push "SOFTWARE\JavaSoft\Java Runtime Environment"+ Call FindJavaVersionInKeyHKCU+ Push "SOFTWARE\JavaSoft\JDK"+ Call FindJavaVersionInKeyHKCU+ Push "SOFTWARE\Eclipse Adoptium\JRE"+ Call FindJavaVersionInKeyHKCU+ Push "SOFTWARE\Eclipse Adoptium\JDK"+ Call FindJavaVersionInKeyHKCU+ Push "SOFTWARE\Adoptium\JRE"+ Call FindJavaVersionInKeyHKCU+ Push "SOFTWARE\Adoptium\JDK"+ Call FindJavaVersionInKeyHKCU+ Push "SOFTWARE\Microsoft\JDK"+ Call FindJavaVersionInKeyHKCU+ Push "SOFTWARE\Microsoft\JRE"+ Call FindJavaVersionInKeyHKCU+FunctionEnd- ; now check drive-letters- Driveletter:- StrCpy $RootFolder $InstDir 3+Function FindJavaVersionInKeyHKLM+ Exch $1+ Push "Java detection: HKLM\\$1"+ Call LogLine+ Push $2+ Push $3+ Push $4+ Push $5+ Push $6+ Push $7+ Push $8++ StrCpy $2 ""+ ReadRegStr $2 HKLM "$1" "CurrentVersion"+ ${If} $2 != ""+ ReadRegStr $3 HKLM "$1\\$2" "JavaHome"+ Push "Java detection: HKLM\\$1 CurrentVersion=$2 JavaHome='$3'"+ Call LogLine+ ${If} $3 != ""+ IfFileExists "$3\\bin\\java.exe" 0 CheckEnum+ Push "Java detection: java.exe found at $3\\bin\\java.exe"+ Call LogLine+ StrCpy $JavaFound "1"+ Push $2+ Call GetJavaMajor+ Pop $6+ IntCmp $6 $JavaMajor NoUpdate NoUpdate UpdateMajor+ NoUpdate:+ Goto DoneCompare+ UpdateMajor:+ StrCpy $JavaMajor $6+ StrCpy $JavaVersion $2+ DoneCompare:+ Goto DoneHKLM+ ${EndIf}+ ${EndIf}++ CheckEnum:+ StrCpy $3 0+ StrCpy $4 ""+ EnumLoop:+ EnumRegKey $5 HKLM "$1" $3+ ${If} $5 == ""+ Goto EnumDone+ ${EndIf}+ ReadRegStr $7 HKLM "$1\\$5" "JavaHome"+ ${If} $7 != ""+ Push "Java detection: HKLM\\$1\\$5 JavaHome='$7'"+ Call LogLine+ IfFileExists "$7\\bin\\java.exe" 0 EnumNext+ ${If} $4 == ""+ StrCpy $4 $5+ ${Else}+ StrCpy $8 ""+ ${VersionCompare} $5 $4 $8+ ${If} $8 == "1"+ StrCpy $4 $5+ ${EndIf}+ ${EndIf}+ ${EndIf}+ EnumNext:+ IntOp $3 $3 + 1+ Goto EnumLoop+ EnumDone:+ StrCpy $2 $4+ ${If} $2 != ""+ StrCpy $JavaFound "1"+ Push $2+ Call GetJavaMajor+ Pop $6+ IntCmp $6 $JavaMajor NoUpdateEnum NoUpdateEnum UpdateMajorEnum+ NoUpdateEnum:+ Goto DoneHKLM+ UpdateMajorEnum:+ StrCpy $JavaMajor $6+ StrCpy $JavaVersion $2+ ${EndIf}+ DoneHKLM:++ Pop $8+ Pop $7+ Pop $6+ Pop $5+ Pop $4+ Pop $3+ Pop $2+ Pop $1+FunctionEnd- ; prepare for {GetDrives-Loop}- StrCpy $RootFolderType "invalid"- ${GetDrives} "ALL" "CheckDriveType"+Function FindJavaVersionInKeyHKCU+ Exch $1+ Push "Java detection: HKCU\\$1"+ Call LogLine+ Push $2+ Push $3+ Push $4+ Push $5+ Push $6+ Push $7+ Push $8++ StrCpy $2 ""+ ReadRegStr $2 HKCU "$1" "CurrentVersion"+ ${If} $2 != ""+ ReadRegStr $3 HKCU "$1\\$2" "JavaHome"+ Push "Java detection: HKCU\\$1 CurrentVersion=$2 JavaHome='$3'"+ Call LogLine+ ${If} $3 != ""+ IfFileExists "$3\\bin\\java.exe" 0 CheckEnumCU+ Push "Java detection: java.exe found at $3\\bin\\java.exe"+ Call LogLine+ StrCpy $JavaFound "1"+ Push $2+ Call GetJavaMajor+ Pop $6+ IntCmp $6 $JavaMajor NoUpdate NoUpdate UpdateMajor+ NoUpdate:+ Goto DoneCompare+ UpdateMajor:+ StrCpy $JavaMajor $6+ StrCpy $JavaVersion $2+ DoneCompare:+ Goto DoneHKCU+ ${EndIf}+ ${EndIf}++ CheckEnumCU:+ StrCpy $3 0+ StrCpy $4 ""+ EnumLoopCU:+ EnumRegKey $5 HKCU "$1" $3+ ${If} $5 == ""+ Goto EnumDoneCU+ ${EndIf}+ ReadRegStr $7 HKCU "$1\\$5" "JavaHome"+ ${If} $7 != ""+ Push "Java detection: HKCU\\$1\\$5 JavaHome='$7'"+ Call LogLine+ IfFileExists "$7\\bin\\java.exe" 0 EnumNextCU+ ${If} $4 == ""+ StrCpy $4 $5+ ${Else}+ StrCpy $8 ""+ ${VersionCompare} $5 $4 $8+ ${If} $8 == "1"+ StrCpy $4 $5+ ${EndIf}+ ${EndIf}+ ${EndIf}+ EnumNextCU:+ IntOp $3 $3 + 1+ Goto EnumLoopCU+ EnumDoneCU:+ StrCpy $2 $4+ ${If} $2 != ""+ StrCpy $JavaFound "1"+ Push $2+ Call GetJavaMajor+ Pop $6+ IntCmp $6 $JavaMajor NoUpdateEnum NoUpdateEnum UpdateMajorEnum+ NoUpdateEnum:+ Goto DoneHKCU+ UpdateMajorEnum:+ StrCpy $JavaMajor $6+ StrCpy $JavaVersion $2+ ${EndIf}+ DoneHKCU:++ Pop $8+ Pop $7+ Pop $6+ Pop $5+ Pop $4+ Pop $3+ Pop $2+ Pop $1+FunctionEnd- ; jump if error- StrCmp $RootFolderType "invalid" CheckSpace+Function LogLine+ Exch $0+ Push $1+ FileOpen $1 $LogFile a+ FileWrite $1 "$0$\r$\n"+ FileClose $1+ DetailPrint "$0"+ Pop $1+ Pop $0+FunctionEnd- ; jump if HDD- StrCmp $RootFolderType "HDD" CheckSpace+Function .onInit+ StrCpy $LogFile "$TEMP\\yacy-installer.log"+ Delete $LogFile+FunctionEnd- NoHDD:- ; stay on folder-selection if user wants to give another folder, else check free space- MessageBox MB_ICONEXCLAMATION|MB_YESNO "$(yacyNoHd)" IDYES NextPage- Abort+Function YaCyGuiInit+ ${If} ${RunningX64}+ System::Call 'user32::GetWindowLongPtr(p $HWNDPARENT, i ${GWL_STYLE}) p .r0'+ IntOp $0 $0 | ${WS_SIZEBOX}+ IntOp $0 $0 | ${WS_MAXIMIZEBOX}+ System::Call 'user32::SetWindowLongPtr(p $HWNDPARENT, i ${GWL_STYLE}, p r0)'+ ${Else}+ System::Call 'user32::GetWindowLong(p $HWNDPARENT, i ${GWL_STYLE}) i .r0'+ IntOp $0 $0 | ${WS_SIZEBOX}+ IntOp $0 $0 | ${WS_MAXIMIZEBOX}+ System::Call 'user32::SetWindowLong(p $HWNDPARENT, i ${GWL_STYLE}, i r0)'+ ${EndIf}+ System::Call 'user32::SetWindowPos(p $HWNDPARENT, p 0, i 0, i 0, i 0, i 0, i ${SWP_NOMOVE}|${SWP_NOSIZE}|${SWP_NOZORDER}|${SWP_FRAMECHANGED})'+FunctionEnd- CheckSpace:+Function FindJavaFromPath+ Push $0+ Push $1+ Push $2++ nsExec::ExecToStack 'cmd /c java -version 2^>^&1'+ Pop $0+ Pop $1+ Push "Java detection: java -version exit=$0"+ Call LogLine+ Push "Java detection: java -version output=$1"+ Call LogLine+ ${If} $0 == "0"+ StrCpy $JavaFound "1"+ Push $1+ Call FindFirstInt+ Pop $2+ IntCmp $2 $JavaMajor PathNoUpdate PathNoUpdate PathUpdate+ PathNoUpdate:+ Goto PathDone+ PathUpdate:+ StrCpy $JavaMajor $2+ StrCpy $JavaVersion $2+ PathDone:+ ${EndIf}++ Pop $2+ Pop $1+ Pop $0+FunctionEnd- ClearErrors- ${DriveSpace} $RootFolder "/D=F /S=G" $TempDriveFree- ; if DriveSpace fails for any reason -> jump ahead- IfErrors NextPage+Function FindJavaFromEnv+ ReadEnvStr $JavaHome "JAVA_HOME"+ ${If} $JavaHome != ""+ Push "Java detection: JAVA_HOME=$JavaHome"+ Call LogLine+ IfFileExists "$JavaHome\\bin\\java.exe" 0 JavaHomeDone+ Push "$JavaHome\\bin\\java.exe"+ Call TryJavaExe+ ${EndIf}+ JavaHomeDone:+ ReadEnvStr $JavaHome "JDK_HOME"+ ${If} $JavaHome != ""+ Push "Java detection: JDK_HOME=$JavaHome"+ Call LogLine+ IfFileExists "$JavaHome\\bin\\java.exe" 0 JdkHomeDone+ Push "$JavaHome\\bin\\java.exe"+ Call TryJavaExe+ ${EndIf}+ JdkHomeDone:+FunctionEnd- ${If} $TempDriveFree < ${RecommendSpace}- MessageBox MB_ICONEXCLAMATION|MB_YESNO "$(yacyNeedSpace)" IDYES NextPage- Abort- ${EndIf}+Function FindJavaFromProgramFiles+ Push "$PROGRAMFILES64\\Java"+ Call ScanJavaDir+ Push "$PROGRAMFILES\\Java"+ Call ScanJavaDir+ Push "$PROGRAMFILES64\\Eclipse Adoptium"+ Call ScanJavaDir+ Push "$PROGRAMFILES\\Eclipse Adoptium"+ Call ScanJavaDir+ Push "$PROGRAMFILES64\\Adoptium"+ Call ScanJavaDir+ Push "$PROGRAMFILES\\Adoptium"+ Call ScanJavaDir+FunctionEnd- NextPage:+Function ScanJavaDir+ Exch $0+ Push $1+ Push $2+ Push $3++ IfFileExists "$0\\*" 0 ScanDone+ FindFirst $1 $2 "$0\\*"+ ScanLoop:+ StrCmp $2 "" ScanDone+ IfFileExists "$0\\$2\\bin\\java.exe" 0 ScanNext+ Push "$0\\$2\\bin\\java.exe"+ Call TryJavaExe+ ScanNext:+ FindNext $1 $2+ Goto ScanLoop+ ScanDone:+ FindClose $1+ Pop $3+ Pop $2+ Pop $1+ Pop $0FunctionEnd-Function CheckDriveType-; based on http://nsis.sourceforge.net/GetDrives- ${If} $9 == $RootFolder- StrCpy $RootFolderType $8- StrCpy $0 StopGetDrives- ${EndIf}- Push $0+Function TryJavaExe+ Exch $0+ Push $1+ Push $2+ Push $3++ StrCpy $1 'cmd /c ""$0" -version 2^>^&1"'+ nsExec::ExecToStack $1+ Pop $2+ Pop $3+ ${If} $2 == "0"+ StrCpy $JavaFound "1"+ Push $3+ Call FindFirstInt+ Pop $1+ IntCmp $1 $JavaMajor 0 0 TryUpdate+ Goto TryDone+ TryUpdate:+ StrCpy $JavaMajor $1+ StrCpy $JavaVersion $1+ TryDone:+ ${EndIf}++ Pop $3+ Pop $2+ Pop $1+ Pop $0FunctionEnd-Function OpenFirewall- var /global ExecErrorCode- ; run netsh- nsExec::ExecToStack '$WinAddFwRulePort'- pop $ExecErrorCode- ; if run without error register for uninstall and clear finish page- ${If} $ExecErrorCode = "0"- WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRulePort" '$WinDelFwRulePort'- IntOp $FirewallServiceStart 0 + 0- ${Else}- IntOp $FirewallServiceStart 3 + 0- ${EndIf}+Function GetJavaMajor+ Exch $0+ Push $1+ Push $2+ Push $3+ Push $4++ StrCpy $1 $0 2+ ${If} $1 == "1."+ StrCpy $0 $0 "" 2+ ${EndIf}++ StrCpy $1 ""+ StrLen $2 $0+ StrCpy $3 0+ LoopDigits:+ IntCmp $3 $2 DoneDigits DoneDigits+ StrCpy $4 $0 1 $3+ ${If} $4 >= "0"+ ${AndIf} $4 <= "9"+ StrCpy $1 "$1$4"+ IntOp $3 $3 + 1+ Goto LoopDigits+ ${Else}+ Goto DoneDigits+ ${EndIf}+ DoneDigits:+ ${If} $1 == ""+ StrCpy $1 "0"+ ${EndIf}++ StrCpy $0 $1+ Pop $4+ Pop $3+ Pop $2+ Pop $1+ Exch $0FunctionEnd-Function SHOW_PageFinish_custom- ; hide and disable firewall info from wiki if firewall is open- ${If} $FirewallServiceStart = 0- SendMessage $mui.FinishPage.ShowReadme ${BM_SETCHECK} 0 0- ShowWindow $mui.FinishPage.ShowReadme ${SW_HIDE}- ${EndIf}+Function FindFirstInt+ Exch $0+ Push $1+ Push $2+ Push $3+ Push $4+ Push $5++ StrLen $1 $0+ StrCpy $2 0+ StrCpy $3 ""+ StrCpy $4 0+ FindLoop:+ IntCmp $2 $1 FindDone FindDone+ StrCpy $5 $0 1 $2+ ${If} $4 == 0+ ${If} $5 >= "0"+ ${AndIf} $5 <= "9"+ StrCpy $4 1+ StrCpy $3 "$3$5"+ ${EndIf}+ ${Else}+ ${If} $5 >= "0"+ ${AndIf} $5 <= "9"+ StrCpy $3 "$3$5"+ ${Else}+ Goto FindDone+ ${EndIf}+ ${EndIf}+ IntOp $2 $2 + 1+ Goto FindLoop+ FindDone:+ ${If} $3 == ""+ StrCpy $3 "0"+ ${EndIf}++ StrCpy $0 $3+ Pop $5+ Pop $4+ Pop $3+ Pop $2+ Pop $1+ Exch $0FunctionEnd-Function un.CloseFirewall- ; get string for closing port from registy- ReadRegStr '$WinDelFwRulePort' HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRulePort"- ; if found > run netsh to close port- ${IfNot} '$WinDelFwRulePort' == ''- nsExec::ExecToStack '$WinDelFwRulePort'- ${EndIf}+Function DownloadJava+ ${If} ${RunningX64}+ StrCpy $JavaInstallerUrl "https://github.com/adoptium/temurin25-binaries/releases/download/jdk-25%2B36/OpenJDK25U-jdk_x64_windows_hotspot_25_36.msi"+ StrCpy $JavaInstallerPath "$TEMP\\temurin-jdk-25-x64.msi"+ ${Else}+ MessageBox MB_ICONEXCLAMATION "This installer only supports 64-bit Windows."+ Abort+ ${EndIf}++ Push "Java install: download URL=$JavaInstallerUrl"+ Call LogLine+ Push "Java install: download path=$JavaInstallerPath"+ Call LogLine++ Push "Java install: using PowerShell downloader (HTTPS)"+ Call LogLine+ StrCpy $2 "$TEMP\\yacy-download.ps1"+ StrCpy $3 "$TEMP\\yacy-download.done"+ StrCpy $4 "$TEMP\\yacy-download.err"+ Delete $3+ Delete $4+ FileOpen $1 $2 w+ FileWrite $1 "try {$\r$\n"+ FileWrite $1 " [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12$\r$\n"+ FileWrite $1 " $$wc = New-Object System.Net.WebClient$\r$\n"+ FileWrite $1 " $$wc.DownloadFile('$JavaInstallerUrl', '$JavaInstallerPath')$\r$\n"+ FileWrite $1 " 'OK' | Out-File -FilePath '$3' -Encoding ASCII$\r$\n"+ FileWrite $1 "} catch { $\r$\n"+ FileWrite $1 " $$_.Exception.Message | Out-File -FilePath '$4' -Encoding ASCII$\r$\n"+ FileWrite $1 " exit 1$\r$\n"+ FileWrite $1 "}$\r$\n"+ FileClose $1+ Exec '"$SYSDIR\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File "$2"'++ StrCpy $5 0+ StrCpy $8 -1+ PowerLoop:+ IfFileExists "$3" PowerDone+ IfFileExists "$4" PowerError+ IfFileExists "$JavaInstallerPath" 0 PowerWait+ FileOpen $1 "$JavaInstallerPath" r+ FileSeek $1 0 END $6+ FileClose $1+ IntOp $7 $6 / 1048576+ IntCmp $7 $8 PowerWait PowerWait PowerPrint+ PowerPrint:+ StrCpy $8 $7+ Push "Java install: downloaded ~$7 MB..."+ Call LogLine+ PowerWait:+ Sleep 2000+ IntOp $5 $5 + 2+ IntCmp $5 1200 PowerTimeout PowerLoop PowerLoop+ PowerTimeout:+ Push "Java install: PowerShell download timeout"+ Call LogLine+ MessageBox MB_ICONEXCLAMATION "$(javaDownloadFail)$\r$\n$JavaInstallerUrl"+ Delete $2+ Delete $3+ Delete $4+ Return+ PowerError:+ Push "Java install: PowerShell download failed"+ Call LogLine+ MessageBox MB_ICONEXCLAMATION "$(javaDownloadFail)$\r$\n$JavaInstallerUrl"+ Delete $2+ Delete $3+ Delete $4+ Return+ PowerDone:+ Delete $2+ Delete $3+ Delete $4++ ExecWait '"msiexec" /i "$JavaInstallerPath" /passive /norestart'FunctionEnddiff --git a/build.xml b/build.xmlindex d99715406..466fe093e 100644--- a/build.xml+++ b/build.xml@@ -49,6 +49,10 @@<property name="release_main" location="${release}/MAIN"/><property name="release_windows" location="${release}/WINDOWS"/><property name="release_mac" location="${release}/MAC"/>+ <property name="root_abs" location="."/>+ <property name="release_abs" location="${release}"/>+ <property name="release_main_abs" location="${release_main}"/>+ <property name="release_windows_abs" location="${release_windows}"/><property name="defaults" location="defaults"/><property name="RDFaParser" location="RDFaParser"/>@@ -136,6 +140,10 @@<property name="stdReleaseStub" value="yacy_v${releaseVersion}_${repository.revision.date}${repository.revision.time}_${repository.revision.hash}"/><property name="stdReleaseFile" value="${stdReleaseStub}.tar.gz"/><filter token="REPL_RELEASESTUB" value="${stdReleaseStub}"/>+ <filter token="REPL_ROOT_ABS" value="${root_abs}"/>+ <filter token="REPL_RELEASE_ABS" value="${release_abs}"/>+ <filter token="REPL_RELEASE_MAIN_ABS" value="${release_main_abs}"/>+ <filter token="REPL_RELEASE_WINDOWS_ABS" value="${release_windows_abs}"/><!-- apply replacments --><copy file="${defaults}/yacyBuild.properties.template" tofile="${defaults}/yacyBuild.properties" overwrite="true" filtering="true" />@@ -375,7 +383,7 @@</tarfileset></tar>- <delete dir="${release_main}"/>+ <delete dir="${release_main}" failonerror="false"/><delete dir="${release_windows}" failonerror="false" /><delete dir="${release}/SPECS" failonerror="false" /></target>@@ -528,13 +536,12 @@<copy file="build.nsi" tofile="${release_windows}/build.nsi" overwrite="true" filtering="true" /><exec executable="makensis"><arg value="-V2" />- <arg value="-NOCD" /><arg value="${release_windows}/build.nsi" /></exec><move file="${release_windows}/${stdReleaseStub}.exe"tofile="${release}/${stdReleaseStub}.exe" />- <delete dir="${release_main}"/>+ <delete dir="${release_main}" failonerror="false"/><delete dir="${release_windows}" failonerror="false" /></target>diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.javaindex 48c94fe26..1425b7976 100644--- a/source/net/yacy/yacy.java+++ b/source/net/yacy/yacy.java@@ -718,9 +718,21 @@ public final class yacy {final StringBuilder s = new StringBuilder(); for (final String a: args) s.append(a).append(" ");yacyRelease.startParameter = s.toString().trim();- // case for the application path if started normally with a jre command- File applicationRoot = new File(System.getProperty("user.dir").replace('\\', '/'));- File dataRoot = applicationRoot;+ // case for the application path if started normally with a jre command+ File applicationRoot = new File(System.getProperty("user.dir").replace('\\', '/'));+ File dataRoot = applicationRoot;+ final String dataRootOverrideProp = System.getProperty("yacy.data");+ final String dataRootOverrideEnv = System.getenv("YACY_DATA");+ final String dataRootOverride = (dataRootOverrideProp != null && !dataRootOverrideProp.isEmpty())+ ? dataRootOverrideProp+ : dataRootOverrideEnv;+ if (dataRootOverride != null && !dataRootOverride.isEmpty()) {+ dataRoot = new File(dataRootOverride);+ if(!dataRoot.isAbsolute()) {+ /* data root folder provided as a path relative to the user home folder */+ dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), dataRootOverride);+ }+ }//System.out.println("args.length=" + args.length);//System.out.print("args=["); for (int i = 0; i < args.length; i++) System.out.print(args[i] + ", "); System.out.println("]");if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-startup") || args[0].equals("-start"))) {@@ -745,14 +757,24 @@ public final class yacy {}preReadSavedConfigandInit(dataRoot);startup(dataRoot, applicationRoot, startupMemFree, startupMemTotal, true);- } else if ((args.length >= 1) && ((args[0].toLowerCase(Locale.ROOT).equals("-shutdown")) || (args[0].equals("-stop")))) {- // normal shutdown of yacy- if (args.length == 2) applicationRoot= new File(args[1]);- shutdown(applicationRoot);- } else if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-update"))) {- // aut-update yacy- if (args.length == 2) applicationRoot= new File(args[1]);- update(applicationRoot);+ } else if ((args.length >= 1) && ((args[0].toLowerCase(Locale.ROOT).equals("-shutdown")) || (args[0].equals("-stop")))) {+ // normal shutdown of yacy+ if (args.length == 2) {+ dataRoot = new File(args[1]);+ if(!dataRoot.isAbsolute()) {+ dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), args[1]);+ }+ }+ shutdown(dataRoot);+ } else if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-update"))) {+ // aut-update yacy+ if (args.length == 2) {+ dataRoot = new File(args[1]);+ if(!dataRoot.isAbsolute()) {+ dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), args[1]);+ }+ }+ update(dataRoot);} else if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-version"))) {// show yacy versionSystem.out.println(copyright);diff --git a/startYACY.bat b/startYACY.batindex 5b4dce28c..93602ea7b 100644--- a/startYACY.bat+++ b/startYACY.bat@@ -2,8 +2,10 @@title YaCyREM setting startup type for proper restart-if not exist DATA md DATA-echo . >DATA\yacy.noconsole+if "%YACY_DATA%"=="" set "YACY_DATA=%LOCALAPPDATA%\YaCy"+set "YACY_DATA_DIR=%YACY_DATA%\DATA"+if not exist "%YACY_DATA_DIR%" md "%YACY_DATA_DIR%"+echo . >"%YACY_DATA_DIR%\yacy.noconsole"Rem Setting the classpathSet CLASSPATH=lib\yacycore.jar@@ -14,8 +16,8 @@ set jms=set javacmd=-Xmx600mset priolvl=10set priority=/BELOWNORMAL-if exist DATA\SETTINGS\httpProxy.conf GoTo :RENAMEINDEX-if exist DATA\SETTINGS\yacy.conf GoTo :GETSTARTOPTS+if exist "%YACY_DATA_DIR%\SETTINGS\httpProxy.conf" GoTo :RENAMEINDEX+if exist "%YACY_DATA_DIR%\SETTINGS\yacy.conf" GoTo :GETSTARTOPTS:STARTJAVAset javacmd=%javacmd% -Djava.awt.headless=true -Dsolr.directoryFactory=solr.MMapDirectoryFactory -Dfile.encoding=UTF-8@@ -35,7 +37,7 @@ Rem commandline parameter added for -config option, like -config "port=8090" "adRem special parameter "adminAccount=admin:password" calculates and sets new admin-pwdRem any parameter in yacy.conf can me modified this way (make sure to use correct upper/lower case)-start %priority% java %javacmd% -classpath %CLASSPATH% net.yacy.yacy %1 %2 %3 %4 %5 %6 %7 %8 %9+start %priority% java %javacmd% -Dyacy.data="%YACY_DATA%" -classpath %CLASSPATH% net.yacy.yacy %1 %2 %3 %4 %5 %6 %7 %8 %9Echo You can close the console safely now.@@ -43,18 +45,17 @@ GoTo :ENDRem PUBLIC is now freeworld (r4575):RENAMEINDEX-for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\httpProxy.conf) do (+for /F "usebackq tokens=1,2 delims==" %%i in ("%YACY_DATA_DIR%\SETTINGS\httpProxy.conf") do (if "%%i"=="network.unit.name" set networkname=%%j)if not defined networkname set networkname=PUBLIC-cd DATA\INDEX+pushd "%YACY_DATA_DIR%\INDEX"ren PUBLIC %networkname%-cd ..-cd ..+popdRem This target is used to read java runtime parameters out of the yacy config file:GETSTARTOPTS-for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (+for /F "usebackq tokens=1,2 delims==" %%i in ("%YACY_DATA_DIR%\SETTINGS\yacy.conf") do (if "%%i"=="javastart_Xmx" set jmx=%%jif "%%i"=="javastart_priority" set priolvl=%%j)diff --git a/startYACY_debug.bat b/startYACY_debug.batindex 1ff4ae817..d15fc415a 100644--- a/startYACY_debug.bat+++ b/startYACY_debug.bat@@ -1,7 +1,10 @@@Echo Offtitle YaCy-if exist DATA\yacy.noconsole del DATA\yacy.noconsole+if "%YACY_DATA%"=="" set "YACY_DATA=%LOCALAPPDATA%\YaCy"+set "YACY_DATA_DIR=%YACY_DATA%\DATA"+if not exist "%YACY_DATA_DIR%" md "%YACY_DATA_DIR%"+if exist "%YACY_DATA_DIR%\yacy.noconsole" del "%YACY_DATA_DIR%\yacy.noconsole"Rem Generating the proper classpath unsing loops and labelsSet CLASSPATH=lib/yacycore.jar@@ -13,11 +16,11 @@ set javacmd=-Xmx600mset priolvl=10set priority=/BELOWNORMALset port=8090-if exist DATA\SETTINGS\httpProxy.conf GoTo :RENAMEINDEX-if exist DATA\SETTINGS\yacy.conf GoTo :GETSTARTOPTS+if exist "%YACY_DATA_DIR%\SETTINGS\httpProxy.conf" GoTo :RENAMEINDEX+if exist "%YACY_DATA_DIR%\SETTINGS\yacy.conf" GoTo :GETSTARTOPTS:STARTJAVA-set javacmd=%javacmd% -XX:-UseGCOverheadLimit -Djava.awt.headless=true -Dfile.encoding=UTF-8+set javacmd=%javacmd% -XX:-UseGCOverheadLimit -Djava.awt.headless=true -Dfile.encoding=UTF-8Rem Starting YaCyEcho Generated classpath:%CLASSPATH%@@ -27,7 +30,7 @@ Echo Priority:%priority%Echo ****************** YaCy Web Crawler/Indexer ^& Search Engine ******************Echo **** (C) by Michael Peter Christen, usage granted under the GPL Version 2 ****Echo **** USE AT YOUR OWN RISK! Project home and releases: https://yacy.net/ ****-Echo ** LOG of YaCy: DATA/LOG/yacy00.log (and yacy^<xx^>.log) **+Echo ** LOG of YaCy: %YACY_DATA_DIR%/LOG/yacy00.log (and yacy^<xx^>.log) **Echo ** STOP YaCy: execute stopYACY.bat and wait some seconds **Echo ** GET HELP for YaCy: join our community at https://community.searchlab.eu **Echo *******************************************************************************@@ -39,30 +42,29 @@ Rem commandline parameter added for -config option, like -config "port=8090" "adRem special parameter "adminAccount=admin:password" calculates and sets new admin-pwdRem any parameter in yacy.conf can me modified this way (make sure to use correct upper/lower case)-start "YaCy" %priority% /B /WAIT java %javacmd% -classpath %CLASSPATH% net.yacy.yacy %1 %2 %3 %4 %5 %6 %7 %8 %9+start "YaCy" %priority% /B /WAIT java %javacmd% -Dyacy.data="%YACY_DATA%" -classpath %CLASSPATH% net.yacy.yacy %1 %2 %3 %4 %5 %6 %7 %8 %9-if not exist DATA\yacy.restart GoTo :END-del DATA\yacy.restart+if not exist "%YACY_DATA_DIR%\yacy.restart" GoTo :END+del "%YACY_DATA_DIR%\yacy.restart"GoTo :GETSTARTOPTSRem PUBLIC is now freeworld (r4575):RENAMEINDEX-for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\httpProxy.conf) do (- if "%%i"=="network.unit.name" set networkname=%%j-)-if not defined networkname set networkname=PUBLIC-cd DATA\INDEX-ren PUBLIC %networkname%-cd ..-cd ..+for /F "usebackq tokens=1,2 delims==" %%i in ("%YACY_DATA_DIR%\SETTINGS\httpProxy.conf") do (+ if "%%i"=="network.unit.name" set networkname=%%j+)+if not defined networkname set networkname=PUBLIC+pushd "%YACY_DATA_DIR%\INDEX"+ren PUBLIC %networkname%+popdRem This target is used to read java runtime parameters out of the yacy config file:GETSTARTOPTS-for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (- if "%%i"=="javastart_Xmx" set jmx=%%j- if "%%i"=="port" set port=%%j- if "%%i"=="javastart_priority" set priolvl=%%j-)+for /F "usebackq tokens=1,2 delims==" %%i in ("%YACY_DATA_DIR%\SETTINGS\yacy.conf") do (+ if "%%i"=="javastart_Xmx" set jmx=%%j+ if "%%i"=="port" set port=%%j+ if "%%i"=="javastart_priority" set priolvl=%%j+)if defined jmx set javacmd=-%jmx%if defined jms set javacmd=-%jms% %javacmd%if defined priolvl (diff --git a/stopYACY.bat b/stopYACY.batindex d1f7228e4..fca6c4253 100644--- a/stopYACY.bat+++ b/stopYACY.bat@@ -6,5 +6,5 @@ Set CLASSPATH=lib\yacycore.jarRem Stopping yacyEcho Generated Classpath:%CLASSPATH%-java -classpath %CLASSPATH% net.yacy.yacy -shutdown-+if "%YACY_DATA%"=="" set "YACY_DATA=%LOCALAPPDATA%\YaCy"+java -Dyacy.data="%YACY_DATA%" -classpath %CLASSPATH% net.yacy.yacy -shutdown "%YACY_DATA%"