3 Commits
Author SHA1 Message Date
Joseph Mendoza bceedf2702 added windefend exclusions to sidequest version 2019-06-16 20:40:20 -07:00
Joseph Mendoza 1cffefcadf added sidequest version 2019-06-16 15:34:43 -07:00
Joseph mendozaandGitHub 82514fc7d2 Update README.md 2019-06-13 03:40:50 -07:00
2 changed files with 57 additions and 0 deletions
+2
View File
@@ -1,4 +1,6 @@
# ADB-Installer
Download from [Releases](https://github.com/josephsmendoza/ADB-Installer/releases)
This is a re-implementation of the [15 seconds ADB Installer](https://forum.xda-developers.com/showthread.php?t=2588979)
This installer requires an internet connection.
+55
View File
@@ -0,0 +1,55 @@
Param( [Parameter()] [String[]] $installPath )
$adb=$false
$fastboot=$false
if (Get-Command "adb" -ErrorAction SilentlyContinue){
$adb=$true
}
if (Get-Command "fastboot" -ErrorAction SilentlyContinue){
$fastboot=$true
}
if($installPath.Length.Equals(0)){
if(!$adb -and $fastboot){
Write-Output "fastboot installed without adb"
Write-Output "Checking fastboot location via --version ..."
$installPath=fastboot --version | Select-String -Pattern "(?<=installed as )(.+)(?=\\.*\.exe)" | % { $_.Matches } | % { $_.Value }
}
if($adb){
Write-Output "adb installed, checking location via --version ..."
$installPath=adb --version | Select-String -Pattern "(?<=installed as )(.+)(?=\\.*\.exe)" | % { $_.Matches } | % { $_.Value }
}
if($installPath.Length.Equals(0)){
Write-Output "platform-tools location not found"
$installPath="$HOME\AppData\Roaming\SideQuest\platform-tools\"
}
}
Write-Output "installPath=$installPath"
if(!$adb -and !$fastboot){
Write-Output "Adding $installPath to `$PATH ..."
$oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
$newpath = "$oldpath;$installPath"
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath
}
Write-Output "Checking Windows Defender Status..."
$defender=cmd /c sc query Windefend
if ( "$defender" -like "*RUNNING*" ){
Write-Output "Defender is running, adding exclusions for adb..."
Add-MpPreference -ExclusionPath $installPath
Add-MpPreference -ExclusionProcess "adb.exe"
} else {
Write-Output "Defender is not running, skipping exclusions"
}
Write-Output "Downloading platform-tools-latest-windows.zip to $env:temp ..."
Import-Module BitsTransfer
Start-BitsTransfer -Source "https://dl.google.com/android/repository/platform-tools-latest-windows.zip" -Destination "$env:temp\platform-tools-latest-windows.zip"
Write-Output "Extracting $env:temp\platform-tools-latest-windows.zip to $installPath ..."
Expand-Archive -Path "$env:temp\platform-tools-latest-windows.zip" -DestinationPath "$installPath" -Force
Write-Output "Installing Quest ADB Driver"
$PSScriptRootLegacy=split-path -parent $MyInvocation.MyCommand.Definition
Start-Process $PSScriptRootLegacy/android_winusb.inf -Verb Install
Write-Output "Done!"
Read-Host -Prompt "Press Enter to continue"