-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpatch.ps1
More file actions
128 lines (95 loc) · 3.07 KB
/
patch.ps1
File metadata and controls
128 lines (95 loc) · 3.07 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
121
122
123
124
125
126
127
128
# =====================
# Dependency checks
# =====================
Write-Host "Checking dependencies..."
# ::::::::::::::::::::::::::::::::::::
# Check collection/scheduled_tasks.ps1
# ::::::::::::::::::::::::::::::::::::
Write-Host "Scheduled Tasks Register script: " -NoNewline
if (!(Test-Path "collection/scheduled_tasks.ps1")) {
Write-Host "Missing!" -ForegroundColor Red
Exit
}
else {
Write-Host "OK." -ForegroundColor Green
}
# ::::::::::::::::::::::::::::::::::::
# :::::::::::::::::::::::::::::::::::
# Check collection/GroupPolicy folder
# :::::::::::::::::::::::::::::::::::
Write-Host "Group Policy settings folder: " -NoNewline
if (!(Test-Path "collection/GroupPolicy")) {
Write-Host "Missing!" -ForegroundColor Red
Exit
}
else {
Write-Host "OK." -ForegroundColor Green
}
# :::::::::::::::::::::::::::::::::::
# :::::::::::::::::::::::::::::::
# Check Block Roblox registry key
# :::::::::::::::::::::::::::::::
Write-Host "Block Roblox registry key: " -NoNewline
if (!(Test-Path "collection/Block Roblox.reg")) {
Write-Host "Missing!" -ForegroundColor Red
Exit
}
else {
Write-Host "OK." -ForegroundColor Green
}
# :::::::::::::::::::::::::::::::
# =======
# MAIN
# =======
# ::::::::::::::::::::::::::::
# Update Group Policy Settings
# ::::::::::::::::::::::::::::
# Only copy group policy settings if Windows edition is Pro
$windowsEdition = (Get-WmiObject -Class Win32_OperatingSystem).OperatingSystemSKU
if ($windowsEdition -eq 48) {
Write-Host "Copying group policy settings..."
Copy-Item -Path "$PSScriptRoot\collection\GroupPolicy" -Destination "C:\Windows\System32" -Recurse -Force
Write-Host "Group policy settings copied!" -ForegroundColor Green
}
else {
Write-Host "Windows edition is not Pro. Skipping group policy settings copy." -ForegroundColor Yellow
}
# ::::::::::::::::::::::::::::
# ::::::::::::::::::::::::::::::::
# Import Block Roblox registry key
# ::::::::::::::::::::::::::::::::
Write-Host "Importing Block Roblox registry key..."
# Import registry key
reg import "$PSScriptRoot\collection\Block Roblox.reg"
Write-Host "Block Roblox registry key imported!" -ForegroundColor Green
# ::::::::::::::::::::::::::::::::
# ::::::::::::::::::::::
# Update scheduled tasks
# ::::::::::::::::::::::
& $PSScriptRoot/collection/scheduled_tasks.ps1
# ::::::::::::::::::::::
# :::::::::::::::::::::::::::::::
# Install optional adobe software
# :::::::::::::::::::::::::::::::
& $PSScriptRoot/adobe.ps1
# :::::::::::::::::::::::::::::::
# :::::::::::::::::::::::::::
# Install Embarcadero Dev-C++
# :::::::::::::::::::::::::::
Start-Process -FilePath "emb_dcpp.exe" -ArgumentList "/S" -Wait
if ($LASTEXITCODE -eq 0) {
if (!(Test-Path "C:\Program Files (x86)\Embarcadero\Dev-C++")) {
Write-Host "Embarcadero Dev-C++ installation failed!" -ForegroundColor Red
Exit
}
else {
Write-Host "Embarcadero Dev-C++ installed!" -ForegroundColor Green
}
}
else {
Write-Host "Embarcadero Dev-C++ installation failed!" -ForegroundColor Red
}
# :::::::::::::::::::::::::::
# =======
# END
# =======