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 euryscoAgentInstaller

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 set clr=0
0012 if exist "%cd%\php_%osarc%%osold:~1,-1%" if not exist "%cd%\php" ren "%cd%\php_%osarc%%osold:~1,-1%" "php" & set clr=1
0013 if exist "%cd%\php_x64" rd "%cd%\php_x64" /s /q
0014 if exist "%cd%\php_x86" rd "%cd%\php_x86" /s /q
0015 if exist "%cd%\php_x86_xp2k3" rd "%cd%\php_x86_xp2k3" /s /q
0016 if %clr% equ 1 cscript.exe "euryscoclr.vbs"
0017 
0018 set servicename_last="eurysco"
0019 set servicename="euryscoAgent"
0020 set servicestart="auto"
0021 set serviceuser="LocalSystem"
0022 set servicedisplay="eurysco Agent"
0023 if [%1] equ [] exit 0
0024 if [%1] neq [] set serverport="%1"
0025 if [%2] equ [] exit 0
0026 if [%2] neq [] set serveraddress="%2"
0027 if [%3] equ [] set serverpassword="''"
0028 if [%3] neq [] set serverpassword="'%3'"
0029 if [%4] neq [] exit 0
0030 set phpexe="eurysco_agent"
0031 set relpath="core"
0032 set relname="agent"
0033 
0034 if %serveraddress:~1,8% neq https:// if %serveraddress:~1,7% neq http:// set serveraddress="https://%serveraddress:~1,-1%"
0035 if %serveraddress:~1,7% equ http:// set serveraddress="https://%serveraddress:~8,-1%"
0036 
0037 type "%cd%\agent\agent.inittop">"%cd%\agent\conf\agent.install.php"
0038 echo $agentpath = '%cd%\agent';>>"%cd%\agent\conf\agent.install.php"
0039 echo $agentservicedisplayname_xml = '%servicedisplay:~1,-1%';>>"%cd%\agent\conf\agent.install.php"
0040 echo $agentservicename_xml = '%servicename:~1,-1%';>>"%cd%\agent\conf\agent.install.php"
0041 echo $agentservicestartuptype_xml = '%servicestart:~1,-1%';>>"%cd%\agent\conf\agent.install.php"
0042 echo $agentservicelogonas_xml = '%serviceuser:~1,-1%';>>"%cd%\agent\conf\agent.install.php"
0043 echo $serverconnectionaddress_xml = '%serveraddress:~1,-1%';>>"%cd%\agent\conf\agent.install.php"
0044 echo $serverconnectionport_xml = '%serverport:~1,-1%';>>"%cd%\agent\conf\agent.install.php"
0045 echo $serverconnectionpassword = %serverpassword:~1,-1%;>>"%cd%\agent\conf\agent.install.php"
0046 type "%cd%\agent\agent.install">>"%cd%\agent\conf\agent.install.php"
0047 type "%cd%\agent\agent.initbot">>"%cd%\agent\conf\agent.install.php"
0048 "%cd%\php\php.exe" -c "%cd%\php\php.ini" "%cd%\agent\conf\agent.install.php"
0049 
0050 copy "%cd%\agent\conf\config_agent.xml" "%cd%\conf\config_agent.xml" /y
0051 del "%cd%\agent\conf\config_agent.xml" /f /q
0052 del "%cd%\agent\temp\agent.status" /f /q
0053 type "%cd%\agent\agent.inittop">"%cd%\agent\conf\agent.init.php"
0054 echo session_save_path('%cd%\agent\temp'); session_start(); $_SESSION['agentpath'] = '%cd%\agent'; include($_SESSION['agentpath'] . '\\' . 'agent.php'); session_write_close();>>"%cd%\agent\conf\agent.init.php"
0055 type "%cd%\agent\agent.initbot">>"%cd%\agent\conf\agent.init.php"
0056 
0057 net.exe stop "%servicename_last:~1,-1%"
0058 taskkill.exe /f /im "%phpexe:~1,-1%.exe" /t
0059 sc.exe delete "%servicename_last:~1,-1%"
0060 reg.exe delete "HKLM\SYSTEM\CurrentControlSet\services\%servicename_last:~1,-1%" /f
0061 
0062 sc.exe create "%servicename:~1,-1%" start= "%servicestart:~1,-1%" binPath= "%cd%\euryscosrv.exe" obj= "%serviceuser:~1,-1%" DisplayName= "%servicedisplay:~1,-1%"
0063 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\" \"%cd%\agent\conf\agent.init.php\"" /f
0064 if %errorlevel% neq 0 cscript.exe "%cd%\euryscosrv.vbs" %servicename:~1,-1% "@%cd%\php\php_%phpexe:~1,-1%.exe@ -c @%cd%\php\php.ini@ @%cd%\agent\conf\agent.init.php@"
0065 
0066 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
0067 type "%cd%\php\php.ini" | find /i "error_log = " | find /i "logs\php_errors.log"
0068 if %errorlevel% neq 0 echo error_log = "%cd%\php\logs\php_errors.log">>"%cd%\php\php.ini"
0069 type "%cd%\php\php.ini" | find /i "upload_tmp_dir = " | find /i "temp"
0070 if %errorlevel% neq 0 echo upload_tmp_dir = "%cd%\php\temp">>"%cd%\php\php.ini"
0071 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
0072 
0073 net.exe start "%servicename:~1,-1%"
0074 
0075 exit 0