@ECHO OFF & PUSHD "%~DP0" && CD /D "%~DP0"
IF EXIST "%Public%" >NUL 2>&1 REG QUERY "HKU\S-1-5-19\Environment"
IF NOT %errorlevel% EQU 0 (
IF EXIST "%Public%"  powershell.exe -windowstyle hidden -noprofile "Start-Process '%~dpnx0' -Verb RunAs"
EXIT
)
loaddrv.exe -u
loaddrv.exe
ddm\loaddrv.exe -u
ddm\loaddrv.exe
if "%PROCESSOR_ARCHITECTURE%"=="x86" SetupGreen32.exe >NUL 2>NUL
if "%PROCESSOR_ARCHITECTURE%"=="x86" LoadDrv_Win32.exe >NUL 2>NUL
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" SetupGreen64.exe >NUL 2>NUL
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" LoadDrv_x64.exe >NUL 2>NUL
ver|findstr "5.0" >NUL&&GOTO goto :WinXP32 || goto :OTHER
:OTHER
ver|findstr "5.1" >NUL&&GOTO :WinXP || goto :OTHER2
:WinXP
if "%PROCESSOR_ARCHITECTURE%%PROCESSOR_ARCHITEW6432%" == "x86" goto :WinXP32 else goto :Win200364
:WinXP32
echo f|copy /y native\w2k\x86\fre\ampa.exe %SYSTEMROOT%
echo f|copy /y native\w2k\x86\fre\ampa.sys %SYSTEMROOT%\system32
PAUSE

:OTHER2
ver|findstr "5.2" >NUL&&GOTO :Win2003 || goto :OTHER3
:Win2003
if "%PROCESSOR_ARCHITECTURE%%PROCESSOR_ARCHITEW6432%" == "x86" goto :Win200332 else goto :Win200364
:Win200364
echo f|copy /y native\wnet\amd64\fre\ampa.exe %SYSTEMROOT%
echo f|copy /y native\wnet\amd64\fre\ampa.sys %SYSTEMROOT%\system32
echo f|copy /y native\wnet\amd64\fre\ampa.sys %SYSTEMROOT%\SysWOW64
PAUSE

:Win200332
echo f|copy /y native\w2k\x86\fre\ampa.exe %SYSTEMROOT%
echo f|copy /y native\w2k\x86\fre\ampa.sys %SYSTEMROOT%\system32
PAUSE

:OTHER3
ver|findstr "6.0" >NUL&&GOTO :Vista || goto :OTHER4
:Vista
if "%PROCESSOR_ARCHITECTURE%%PROCESSOR_ARCHITEW6432%" == "x86" goto :Vista32 else goto :Vista64
:Vista64
echo f|copy /y native\wlh\amd64\fre\ampa.exe %SYSTEMROOT%
echo f|copy /y native\wlh\amd64\fre\ampa.sys %SYSTEMROOT%\system32
echo f|copy /y native\wlh\amd64\fre\ampa.sys %SYSTEMROOT%\SysWOW64
PAUSE

:Vista32
echo f|copy /y native\wlh\x86\fre\ampa.exe %SYSTEMROOT%
echo f|copy /y native\wlh\x86\fre\ampa.sys %SYSTEMROOT%\system32
PAUSE

:OTHER4
ver|findstr "6.1" >NUL&&GOTO :Win7
:Win7
if "%PROCESSOR_ARCHITECTURE%%PROCESSOR_ARCHITEW6432%" == "x86" goto :Win732 else goto :Win764
:Win764
echo f|copy /y native\wlh\amd64\fre\ampa.exe %SYSTEMROOT%
echo f|copy /y native\wlh\amd64\fre\ampa.sys %SYSTEMROOT%\system32
echo f|copy /y native\wlh\amd64\fre\ampa.sys %SYSTEMROOT%\SysWOW64
PAUSE

:Win732
echo f|copy /y native\wlh\x86\fre\ampa.exe %SYSTEMROOT%
echo f|copy /y native\wlh\x86\fre\ampa.sys %SYSTEMROOT%\system32
PAUSE