Cant get working /qn /norestart with delay so its a manual install of java renamed startYACY.bat to startYACYWin.cmd tested on Win 7pull/678/head
parent
45f3ae166f
commit
89b3c7e8b2
@ -0,0 +1,21 @@
|
||||
Rem
|
||||
Rem 2-1-2025
|
||||
Rem installer for yacy windows
|
||||
|
||||
Shell "copy /b java17_0 + java17_1 + java17_2 java17.msi"
|
||||
Print "Joining files"
|
||||
_Delay 5
|
||||
|
||||
Shell "start /w java17.msi /norestart"
|
||||
Print "Installing java 17"
|
||||
Rem _delay 140
|
||||
_Delay 10
|
||||
Shell "refresh.cmd"
|
||||
Print "refreshing path"
|
||||
_Delay 10
|
||||
Shell "startYACYWin.cmd"
|
||||
Print "starting yacy 1.940"
|
||||
_Delay 20
|
||||
Stop
|
||||
|
||||
|
Binary file not shown.
@ -0,0 +1 @@
|
||||
copy /b java17_0 + java17_1 + java17_2 java17.msi
|
@ -0,0 +1,68 @@
|
||||
@echo off
|
||||
::
|
||||
:: RefreshEnv.cmd
|
||||
::
|
||||
:: Batch file to read environment variables from registry and
|
||||
:: set session variables to these values.
|
||||
::
|
||||
:: With this batch file, there should be no need to reload command
|
||||
:: environment every time you want environment changes to propagate
|
||||
|
||||
::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell"
|
||||
echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait..."
|
||||
|
||||
goto main
|
||||
|
||||
:: Set one environment variable from registry key
|
||||
:SetFromReg
|
||||
"%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL
|
||||
for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do (
|
||||
echo/set "%~3=%%B"
|
||||
)
|
||||
goto :EOF
|
||||
|
||||
:: Get a list of environment variables from registry
|
||||
:GetRegEnv
|
||||
"%WinDir%\System32\Reg" QUERY "%~1" > "%TEMP%\_envget.tmp"
|
||||
for /f "usebackq skip=2" %%A IN ("%TEMP%\_envget.tmp") do (
|
||||
if /I not "%%~A"=="Path" (
|
||||
call :SetFromReg "%~1" "%%~A" "%%~A"
|
||||
)
|
||||
)
|
||||
goto :EOF
|
||||
|
||||
:main
|
||||
echo/@echo off >"%TEMP%\_env.cmd"
|
||||
|
||||
:: Slowly generating final file
|
||||
call :GetRegEnv "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd"
|
||||
call :GetRegEnv "HKCU\Environment">>"%TEMP%\_env.cmd" >> "%TEMP%\_env.cmd"
|
||||
|
||||
:: Special handling for PATH - mix both User and System
|
||||
call :SetFromReg "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd"
|
||||
call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd"
|
||||
|
||||
:: Caution: do not insert space-chars before >> redirection sign
|
||||
echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd"
|
||||
|
||||
:: Cleanup
|
||||
del /f /q "%TEMP%\_envset.tmp" 2>nul
|
||||
del /f /q "%TEMP%\_envget.tmp" 2>nul
|
||||
|
||||
:: capture user / architecture
|
||||
SET "OriginalUserName=%USERNAME%"
|
||||
SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%"
|
||||
|
||||
:: Set these variables
|
||||
call "%TEMP%\_env.cmd"
|
||||
|
||||
:: Cleanup
|
||||
del /f /q "%TEMP%\_env.cmd" 2>nul
|
||||
|
||||
:: reset user / architecture
|
||||
SET "USERNAME=%OriginalUserName%"
|
||||
SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%"
|
||||
|
||||
echo | set /p dummy="Finished."
|
||||
echo .
|
||||
timeout 5
|
@ -1,71 +0,0 @@
|
||||
@Echo Off
|
||||
title YaCy
|
||||
|
||||
REM setting startup type for proper restart
|
||||
if not exist DATA md DATA
|
||||
echo . >DATA\yacy.noconsole
|
||||
|
||||
Rem Setting the classpath
|
||||
Set CLASSPATH=lib\yacycore.jar
|
||||
|
||||
REM Please change the "javastart" settings in the web-interface "Basic Configuration" -> "Advanced"
|
||||
set jmx=
|
||||
set jms=
|
||||
set javacmd=-Xmx600m
|
||||
set priolvl=10
|
||||
set priority=/BELOWNORMAL
|
||||
if exist DATA\SETTINGS\httpProxy.conf GoTo :RENAMEINDEX
|
||||
if exist DATA\SETTINGS\yacy.conf GoTo :GETSTARTOPTS
|
||||
|
||||
:STARTJAVA
|
||||
set javacmd=%javacmd% -Djava.awt.headless=true -Dsolr.directoryFactory=solr.MMapDirectoryFactory -Dfile.encoding=UTF-8
|
||||
|
||||
Rem Starting YaCy
|
||||
Echo Generated classpath:%CLASSPATH%
|
||||
Echo JRE Parameters:%javacmd%
|
||||
Echo Priority:%priority%
|
||||
Echo ***************************************************************************
|
||||
Echo.
|
||||
Echo If you see a message like "java" not found, you probably have to install Java.
|
||||
Echo.
|
||||
Echo You can download Java at http://java.com/
|
||||
Echo.
|
||||
Echo ***************************************************************************
|
||||
Rem commandline parameter added for -config option, like -config "port=8090" "adminAccount=admin:password"
|
||||
Rem special parameter "adminAccount=admin:password" calculates and sets new admin-pwd
|
||||
Rem 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
|
||||
|
||||
Echo You can close the console safely now.
|
||||
|
||||
GoTo :END
|
||||
|
||||
Rem 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 ..
|
||||
|
||||
Rem 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"=="javastart_priority" set priolvl=%%j
|
||||
)
|
||||
if defined jmx set javacmd=-%jmx%
|
||||
if defined jms set javacmd=-%jms% %javacmd%
|
||||
if defined priolvl (
|
||||
if %priolvl% == 20 set priority=/LOW
|
||||
if %priolvl% == 10 set priority=/BELOWNORMAL
|
||||
)
|
||||
|
||||
GoTo :STARTJAVA
|
||||
|
||||
Rem Target needed to jump to the end of the file
|
||||
:END
|
Loading…
Reference in new issue