-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_scpsl_gdpi.ps1
More file actions
120 lines (93 loc) · 5.16 KB
/
Copy pathinstall_scpsl_gdpi.ps1
File metadata and controls
120 lines (93 loc) · 5.16 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
function DeleteLeftoverFiles
{
Param (
[string]$old_folder_path
)
# Delete existing installation folder
if (Test-Path $old_folder_path) {
Write-Output "Óäàëÿåì óñòàðåâøèå ôàéëû GoodbyeDPI"
[void](Remove-Item $old_folder_path -Recurse -Confirm:$False -Force)
}
}
# Set title and advertisement
$host.ui.RawUI.WindowTitle = "Welcome To Hell SCP:SL GoodbyeDPI downloader and installer"
Write-Host "Çàãðóç÷èê è èíñòàëëÿòîð ñåðâèñà GoodbyeDPI äëÿ âñåõ äîìåíîâ SCP:SL îò " -ForegroundColor white -nonewline
Write-Host "Welcome To Hell" -ForegroundColor red
Write-Host "https://discord.scpsl.ru" -ForegroundColor white -BackgroundColor darkred
Write-Host ""
# Disable warnings and errors output
$ErrorActionPreference = "SilentlyContinue"
$WarningPreference = "SilentlyContinue"
function global:Write-Host() {}
# Do not prompt for confirmations
Set-Variable -Name 'ConfirmPreference' -Value 'None' -Scope Global
[void]([System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms"))
# Determining Windows architecture
$os_type = (Get-WmiObject -Class Win32_ComputerSystem).SystemType -match ‘(x64)’
# Finding GoodbyeDPI folder
$gdpi_folder = "WTH_GoodbyeDPI"
$path = ""
if ($os_type -eq $True) {
$path = [Environment]::GetEnvironmentVariable("ProgramFiles") + "\" + $gdpi_folder + "\x86_64"
}
else
{
$path = [Environment]::GetEnvironmentVariable("ProgramFiles(x86)") + "\" + $gdpi_folder + "\x86"
}
# Checking if GoodbyeDPI is already installed. Ask to uninstall. If not accepted, exit script.
Write-Output "Ïðîâåðÿåì, óñòàíîâëåí ëè ñåðâèñ WTH GoodbyeDPI"
$gdpi_service_exists = Get-Service -Name "WTH GoodbyeDPI" -ErrorAction SilentlyContinue
if ($gdpi_service_exists.Length -gt 0) {
$result = [System.Windows.Forms.MessageBox]::Show('Íàéäåí óñòàíîâëåííûé ðàíåå ñåðâèñ WTH GoodbyeDPI!' + [System.Environment]::NewLine + [System.Environment]::NewLine + 'Óäàëèòü?' , "WTH SCP:SL GoodbyeDPI" , [System.Windows.Forms.MessageBoxButtons]::YesNo, [System.Windows.Forms.MessageBoxIcon]::Error)
if ($result -eq 'Yes') {
# Deleting existing GoodbyeDPI service
Write-Output "Îñòàíàâëèâàåì è óäàëÿåì ñåðâèñ WTH GoodbyeDPI"
[void](sc.exe stop "WTH GoodbyeDPI")
[void](sc.exe delete "WTH GoodbyeDPI")
DeleteLeftoverFiles -old_folder_path (Split-Path $path -Parent)
}
if ($result -eq 'No') {
exit
}
}
$result = [System.Windows.Forms.MessageBox]::Show('Ñêðèïò óñòàíîâèò ñåðâèñ WTH GoodbyeDPI äëÿ èñïðàâëåíèÿ ïðîáëåìû ñ ñîåäèíåíèåì ñ èíòåðíåò-ðåñóðñàìè èãðû SCP: Secret Laboratory.' + [System.Environment]::NewLine + [System.Environment]::NewLine + 'Óñòàíîâèòü?' , "WTH SCP:SL GoodbyeDPI" , [System.Windows.Forms.MessageBoxButtons]::YesNo, [System.Windows.Forms.MessageBoxIcon]::Question)
if ($result -eq 'Yes') {
$path = Split-Path (Split-Path $path -Parent) -Parent
DeleteLeftoverFiles -old_folder_path "$path\$gdpi_folder"
[void](New-Item -Path "$path\$gdpi_folder" -ItemType Directory -Confirm:$False -Force)
# Downloading latest GoodbyeDPI to installtion folder
Write-Output "Ñêà÷èâàåì ïîñëåäíþþ âåðñèþ GoodbyeDPI"
Invoke-RestMethod 'https://api.github.com/repos/ValdikSS/GoodbyeDPI/releases/latest' | % assets | ? name -like "*.zip" | % {
Invoke-WebRequest $_.browser_download_url -OutFile ("$path\" + $_.name)
$gdpi_archive_name = $_.name
}
# Unpack downloaded archive
Write-Output "Ðàñïàêîâûâàåì àðõèâ"
Expand-Archive -Path "$path\$gdpi_archive_name" -DestinationPath $path
$unpacked_folder = "$path\$gdpi_archive_name".TrimEnd('.zip')
[void](Move-Item -Path "$unpacked_folder\*" -Destination "$path\$gdpi_folder" -Force -Confirm:$False)
# Delete leftovers
if (Test-Path "$unpacked_folder") {[void](Remove-Item "$unpacked_folder" -Confirm:$False -Force -Recurse)}
if (Test-Path "$path\$gdpi_archive_name") {[void](Remove-Item "$path\$gdpi_archive_name" -Confirm:$False -Force)}
# Download SCP:SL website list File
Write-Output "Ñêà÷èâàåì whitelist äîìåíîâ SCP: Secret Laboratory"
Start-BitsTransfer -Source 'https://raw.githubusercontent.com/REALMWTH/Powershell-GDPI-Install-Script/main/scpsl_domains.txt' -Destination "$path\$gdpi_folder"
# Install Service
Write-Output "Óñòàíàâëèâàåì ñåðâèñ WTH GoodbyeDPI"
if ($os_type -eq $True) {
$exe_path = [Environment]::GetEnvironmentVariable("ProgramFiles") + "\" + $gdpi_folder + "\x86_64\goodbyedpi.exe"
}
else
{
$exe_path = [Environment]::GetEnvironmentVariable("ProgramFiles(x86)") + "\" + $gdpi_folder + "\x86\goodbyedpi.exe"
}
[void](cmd.exe /c "sc create `"WTH GoodbyeDPI`" binPath= `"$exe_path -5 --blacklist `"`"$path\$gdpi_folder\scpsl_domains.txt`"`"")
[void](sc.exe config "WTH GoodbyeDPI" start= auto)
[void](sc.exe description "WTH GoodbyeDPI" "Passive Deep Packet Inspection blocker and Active DPI circumvention utility. Affects SCP:SL Domains only.")
Write-Output "Çàïóñêàåì ñåðâèñ WTH GoodbyeDPI"
[void](sc.exe start "WTH GoodbyeDPI")
$result = [System.Windows.Forms.MessageBox]::Show('Ñêðèïò óñïåøíî óñòàíîâèë ñåðâèñ WTH GoodbyeDPI.' + [System.Environment]::NewLine + [System.Environment]::NewLine + "Ïðîâåðüòå ðàáîòîñïîñîáíîñòü ñïèñêà ñåðâåðîâ SCP:SL.", "WTH SCP:SL GoodbyeDPI" , [System.Windows.Forms.MessageBoxButtons]::OK, [System.Windows.Forms.MessageBoxIcon]::Information)
}
if ($result -eq 'No') {
exit
}