forked from Vencord/Installer
-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.ps1
68 lines (57 loc) · 2.02 KB
/
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
$DOWNLOAD_CLI = "https://github.com/StupidityDB/VencordPlusInstaller/releases/latest/download/VencordInstallerCli.exe"
$DOWNLOAD_GUI = "https://github.com/StupidityDB/VencordPlusInstaller/releases/latest/download/VencordInstaller.exe"
if ([Environment]::Is64BitOperatingSystem -and [System.Environment]::OSVersion.Version.Major -ge 10) {
Write-Output "=============================="
Write-Output "| Vencord Installer |"
Write-Output "=============================="
Write-Output ""
Write-Output "Which installer version do you want to use?"
Write-Output "1) Graphical - More user friendly but may not work on old/low-end GPUs"
Write-Output "2) Terminal - Choose this option if the graphical installer does not work"
Write-Output "Q) Quit without doing anything"
Write-Output ""
$choice = Read-Host "Please choose by typing a number or Q"
} else {
$choice = 2
}
switch ($choice) {
1 { $link = $DOWNLOAD_GUI }
2 { $link = $DOWNLOAD_CLI }
q { Return }
default {
Write-Output "Invalid choice $choice. Exiting..."
Return
}
}
$outfile = "$env:TEMP\$(([uri]$link).Segments[-1])"
Write-Output "Downloading installer to $outfile"
Invoke-WebRequest -Uri "$link" -OutFile "$outfile"
Write-Output ""
if ($choice -eq 2) {
Write-Output "What do you want to do?"
Write-Output "1) Install Vencord"
Write-Output "2) Install OpenAsar"
Write-Output "3) Uninstall Vencord"
Write-Output "4) Uninstall OpenAsar"
Write-Output "5) Reinstall & Update Vencord"
Write-Output "Q) Quit without doing anything"
Write-Output ""
$choice = Read-Host "Please choose by typing a number or Q"
switch ($choice) {
1 { $flag = "-install" }
2 { $flag = "-install-openasar" }
3 { $flag = "-uninstall" }
4 { $flag = "-uninstall-openasar" }
5 { $flag = "-reinstall" }
q { Return }
default {
Write-Output "Invalid choice $choice. Exiting..."
Return
}
}
Start-Process -Wait -NoNewWindow -FilePath "$outfile" -ArgumentList "$flag"
} else {
Start-Process -Wait -NoNewWindow -FilePath "$outfile"
}
# Cleanup
Remove-Item -Force "$outfile"