eurysco

eurysco is a free and open source project based on PHP language, in order to enhance and simplify the remote administration of Microsoft operating systems with an intuitive, fast and responsive web interface

view my linkedin profileview my linkedin profile :)

Privacy Policy
     

Total sweet donations $23
Help me to support eurysco (^_^) !

Source euryscoExecutorInstaller

Source /




0001 setlocal enableextensions
0002 cd /d "%~dp0"
0003 
0004 wmic.exe os get osarchitecture | find "64"
0005 if %errorlevel% equ 0 set osarc=x64
0006 if %errorlevel% neq 0 set osarc=x86
0007 ver.exe | find " 5."
0008 if %errorlevel% equ 0 set osarc=x86&set osold="_xp2k3"
0009 if %errorlevel% neq 0 set osold=""
0010 
0011 if not exist "%cd%\ext\7zip.exe" copy "%cd%\installs\7z_%osarc%\7z.exe" "%cd%\ext\7zip.exe" /y
0012 if not exist "%cd%\ext\7z.dll" copy "%cd%\installs\7z_%osarc%\7z.dll" "%cd%\ext\7z.dll" /y
0013 
0014 set clr=0
0015 if exist "%cd%\apache_%osarc%" if not exist "%cd%\apache" ren "%cd%\apache_%osarc%" "apache" & set clr=1
0016 if exist "%cd%\apache_x64" rd "%cd%\apache_x64" /s /q
0017 if exist "%cd%\apache_x86" rd "%cd%\apache_x86" /s /q
0018 if exist "%cd%\php_%osarc%%osold:~1,-1%" if not exist "%cd%\php" ren "%cd%\php_%osarc%%osold:~1,-1%" "php" & set clr=1
0019 if exist "%cd%\php_x64" rd "%cd%\php_x64" /s /q
0020 if exist "%cd%\php_x86" rd "%cd%\php_x86" /s /q
0021 if exist "%cd%\php_x86_xp2k3" rd "%cd%\php_x86_xp2k3" /s /q
0022 if %clr% equ 1 cscript.exe "euryscoclr.vbs"
0023 
0024 set servicename_last="eurysco"
0025 set servicename="euryscoExecutor"
0026 set servicestart="auto"
0027 set serviceuser="LocalSystem"
0028 set servicedisplay="eurysco Executor"
0029 if [%1] equ [] set serviceport="59981"
0030 if [%1] neq [] set serviceport="%1"
0031 if [%2] equ [] set phpport="59971"
0032 if [%2] neq [] set phpport="%2"
0033 set phpexe="eurysco_executor"
0034 set relpath="core"
0035 set relname="executor"
0036 
0037 set sslprotocol=TLSv1.2
0038 if %osold% equ "_xp2k3" set sslprotocol=TLSv1
0039 
0040 echo ^<?xml version="1.0"?^>>.\conf\config_%relname:~1,-1%.xml
0041 echo ^<config^>>>.\conf\config_%relname:~1,-1%.xml
0042 echo 	^<settings^>>>.\conf\config_%relname:~1,-1%.xml
0043 echo 		^<%relname:~1,-1%servicedisplayname^>%servicedisplay:~1,-1%^</%relname:~1,-1%servicedisplayname^>>>.\conf\config_%relname:~1,-1%.xml
0044 echo 		^<%relname:~1,-1%servicename^>%servicename:~1,-1%^</%relname:~1,-1%servicename^>>>.\conf\config_%relname:~1,-1%.xml
0045 echo 		^<%relname:~1,-1%servicestartuptype^>%servicestart:~1,-1%^</%relname:~1,-1%servicestartuptype^>>>.\conf\config_%relname:~1,-1%.xml
0046 echo 		^<%relname:~1,-1%servicelogonas^>%serviceuser:~1,-1%^</%relname:~1,-1%servicelogonas^>>>.\conf\config_%relname:~1,-1%.xml
0047 echo 		^<%relname:~1,-1%listeningport^>%serviceport:~1,-1%^</%relname:~1,-1%listeningport^>>>.\conf\config_%relname:~1,-1%.xml
0048 echo 		^<%relname:~1,-1%phpport^>%phpport:~1,-1%^</%relname:~1,-1%phpport^>>>.\conf\config_%relname:~1,-1%.xml
0049 echo 	^</settings^>>>.\conf\config_%relname:~1,-1%.xml
0050 echo ^</config^>>>.\conf\config_%relname:~1,-1%.xml
0051 
0052 if not exist "%cd%\cert\%phpexe:~1,-1%.crt" cd "%cd%\apache\bin" & openssl.exe req -x509 -nodes -days 1825 -newkey rsa:2048 -sha512 -keyout "..\..\cert\%phpexe:~1,-1%.key" -out "..\..\cert\%phpexe:~1,-1%.crt" -config "..\conf\openssl.cnf" -subj "/C=EU/ST=eurysco Any State/L=eurysco Any Locality/O=eurysco Any Organization/OU=eurysco/CN=%computername%" & openssl.exe req -new -key "..\..\cert\%phpexe:~1,-1%.key" -out "..\..\cert\%phpexe:~1,-1%.csr" -config "..\conf\openssl.cnf" -subj "/C=EU/ST=eurysco Any State/L=eurysco Any Locality/O=eurysco Any Organization/OU=eurysco/CN=%computername%" & cd ..\..\
0053 rem certutil.exe -addstore "Root" "%cd%\cert\%phpexe:~1,-1%.crt"
0054 
0055 echo Define SRVROOT "%cd%\apache">"%cd%\apache\conf\httpd_srvroot.conf"
0056 echo Listen %serviceport:~1,-1%>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_port.conf"
0057 echo ^<VirtualHost *:%serviceport:~1,-1%^>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0058 echo 	SSLProxyEngine On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0059 echo 	SSLEngine On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0060 echo 	SSLProtocol %sslprotocol%>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0061 echo 	ProxyPreserveHost On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0062 echo 	ProxyRequests Off>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0063 echo 	SSLCertificateFile      ../cert/%phpexe:~1,-1%.crt>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0064 echo 	SSLCertificateKeyFile   ../cert/%phpexe:~1,-1%.key>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0065 echo 	^<Location /^>>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0066 echo 		ProxyPass http://127.0.0.1:%phpport:~1,-1%/ Timeout=2000 KeepAlive=On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0067 echo 		ProxyPassReverse http://127.0.0.1:%phpport:~1,-1%/>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0068 echo 		ProxyPreserveHost On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0069 echo 		SSLRequireSSL>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0070 echo 	^</Location^>>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0071 echo ^</VirtualHost^>>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0072 net.exe stop "%servicename_last:~1,-1%SSL"
0073 taskkill.exe /f /im "httpd_%phpexe:~1,-1%.exe" /t
0074 sc.exe delete "%servicename_last:~1,-1%SSL"
0075 reg.exe delete "HKLM\SYSTEM\CurrentControlSet\services\%servicename_last:~1,-1%SSL" /f
0076 netsh.exe firewall delete allowedprogram "%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe" all
0077 netsh.exe advfirewall firewall delete rule name=httpd_%phpexe:~1,-1% dir=in
0078 sc.exe create "%servicename:~1,-1%SSL" start= "%servicestart:~1,-1%" binPath= "%cd%\euryscosrv.exe" obj= "%serviceuser:~1,-1%" DisplayName= "%servicedisplay:~1,-1% SSL"
0079 reg.exe add "HKLM\SYSTEM\CurrentControlSet\services\%servicename:~1,-1%SSL\Parameters" /v "Application" /t REG_SZ /d "\"%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe\" -f \"%cd%\apache\conf\httpd_%phpexe:~1,-1%.conf\"" /f
0080 if %errorlevel% neq 0 cscript.exe "%cd%\euryscosrv.vbs" %servicename:~1,-1%SSL "@%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe@ -f @%cd%\apache\conf\httpd_%phpexe:~1,-1%.conf@"
0081 if not exist "%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe" if exist "%cd%\apache\bin\httpd.exe" copy "%cd%\apache\bin\httpd.exe" "%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe" /y
0082 netsh.exe advfirewall firewall add rule name="httpd_%phpexe:~1,-1%" dir=in action=allow protocol=6 localport=%serviceport:~1,-1% program="%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe" enable=yes
0083 if %errorlevel% neq 0 netsh.exe firewall add allowedprogram "%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe" "httpd_%phpexe:~1,-1%" enable
0084 
0085 net.exe stop "%servicename_last:~1,-1%"
0086 taskkill.exe /f /im "%phpexe:~1,-1%.exe" /t
0087 sc.exe delete "%servicename_last:~1,-1%"
0088 reg.exe delete "HKLM\SYSTEM\CurrentControlSet\services\%servicename_last:~1,-1%" /f
0089 
0090 sc.exe create "%servicename:~1,-1%" start= "%servicestart:~1,-1%" binPath= "%cd%\euryscosrv.exe" obj= "%serviceuser:~1,-1%" DisplayName= "%servicedisplay:~1,-1%"
0091 reg.exe add "HKLM\SYSTEM\CurrentControlSet\services\%servicename:~1,-1%\Parameters" /v "Application" /t REG_SZ /d "\"%cd%\php\php_%phpexe:~1,-1%.exe\" -c \"%cd%\php\php.ini\" -t \"%cd%\%relpath:~1,-1%\" -S 127.0.0.1:%phpport:~1,-1%" /f
0092 if %errorlevel% neq 0 cscript.exe "%cd%\euryscosrv.vbs" %servicename:~1,-1% "@%cd%\php\php_%phpexe:~1,-1%.exe@ -c @%cd%\php\php.ini@ -t @%cd%\%relpath:~1,-1%@ -S 127.0.0.1:%phpport:~1,-1%"
0093 
0094 if not exist "%cd%\php\php.ini" if exist "%cd%\php.default_%osarc%%osold:~1,-1%" copy "%cd%\php.default_%osarc%%osold:~1,-1%" "%cd%\php\php.ini" /y
0095 type "%cd%\php\php.ini" | find /i "error_log = " | find /i "logs\php_errors.log"
0096 if %errorlevel% neq 0 echo error_log = "%cd%\php\logs\php_errors.log">>"%cd%\php\php.ini"
0097 type "%cd%\php\php.ini" | find /i "upload_tmp_dir = " | find /i "temp"
0098 if %errorlevel% neq 0 echo upload_tmp_dir = "%cd%\php\temp">>"%cd%\php\php.ini"
0099 if not exist "%cd%\php\php_%phpexe:~1,-1%.exe" if exist "%cd%\php\php.exe" copy "%cd%\php\php.exe" "%cd%\php\php_%phpexe:~1,-1%.exe" /y
0100 
0101 net.exe start "%servicename:~1,-1%"
0102 net.exe start "%servicename:~1,-1%SSL"
0103 
0104 exit 0