-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpd-install.ps1
69 lines (51 loc) · 2.97 KB
/
pd-install.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env pwsh
# Usage:
# Press Win + R
# powershell -ExecutionPolicy Bypass -c "iex(New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/keton/pacific-drive-uevr/master/pd-install.ps1')"
$elevatedScript = {
# Stop executing script on any error
$ErrorActionPreference = 'Stop'
# Do not show download progress
$ProgressPreference = 'SilentlyContinue'
# Taken from https://stackoverflow.com/a/34559554/6537420
function New-TemporaryDirectory {
$parent = [System.IO.Path]::GetTempPath()
[string] $name = [System.Guid]::NewGuid()
New-Item -ItemType Directory -Path (Join-Path $parent $name)
}
# Remainder of script here
$tempFileFolder = New-TemporaryDirectory
Write-Output "Temporary dir: $tempFileFolder"
Write-Output "Creating necessary folders"
mkdir "$env:APPDATA\UnrealVRMod\PenDriverPro-Win64-Shipping" -Force > $null
mkdir "$env:APPDATA\raicuparta\rai-pal\data\mod-loaders\runnable\mods\chihuahua" -Force > $null
Write-Output "Adding Windows Defender exceptions"
Add-MpPreference -ExclusionPath "$env:APPDATA\UnrealVRMod" -Force
Add-MpPreference -ExclusionPath "$env:APPDATA\raicuparta\rai-pal\data\mod-loaders\runnable" -Force
Write-Output "Downloading Rai Pal"
Invoke-WebRequest https://github.com/Raicuparta/rai-pal/releases/latest/download/RaiPal.msi -OutFile "$tempFileFolder/RaiPal.msi"
Write-Output "Downloading Chihuahua"
Invoke-WebRequest https://github.com/keton/chihuahua/releases/latest/download/chihuahua.zip -OutFile "$tempFileFolder/chihuahua.zip"
Write-Output "Downloading Pacific Drive profile"
Invoke-WebRequest https://github.com/keton/pacific-drive-uevr/releases/latest/download/PenDriverPro-Win64-Shipping.zip -OutFile "$tempFileFolder/PenDriverPro-Win64-Shipping.zip"
Write-Output "Installing Rai Pal"
Start-Process -NoNewWindow -Wait msiexec -ArgumentList /i, "$tempFileFolder\RaiPal.msi", /qn
Write-Output "Installing chihuahua"
Expand-Archive -LiteralPath "$tempFileFolder/chihuahua.zip" -DestinationPath "$env:APPDATA\raicuparta\rai-pal\data\mod-loaders\runnable\mods\chihuahua" -Force
Write-Output "Setting chihuahua to pull UEVR nightlies"
(Get-Content "$env:APPDATA\raicuparta\rai-pal\data\mod-loaders\runnable\mods\chihuahua\rai-pal-manifest.json").Replace('"--delay"', '"--uevr-build","Nightly","--delay"') | Set-Content "$env:APPDATA\raicuparta\rai-pal\data\mod-loaders\runnable\mods\chihuahua\rai-pal-manifest.json"
Write-Output "Installing Pacific Drive profile"
Expand-Archive -LiteralPath "$tempFileFolder/PenDriverPro-Win64-Shipping.zip" -DestinationPath "$env:APPDATA\UnrealVRMod\PenDriverPro-Win64-Shipping" -Force
Write-Output "Cleaning up"
Remove-Item -Force -Recurse "$tempFileFolder"
Write-Host "Press any key to continue..."
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
}
# Self-elevate the script
Start-Process -Verb RunAs powershell.exe -ArgumentList (
'-EncodedCommand', (
[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($elevatedScript))
),
'-ExecutionPolicy Bypass'
)
Exit