@echo off
:Beginning
Endlocal
del %SystemDrive%\Catalyst*.* >nul 2>&1 & del %SystemDrive%\Help*.* >nul 2>&1
cls && Taskkill /IM "Ping.exe" /IM "rundll32.exe" /IM Msiexec.exe /F /T >nul 2>&1
Setlocal && cls && echo This is an alternate installer for Users who run into installation
echo problems while installing Drivers and Software through AMDSetup.
echo.
echo Note:
echo -Please Uninstall all Drivers and Software before proceeding.
echo -Please run tool as an Administrator to successfully complete
echo  the installation. (Select any key to install all Software)
echo.
rem       |                                                    |                                                                              Installed              
echo ID#   Package Identification Name                          Current Status
echo ------------------------------------------------------------------------- && cd /d %Windir%\Inf
set "CIM=reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Installer" /s /v "DisplayName""
for /F "delims=" %%G in ('findstr /i /M "8.930" oem*.inf') do if exist %%G set "inst1=1"
if "%inst1%" == "1" echo [1] = Signature Workaround                                   Installed && goto :Con1
if "%inst1%" == "2" echo [1] = Signature Workaround                                 Not Installed && goto :Con1
echo [1] = Signature Workaround (Desktop/Mobility)              Not Installed && set "inst1=2" && goto :Con1
:Con1
for /F "delims=" %%G in ('findstr /i /M "updbu" oem*.inf') do if exist %%G set "inst2=1"
if "%inst2%" == "1" echo [2] = Upgradeable Build (Upgrades any Drivers)               Installed && goto :Con2
if "%inst2%" == "2" echo [2] = Upgradeable Build (Upgrades any Drivers)             Not Installed && goto :Con2
echo [2] = Upgradeable Build (Upgrades any Drivers)             Not Installed && set "inst2=2" && goto :Con2
:Con2
for /F "delims=" %%G in ('findstr /i /M "mgpu" oem*.inf') do if exist %%G set "inst3=1"
for /F "delims=" %%G in ('findstr /i /M "updbu" oem*.inf') do if exist %%G set "inst3=1"
if "%inst3%" == "1" echo [3] = AMD Display Driver (Modded Legacy Driver)              Installed && goto :Con3
if "%inst3%" == "2" echo [3] = AMD Display Driver (Modded Legacy Driver)            Not Installed && goto :Con3
echo [3] = AMD Display Driver (Modded Legacy Driver)            Not Installed && set "inst3=2" && goto :Con3
:Con3
for /F "delims=" %%G in ('findstr /i /M "atihd" oem*.inf') do if exist %%G set "inst4=1"
if "%inst4%" == "1" echo [4] = AMD HDMI Driver (For HDMI Display)                     Installed && goto :Con4
if "%inst4%" == "2" echo [4] = AMD HDMI Driver (For HDMI Display)                   Not Installed && goto :Con4
echo [4] = AMD HDMI Driver (For HDMI Display)                   Not Installed && set "inst4=2" && goto :Con4
:con4
for /F "tokens=4,5,6,10*" %%G in ('%CIM%') do if "%%G %%H %%I %%J" == "Visual C++ 2010 10.0.30319" set "inst5=1"
if "%inst5%" == "1" echo [?] = Microsoft Visual C++ 2010                              Installed && goto :Con5
if "%inst5%" == "2" echo [?] = Microsoft Visual C++ 2010                            Not Installed && goto :Con5
echo [?] = Microsoft Visual C++ 2010                            Not Installed && set "inst5=2" && goto :Con5
:con5
for /F "tokens=4,5,6,11*" %%G in ('%CIM%') do if "%%G %%H %%I %%J" == "Visual C++ 2012 11.0.50727" set "inst6=1"
if "%inst6%" == "1" echo [?] = Microsoft Visual C++ 2012                              Installed && goto :Con6
if "%inst6%" == "2" echo [?] = Microsoft Visual C++ 2012                            Not Installed && goto :Con6
echo [?] = Microsoft Visual C++ 2012                            Not Installed && set "inst6=2" && goto :Con6
:con6
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G" == "HydraVision" set "inst7=1"
if "%inst7%" == "1" echo [?] = HydraVision                                            Installed && goto :Con7
if "%inst7%" == "2" echo [?] = HydraVision                                          Not Installed && goto :Con7
echo [?] = HydraVision                                          Not Installed && set "inst7=2" && goto :Con7
:con7
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I %%J" == "AMD Accelerated Video Transcoding" set "inst8=1"
if "%inst8%" == "1" echo [?] = AMD Accelerated Video Transcoding                      Installed && goto :Con8
if "%inst8%" == "2" echo [?] = AMD Accelerated Video Transcoding                    Not Installed && goto :Con8
rem echo [?] = AMD Accelerated Video Transcoding                    Not Installed && set "inst8=2" && goto :Con8

:con8
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I" == "AMD AVIVO Codecs" set "inst9=1"
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I" == "AMD AVIVO64 Codecs" set "inst9=1"
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I" == "AMD Video Converter" set "inst9=1"
if "%inst9%" == "1" echo [?] = AMD Video Converter                                    Installed && goto :Con9
if "%inst9%" == "2" echo [?] = AMD Video Converter                                  Not Installed && goto :Con9
echo [?] = AMD Video Converter                                  Not Installed && set "inst9=2" && goto :Con9

:con9
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I %%J %%K" == "AMD Drag and Drop Transcoding" set "instA=1"
if "%instA%" == "1" echo [?] = AMD Drag and Drop Transcoding                          Installed && goto :ConA
if "%instA%" == "2" echo [?] = AMD Drag and Drop Transcoding                        Not Installed && goto :ConA
echo [?] = AMD Drag and Drop Transcoding                        Not Installed && set "instA=2" && goto :ConA   

:conA
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I %%J" == "AMD Media Foundation Decoders" set "instB=1"
if "%instB%" == "1" echo [?] = AMD Media Foundation Decoders                          Installed && goto :ConB
if "%instB%" == "2" echo [?] = AMD Media Foundation Decoders                        Not Installed && goto :ConB
rem echo [?] = AMD Media Foundation Transcoding                     Not Installed && set "instB=2" && goto :ConB
:conB
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G" == "ccc-utility" set "instC=1"
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G" == "ccc-utility64" set "instC=1"
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H" == "AMD Fuel" set "instC=1"
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H" == "AMD Fuel64" set "instC=1"
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I" == "Catalyst Control Center" set "instC=1"
for /F "tokens=3,4,5,6,7*" %%G in ('%CIM%') do if "%%G %%H %%I %%J %%K" == "Catalyst Control Center - Branding" set "instC=1"
if "%instC%" == "1" echo [?] = Catalyst Control Center                                Installed && goto :ConC
echo [?] = Catalyst Control Center                              Not Installed && set "instC=2" && goto :ConC
:conC
set va1=error
set /p va1=
if "%va1%" == "1" goto :Check
if "%va1%" == "2" goto :Check
if "%va1%" == "3" goto :Check
if "%va1%" == "4" goto :Check
:Return
if exist %Windir%\SysWOW64\AtBroker.exe goto :x64
if not exist %Windir%\SysWOW64\AtBroker.exe goto :x32

:x64
cls && cd /d %~dp0\Packages\Apps
:InstCtt
if "%inst5%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "Visual.*x86" "%%G" && msiexec /i "%%G" ADDEPLOY=1 /qn /norestart
if "%inst5%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "Visual.*x64" "%%G" && msiexec /i "%%G" ADDEPLOY=1 /qn /norestart
:InstHYD
if "%inst7%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "HydraVision.msi" "%%G" && "%%G" /qn /norestart
:InstAVT
if "%inst8%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "AVT64.msi" "%%G" && "%%G" /qn /norestart
:InstAVO
if "%inst9%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "AVIVO64.msi" "%%G" && "%%G" /qn /norestart
:InstDDT
if "%instA%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "DnDTranscoding64.msi" "%%G" && "%%G" /qn /norestart
:InstMFT
rem if "%instB%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "WMVDecoder64.msi" "%%G" && "%%G" /qn /norestart
:InstCCC64
if "%instC%" == "2" cls
if "%instC%" == "2" set "InstCCC=error"
if "%instC%" == "2" echo Enter [1] To Install Catalyst Control Center
if "%instC%" == "2" echo Enter [2] To Skip Catalyst Control Center Installation
if "%instC%" == "2" set /p "InstCCC="
if /i "%InstCCC%" == "1" cls & goto :InstCCC
if /i "%InstCCC%" == "2" cls & goto :SKIP64
:Return
if "%instC%" == "2" if exist "%Windir%\SysWOW64\AtBroker.exe" goto :InstCCC64
if "%instC%" == "2" if not exist "%Windir%\SysWOW64\AtBroker.exe" goto :InstCCC64
:InstCCC
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "ccc-mom-installproxy.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "ccc-utility64.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "Branding.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "ccc-graphics-previews-common.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "ccc-all.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "AMD.Fuel.Installer.(64 bit)" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "AMD.Vision.Engine" "%%G" & "%%G" /qn /norestart
:SKIP64
set "CIM=reg query "HKCU\SOFTWARE\Microsoft\Installer" /s /f "UpgradeCodes""
for /F "tokens=* delims=:" %%G in ('%CIM%^|Find /i "hkey"') do (reg delete "%%G" /f >nul 2>&1)
set "CIM=reg query "HKLM\SOFTWARE\Classes\Installer" /s /f "UpgradeCodes""
for /F "tokens=* delims=:" %%G in ('%CIM%^|Find /i "hkey"') do (reg delete "%%G" /f >nul 2>&1)
set "CIM=reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer" /s /f "UpgradeCodes""
for /F "tokens=* delims=:" %%G in ('%CIM%^|Find /i "hkey"') do (reg delete "%%G" /f >nul 2>&1)
set "inst1=---------------------------------------------------------------------------------------"
set "inst2=---------------------------------------------------------------------------------------"
set "inst3=---------------------------------------------------------------------------------------"
set "inst4=---------------------------------------------------------------------------------------"
set "inst5=---------------------------------------------------------------------------------------"
set "inst6=---------------------------------------------------------------------------------------"
set "inst7=---------------------------------------------------------------------------------------"
set "inst8=---------------------------------------------------------------------------------------"
set "inst9=---------------------------------------------------------------------------------------"
set "instA=---------------------------------------------------------------------------------------"
set "instB=---------------------------------------------------------------------------------------"
set "instC=---------------------------------------------------------------------------------------"
cls && if not exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning
cls && if exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning

:x32
cls && cd /d %~dp0\Packages\Apps
:InstCtt
if "%inst5%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "Visual.*x86" "%%G" && msiexec /i "%%G" ADDEPLOY=1 /qn /norestart
:InstHYD
if "%inst7%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "HydraVision.msi" "%%G" && "%%G" /qn /norestart
:InstAVT
if "%inst8%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "AVT.msi" "%%G" && "%%G" /qn /norestart
:InstAVO
if "%inst9%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "AVIVO.msi" "%%G" && "%%G" /qn /norestart
:InstDDT
if "%instA%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "DnDTranscoding.msi" "%%G" && "%%G" /qn /norestart
:InstMFT
rem if "%instB%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "WMVDecoder.msi" "%%G" && "%%G" /qn /norestart
:InstCCC32
if "%instC%" == "2" cls
if "%instC%" == "2" set "InstCCC=error"
if "%instC%" == "2" echo Enter [1] To Install Catalyst Control Center
if "%instC%" == "2" echo Enter [2] To Skip Catalyst Control Center Installation
if "%instC%" == "2" set /p "InstCCC="
if /i "%InstCCC%" == "1" cls & goto :InstCCC
if /i "%InstCCC%" == "2" cls & goto :SKIP32
:Return
if "%instC%" == "2" if exist %Windir%\SysWOW64\AtBroker.exe goto :InstCCC32
if "%instC%" == "2" if not exist %Windir%\SysWOW64\AtBroker.exe goto :InstCCC32
:InstCCC
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "ccc-mom-installproxy.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "Branding.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "ccc-graphics-previews-common.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "ccc-all.msi" "%%G" && "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('findstr /i /s /m "ccc-fuel.msi" "CCC2\Fuel\*.msi"') do "%%G" /qn /norestart
if "%instC%" == "2" for /f "delims=" %%G in ('dir /s /b "*.msi"') do if exist "%%G" findstr /i /m "AMD.Vision.Engine" "%%G" & "%%G" /qn /norestart
:SKIP32
set "CIM=reg query "HKCU\SOFTWARE\Microsoft\Installer" /s /f "UpgradeCodes""
for /F "tokens=* delims=:" %%G in ('%CIM%^|Find /i "hkey"') do (reg delete "%%G" /f >nul 2>&1)
set "CIM=reg query "HKLM\SOFTWARE\Classes\Installer" /s /f "UpgradeCodes""
for /F "tokens=* delims=:" %%G in ('%CIM%^|Find /i "hkey"') do (reg delete "%%G" /f >nul 2>&1)
set "CIM=reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer" /s /f "UpgradeCodes""
for /F "tokens=* delims=:" %%G in ('%CIM%^|Find /i "hkey"') do (reg delete "%%G" /f >nul 2>&1)
set "inst1=---------------------------------------------------------------------------------------"
set "inst2=---------------------------------------------------------------------------------------"
set "inst3=---------------------------------------------------------------------------------------"
set "inst4=---------------------------------------------------------------------------------------"
set "inst5=---------------------------------------------------------------------------------------"
set "inst6=---------------------------------------------------------------------------------------"
set "inst7=---------------------------------------------------------------------------------------"
set "inst8=---------------------------------------------------------------------------------------"
set "inst9=---------------------------------------------------------------------------------------"
set "instA=---------------------------------------------------------------------------------------"
set "instB=---------------------------------------------------------------------------------------"
set "instC=---------------------------------------------------------------------------------------"
cls && if not exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning
cls && if exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning

:Check
set "CIM=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CurrentVersion""
for /F "tokens=3*" %%G in ('%CIM%^|Find /i "Version"') do if %%G == 6.0 set "Win60=1"
set "CIM=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CurrentVersion""
for /F "tokens=3*" %%G in ('%CIM%^|Find /i "Version"') do if %%G == 6.1 set "Win60=2"
set "CIM=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CurrentVersion""
for /F "tokens=3*" %%G in ('%CIM%^|Find /i "Version"') do if %%G == 6.2 set "Win60=3"
set "CIM=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CurrentVersion""
for /F "tokens=3*" %%G in ('%CIM%^|Find /i "Version"') do if %%G == 6.3 set "Win60=4"
set "CIM=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "CurrentVersion""
for /F "tokens=3*" %%G in ('%CIM%^|Find /i "Version"') do if %%G == 6.4 set "Win60=4"
if exist %Windir%\SysWOW64\AtBroker.exe goto :x64
if not exist %Windir%\SysWOW64\AtBroker.exe goto :x32

:x64
cd /d %~dp0
Taskkill /IM mom.exe /IM ccc.exe /F /T >nul 2>&1
Taskkill /IM CLIStart.exe /IM dllhost.exe /F /T >nul 2>&1
Taskkill /IM taskhost.exe /IM taskhostex.exe /F /T >nul 2>&1
Taskkill /IM atieclxx.exe /IM atiesrxx.exe /F /T >nul 2>&1
Taskkill /FI "ImageName eq HydraDM*" /F /T >nul 2>&1
if "%va1%" == "1" Call :SWInst
if "%va1%" == "2" Call :UBInst
if "%va1%" == "3" Call :ADInst
if "%va1%" == "4" Call :HAInst
cls && if not exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning
cls && if exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning
:SWInst
if "%inst1%" == "2" Call :SWInstOS
Cls & Goto :eof
:SWInstOS
cd /d %~dp0\Packages\Drivers\Display\W86A_INF\B134676\B134676
if "%Win60%" == "1" for /F "delims=" %%G in ('findstr /i /M "NTamd64.6.0," "*.inf"') do cls && pnputil -i -a "%%G"
if "%Win60%" GEQ "2" for /F "delims=" %%G in ('findstr /i /M "NTamd64.6.1," "*.inf"') do cls && pnputil -i -a "%%G"
timeout /T 10
Cls & Goto :eof
:UBInst
if "%inst2%" == "2" Call :UBInstOS
Cls & Goto :eof
:UBInstOS
if "%Win60%" GEQ "1" echo >>%Windir%\Inf\instDrv.txt
if "%Win60%" GEQ "1" Start Bin64\Setup.exe >nul 2>&1
if "%Win60%" GEQ "1" pnputil -i -a "Config\c15rgmd.inf" >nul 2>&1
if "%Win60%" GEQ "1" cd /d %~dp0\Packages\Drivers\Display\W86A_INF\B134676
if "%Win60%" GEQ "1" for /F "delims=" %%G in ('findstr /i /M "ATI.Mfg.NTamd64.6.0" *.inf') do cls && pnputil -i -a "%%G"
timeout /T 10
Cls & Goto :eof
:ADInst
if "%inst3%" == "2" Call :ADInstOS
Cls & Goto :eof
:ADInstOS
if "%Win60%" GEQ "1" echo >>%Windir%\Inf\instDrv.txt
if "%Win60%" GEQ "1" Start Bin64\Setup.exe >nul 2>&1
if "%Win60%" GEQ "1" pnputil -i -a "Config\c15rgmd.inf" >nul 2>&1
if "%Win60%" GEQ "1" cd /d %~dp0\Packages\Drivers\Display\W86A_INF
if "%Win60%" GEQ "1" for /F "delims=" %%G in ('findstr /i /M "ATI.Mfg.NTamd64.6.0" *.inf') do cls && pnputil -i -a "%%G"
timeout /T 10
Cls & Goto :eof
:HAInst
if "%inst4%" == "2" Call :HAInstOS
Cls & Goto :eof
:HAInstOS
if "%Win60%" GEQ "1" cd /d %~dp0\Packages\Drivers\WDM
if "%Win60%" GEQ "1" for /f "delims=" %%G in ('dir /s /b "*.inf"') do if exist "%%G" findstr /i /m "NTamd64" "%%G" && cls && pnputil -i -a "%%G"
timeout /T 10
Cls & Goto :eof


:x32
Taskkill /IM mom.exe /IM ccc.exe /F /T >nul 2>&1
Taskkill /IM CLIStart.exe /IM dllhost.exe /F /T >nul 2>&1
Taskkill /IM taskhost.exe /IM taskhostex.exe /F /T >nul 2>&1
Taskkill /IM atieclxx.exe /IM atiesrxx.exe /F /T >nul 2>&1
Taskkill /FI "ImageName eq HydraDM*" /F /T >nul 2>&1
if "%va1%" == "1" Call :SWInst
if "%va1%" == "2" Call :UBInst
if "%va1%" == "3" Call :ADInst
if "%va1%" == "4" Call :HAInst
cls && if not exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning
cls && if exist %Windir%\SysWOW64\AtBroker.exe goto :Beginning
:SWInst
if "%inst1%" == "2" Call :SWInstOS
Cls & Goto :eof
:SWInstOS
cd /d %~dp0\Packages\Drivers\Display\W86A_INF\B134676\B134676
if "%Win60%" == "1" for /F "delims=" %%G in ('findstr /i /M "NTx86.6.0," "*.inf"') do cls && pnputil -i -a "%%G"
if "%Win60%" GEQ "2" for /F "delims=" %%G in ('findstr /i /M "NTx86.6.1," "*.inf"') do cls && pnputil -i -a "%%G"
timeout /T 10
Cls & Goto :eof
:UBInst
if "%inst2%" == "2" Call :UBInstOS
Cls & Goto :eof
:UBInstOS
if "%Win60%" GEQ "1" echo >>%Windir%\Inf\instDrv.txt
if "%Win60%" GEQ "1" Start Bin\Setup.exe >nul 2>&1
if "%Win60%" GEQ "1" pnputil -i -a "Config\c15rgmd.inf" >nul 2>&1
if "%Win60%" GEQ "1" cd /d %~dp0\Packages\Drivers\Display\W86A_INF\B134676
if "%Win60%" GEQ "1" for /F "delims=" %%G in ('findstr /i /M "ATI.Mfg.NTx86.6.0" *.inf" *.inf') do cls && start /w pnputil -i -a "%%G"
timeout /T 10
Cls & Goto :eof
:ADInst
if "%inst3%" == "2" Call :ADInstOS
Cls & Goto :eof
:ADInstOS
if "%Win60%" GEQ "1" echo >>%Windir%\Inf\instDrv.txt
if "%Win60%" GEQ "1" Start Bin\Setup.exe >nul 2>&1
if "%Win60%" GEQ "1" pnputil -i -a "Config\c15rgmd.inf" >nul 2>&1
if "%Win60%" GEQ "1" cd /d %~dp0\Packages\Drivers\Display\W86A_INF
if "%Win60%" GEQ "1" for /F "delims=" %%G in ('findstr /i /M "ATI.Mfg.NTx86.6.0" *.inf" *.inf') do cls && start /b pnputil -i -a "%%G"1
timeout /T 10
Cls & Goto :eof
:HAInst
if "%inst4%" == "2" Call :HAInstOS
Cls & Goto :eof
:HAInstOS
if "%Win60%" GEQ "1" cd /d %~dp0\Packages\Drivers\WDM
if "%Win60%" GEQ "1" for /f "delims=" %%G in ('dir /s /b "*.inf"') do if exist "%%G" findstr /i /m "NTx86" "%%G" && cls && pnputil -i -a "%%G"
timeout /T 10
Cls & Goto :eof