Advertisement
Sombody101

Untitled

Jan 2nd, 2025 (edited)
713
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $rookiePath = "C:\RSL\Rookie"
  2. $platformTools = Join-Path $rookiePath "platform-tools"
  3. $apiUrl = "https://api.github.com/repos/VRPirates/rookie/releases/latest"
  4.  
  5. # Installation check
  6.  
  7. if (Test-Path -Path "$rookiePath\*") {
  8.     Write-Host "Rookie directory already exists at '$rookiePath'"
  9.     $response = Read-Host "Reinstall? [y/n] (this will remove the directory and all of its content)"
  10.    
  11.     if (($response.StartsWith('n')) -or ($response.StartsWith('N'))) {
  12.         Write-Host "Exiting..."
  13.         return
  14.     }
  15.  
  16.     rm $rookiePath -r
  17. }
  18.  
  19. Write-Host "Fetching latest Rookie release."
  20.  
  21. New-Item -ItemType Directory -Path $rookiePath -Force | Out-Null
  22.  
  23. # Install Rookie
  24.  
  25. $releaseInfo = Invoke-RestMethod -Uri $apiUrl -Method Get
  26. $version = $releaseInfo.tag_name
  27. $downloadUrl = $releaseInfo.assets[0].browser_download_url
  28.  
  29. Write-Host "Installing Rookie $version to '$rookiePath'"
  30.  
  31. $outputPath = Join-Path $rookiePath "AndroidSideloader.exe"
  32. Invoke-WebRequest -Uri $downloadUrl -OutFile $outputPath
  33.  
  34. # Give the AV a second to detect the file
  35. Start-Sleep -Seconds 1
  36.  
  37. # Check if the ops got it
  38. if (-not (Test-Path -Path $outputPath)) {
  39.     Write-Host "Failed to find Rookie. This likely means it has been removed by your Antivirus. Please create a folder exclusion for it and try again."
  40.     Write-Host "If you're not sure how, please watch this YouTube video for Windows Defender: https://www.youtube.com/watch?v=BonLkFNnO9w&t=54s"
  41.     Write-Host "Note: Turning your AV off is not only not going to work in the long-run, but puts your system at risk of real malware. A folder exclusion will allow Rookie to run."
  42.  
  43.     return
  44. }
  45.  
  46. Write-Host "Rookie has been installed to $outputPath successfully!"
  47. explorer.exe $rookiePath
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement