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 euryscoCoreInstaller

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 if %osarc% equ x86 if %osold% equ "_xp2k3" "%cd%\installs\vcredist_%osarc%%osold:~1,-1%.exe" /qb
0025 if %osarc% equ x86 if %osold% equ "" "%cd%\installs\vcredist_%osarc%%osold:~1,-1%.exe" /passive /norestart
0026 if %osarc% equ x64 "%cd%\installs\vcredist_%osarc%.exe" /passive /norestart
0027 
0028 reg.exe delete "HKLM\SOFTWARE\eurysco" /f
0029 type "%cd%\core\version.phtml" | find /i "return">"%cd%\version"
0030 set /p version=<"%cd%\version"
0031 del "%cd%\version" /f /q
0032 reg.exe add "HKLM\SOFTWARE\eurysco" /v "DisplayName" /t REG_SZ /d "eurysco %version:~8,-2%" /f
0033 reg.exe add "HKLM\SOFTWARE\eurysco" /v "DisplayVersion" /t REG_SZ /d "%version:~8,-2%" /f
0034 reg.exe add "HKLM\SOFTWARE\eurysco" /v "HelpLink" /t REG_SZ /d "http://www.eurysco.com" /f
0035 reg.exe add "HKLM\SOFTWARE\eurysco" /v "InstallLocation" /t REG_SZ /d "%cd%\\" /f
0036 reg.exe add "HKLM\SOFTWARE\eurysco" /v "Publisher" /t REG_SZ /d "eurysco" /f
0037 reg.exe add "HKLM\SOFTWARE\eurysco" /v "MajorVersion" /t REG_DWORD /d %version:~8,-5% /f
0038 reg.exe add "HKLM\SOFTWARE\eurysco" /v "MinorVersion" /t REG_DWORD /d %version:~10,-2% /f
0039 echo eurysco %version:~8,-2%>"%cd%\version.%version:~8,-2%"
0040 
0041 cacls.exe "%cd%\chromium\data" /g "BUILTIN\Users":C /c /e
0042 
0043 set servicename_last="eurysco"
0044 set servicename="euryscoCore"
0045 set servicestart="auto"
0046 set serviceuser="LocalSystem"
0047 set servicedisplay="eurysco Core"
0048 if [%1] equ [] set serviceport="59980"
0049 if [%1] neq [] set serviceport="%1"
0050 if [%2] equ [] set phpport="59970"
0051 if [%2] neq [] set phpport="%2"
0052 set phpexe="eurysco_core"
0053 set relpath="core"
0054 set relname="core"
0055 
0056 set sslprotocol=TLSv1.2
0057 if %osold% equ "_xp2k3" set sslprotocol=TLSv1
0058 
0059 echo ^<?xml version="1.0"?^>>.\conf\config_%relname:~1,-1%.xml
0060 echo ^<config^>>>.\conf\config_%relname:~1,-1%.xml
0061 echo 	^<settings^>>>.\conf\config_%relname:~1,-1%.xml
0062 echo 		^<%relname:~1,-1%servicedisplayname^>%servicedisplay:~1,-1%^</%relname:~1,-1%servicedisplayname^>>>.\conf\config_%relname:~1,-1%.xml
0063 echo 		^<%relname:~1,-1%servicename^>%servicename:~1,-1%^</%relname:~1,-1%servicename^>>>.\conf\config_%relname:~1,-1%.xml
0064 echo 		^<%relname:~1,-1%servicestartuptype^>%servicestart:~1,-1%^</%relname:~1,-1%servicestartuptype^>>>.\conf\config_%relname:~1,-1%.xml
0065 echo 		^<%relname:~1,-1%servicelogonas^>%serviceuser:~1,-1%^</%relname:~1,-1%servicelogonas^>>>.\conf\config_%relname:~1,-1%.xml
0066 echo 		^<%relname:~1,-1%listeningport^>%serviceport:~1,-1%^</%relname:~1,-1%listeningport^>>>.\conf\config_%relname:~1,-1%.xml
0067 echo 		^<%relname:~1,-1%phpport^>%phpport:~1,-1%^</%relname:~1,-1%phpport^>>>.\conf\config_%relname:~1,-1%.xml
0068 echo 	^</settings^>>>.\conf\config_%relname:~1,-1%.xml
0069 echo ^</config^>>>.\conf\config_%relname:~1,-1%.xml
0070 
0071 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 ..\..\
0072 
0073 echo Define SRVROOT "%cd%\apache">"%cd%\apache\conf\httpd_srvroot.conf"
0074 echo Listen %serviceport:~1,-1%>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_port.conf"
0075 echo ^<VirtualHost *:%serviceport:~1,-1%^>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0076 echo 	SSLProxyEngine On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0077 echo 	SSLEngine On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0078 echo 	SSLProtocol %sslprotocol%>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0079 echo 	ProxyPreserveHost On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0080 echo 	ProxyRequests Off>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0081 echo 	SSLCertificateFile      ../cert/%phpexe:~1,-1%.crt>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0082 echo 	SSLCertificateKeyFile   ../cert/%phpexe:~1,-1%.key>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0083 echo 	^<Location /^>>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0084 echo 		ProxyPass http://127.0.0.1:%phpport:~1,-1%/ Timeout=180 KeepAlive=On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0085 echo 		ProxyPassReverse http://127.0.0.1:%phpport:~1,-1%/>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0086 echo 		ProxyPreserveHost On>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0087 echo 		SSLRequireSSL>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0088 echo 	^</Location^>>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0089 echo ^</VirtualHost^>>>"%cd%\apache\conf\httpd_%phpexe:~1,-1%_virtual.conf"
0090 net.exe stop "%servicename_last:~1,-1%SSL"
0091 taskkill.exe /f /im "httpd_%phpexe:~1,-1%.exe" /t
0092 sc.exe delete "%servicename_last:~1,-1%SSL"
0093 reg.exe delete "HKLM\SYSTEM\CurrentControlSet\services\%servicename_last:~1,-1%SSL" /f
0094 netsh.exe firewall delete allowedprogram "%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe" all
0095 netsh.exe advfirewall firewall delete rule name=httpd_%phpexe:~1,-1% dir=in
0096 sc.exe create "%servicename:~1,-1%SSL" start= "%servicestart:~1,-1%" binPath= "%cd%\euryscosrv.exe" obj= "%serviceuser:~1,-1%" DisplayName= "%servicedisplay:~1,-1% SSL"
0097 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
0098 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@"
0099 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
0100 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
0101 if %errorlevel% neq 0 netsh.exe firewall add allowedprogram "%cd%\apache\bin\httpd_%phpexe:~1,-1%.exe" "httpd_%phpexe:~1,-1%" enable
0102 
0103 net.exe stop "%servicename_last:~1,-1%"
0104 taskkill.exe /f /im "%phpexe:~1,-1%.exe" /t
0105 sc.exe delete "%servicename_last:~1,-1%"
0106 reg.exe delete "HKLM\SYSTEM\CurrentControlSet\services\%servicename_last:~1,-1%" /f
0107 
0108 sc.exe create "%servicename:~1,-1%" start= "%servicestart:~1,-1%" binPath= "%cd%\euryscosrv.exe" obj= "%serviceuser:~1,-1%" DisplayName= "%servicedisplay:~1,-1%"
0109 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
0110 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%"
0111 
0112 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
0113 type "%cd%\php\php.ini" | find /i "error_log = " | find /i "logs\php_errors.log"
0114 if %errorlevel% neq 0 echo error_log = "%cd%\php\logs\php_errors.log">>"%cd%\php\php.ini"
0115 type "%cd%\php\php.ini" | find /i "upload_tmp_dir = " | find /i "temp"
0116 if %errorlevel% neq 0 echo upload_tmp_dir = "%cd%\php\temp">>"%cd%\php\php.ini"
0117 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
0118 
0119 echo %serviceport:~1,-1%>"%cd%\chromium\euryscoLogin.prt
0120 
0121 echo. |cacls.exe "%cd%" /s:D:PAI(D;OICI;DCLCRPDTCRSDWDWO;;;SY)(A;OICI;0x1200a9;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)>"%cd%\cacls"
0122 set /p cacls=<"%cd%\cacls"
0123 del "%cd%\cacls" /f /q
0124 echo %cacls:~-5,-4%|cacls.exe "%cd%" /s:D:PAI(D;OICI;DCLCRPDTCRSDWDWO;;;SY)(A;OICI;0x1200a9;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0125 echo %cacls:~-5,-4%|cacls.exe "%cd%\agent\conf" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0126 echo %cacls:~-5,-4%|cacls.exe "%cd%\agent\groups" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0127 echo %cacls:~-5,-4%|cacls.exe "%cd%\agent\temp" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0128 echo %cacls:~-5,-4%|cacls.exe "%cd%\agent\users" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0129 echo %cacls:~-5,-4%|cacls.exe "%cd%\apache\conf" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0130 echo %cacls:~-5,-4%|cacls.exe "%cd%\apache\logs" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0131 echo %cacls:~-5,-4%|cacls.exe "%cd%\apache\tmp" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0132 echo %cacls:~-5,-4%|cacls.exe "%cd%\audit" /s:D:PAI(D;OICI;DTSDWDWO;;;SY)(A;OICI;0x1201bf;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0133 echo %cacls:~-5,-4%|cacls.exe "%cd%\badaut\core" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0134 echo %cacls:~-5,-4%|cacls.exe "%cd%\badaut\server" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0135 echo %cacls:~-5,-4%|cacls.exe "%cd%\cert" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0136 echo %cacls:~-5,-4%|cacls.exe "%cd%\chromium" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0137 echo %cacls:~-5,-4%|cacls.exe "%cd%\conf" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0138 echo %cacls:~-5,-4%|cacls.exe "%cd%\core\php-firewall\logs.txt" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0139 echo %cacls:~-5,-4%|cacls.exe "%cd%\groups" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0140 echo %cacls:~-5,-4%|cacls.exe "%cd%\nodes" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0141 echo %cacls:~-5,-4%|cacls.exe "%cd%\php\logs" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0142 echo %cacls:~-5,-4%|cacls.exe "%cd%\php\temp" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0143 echo %cacls:~-5,-4%|cacls.exe "%cd%\metering" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0144 echo %cacls:~-5,-4%|cacls.exe "%cd%\server\php-firewall\logs.txt" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0145 echo %cacls:~-5,-4%|cacls.exe "%cd%\server\settings" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0146 echo %cacls:~-5,-4%|cacls.exe "%cd%\sqlite" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0147 echo %cacls:~-5,-4%|cacls.exe "%cd%\temp" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0148 echo %cacls:~-5,-4%|cacls.exe "%cd%\users" /s:D:PAI(A;OICI;0x1301ff;;;SY)(A;OICI;FA;;;BA)(A;OICI;0x1200a9;;;BU)
0149 
0150 net.exe start "%servicename:~1,-1%"
0151 net.exe start "%servicename:~1,-1%SSL"
0152 
0153 exit 0