@echo off
set _WIN7_PATH="%~dp0%win7"
set _WIN8_PATH="%~dp0%win8"
set _CUR_PATH="%~dp0%"
set _AP_WIN8_NAME=Win8_AP
set _AP_WIN7_NAME=AsTPCenter
set _DM_WIN8_NAME=DesktopManager_win8
set _DM_WIN7_NAME=DesktopManager

set _HOTFIX_PATH_="HKLM\SOFTWARE\ASUS\Hotfix\ASUS Smart Gesture"

reg ADD %_HOTFIX_PATH_% /v DisplayName /t REG_SZ /d "ASUS Smart Gesture" /f
reg ADD %_HOTFIX_PATH_% /v DisplayVersion /t REG_SZ /d "1.1.3" /f



pushd %_CUR_PATH%
check_os.exe > nul
popd
if %ERRORLEVEL% == 4 goto ver_7
if %ERRORLEVEL% == 5 goto ver_8

goto warnthenexit

:ver_7
echo "Windows 7 Install Procedure"
pushd %_WIN7_PATH%
call install_all.bat > nul
popd

pushd %_CUR_PATH%
rmdir /Q /S %_AP_WIN8_NAME%
rmdir /Q /S %_DM_WIN8_NAME%
popd

goto exit

:ver_8
echo "Windows 8 Install Procedure"
pushd %_WIN8_PATH%
call install_all.bat > nul
popd

pushd %_CUR_PATH%
echo "copy AsusTPCenter Win8 to the other folder"
xcopy /E /Y %_AP_WIN8_NAME% %_AP_WIN7_NAME%
rmdir /Q /S %_AP_WIN8_NAME%

echo "copy Desktop Manager Win8 to the other folder"
xcopy /E /Y %_DM_WIN8_NAME% %_DM_WIN7_NAME%
rmdir /Q /S %_DM_WIN8_NAME%
popd
goto exit


:warnthenexit
echo Machine undetermined.

:exit

