-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindows-bootstrap.ps1
159 lines (123 loc) · 4.53 KB
/
windows-bootstrap.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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
function askToExecute {
param (
[string]$message
)
do {
[System.Console]::ForegroundColor = [System.ConsoleColor]::Cyan
$userInput = Read-Host -Prompt $message
[System.Console]::ResetColor()
if ($userInput.ToUpper() -eq "Y" -or $userInput.ToUpper() -eq "") {
Write-Host "Continuing with the script execution..."
Start-Sleep -Seconds 1
return $true
} elseif ($userInput.ToUpper() -eq "N") {
return $false
} else {
Clear-Host
Write-Host "Invalid input. Please enter Y or N."
continue
}
} while ($true)
}
function getFromWeb {
param (
[string[]]$urls,
[string[]]$outputNames
)
$i = 0
foreach ($file in $urls) {
[System.Console]::ForegroundColor = [System.ConsoleColor]::Yellow
Write-Host "Downloading $file..."
[System.Console]::ResetColor()
Invoke-WebRequest -Uri $file -OutFile "$($outputNames[$i])"
[System.Console]::ForegroundColor = [System.ConsoleColor]::Green
Write-Host "Downloaded $($outputNames[$i])"
[System.Console]::ResetColor()
$i++
}
}
function activateWindows {
# ACTIVATION KEYS
# 6TP4R-GNPTD-KYYHQ-7B7DP-J447
# NRG8B-VKK3Q-CXVCJ-9G2XF-6Q84J
# W269N-WFGWX-YVC9B-4J6C9-T83GX
# VK7JG-NPHTM-C97JM-9MPGT-3V66T
# BACKUP SERVER
# kms.msguides.com
slmgr.vbs -upk
slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
slmgr /skms kms.digiboy.ir
slmgr /ato
}
function installApps {
$apps = @(
"7zip.7zip", "Microsoft.PowerToys", "Microsoft.VisualStudioCode", "AIMP.AIMP",
"Git.Git", "Neovim.Neovim", "SumatraPDF.SumatraPDF", "VideoLAN.VLC",
"AdrienAllard.FileConverter", "dotPDN.PaintDotNet", "OBSProject.OBSStudio",
"Valve.Steam", "Mojang.MinecraftLauncher", "GOG.Galaxy",
"Google.ChromeRemoteDesktopHost", "QL-Win.QuickLook", "Notion.Notion",
"Brave.Brave", "Discord.Discord", "Microsoft.OneDrive", "Obsidian.Obsidian", "GnuPG.Gpg4win"
)
foreach ($app in $apps) {
[System.Console]::ForegroundColor = [System.ConsoleColor]::Yellow
Write-Host "Installing $app..."
[System.Console]::ResetColor()
winget install $app --silent --accept-package-agreements --accept-source-agreements
}
$downloadedApps = @(
"https://github.com/msys2/msys2-installer/releases/download/2024-01-13/msys2-x86_64-20240113.exe",
"https://www.sumatrapdfreader.org/dl/rel/3.5.2/SumatraPDF-3.5.2-64-install.exe",
"https://www.aimp.ru/?do=download.file&id=3",
"https://github.com/hellzerg/optimizer/releases/download/16.7/Optimizer-16.7.exe"
)
$applicationNames = @("msys2-(v20240113).exe", "sumatra-pdf-(v3.5.2).exe", "aimp-(v5.30.2563).exe", "optimizer-(v16.7).exe")
Write-Host "Downloading additional applications..."
getFromWeb -urls $downloadedApps -outputNames $applicationNames
Write-Host "Installation completed."
}
function getCustomizationFiles {
if (-not (Test-Path -Path "config")) {
New-Item -ItemType Directory -Path "config"
New-Item -ItemType Directory -Path "config\fonts"
}
$customizationFiles = @(
"https://github.com/druxorey/windots/archive/refs/heads/main.zip",
"https://github.com/dracula/microsoft-edge/archive/refs/heads/main.zip",
"https://github.com/ABaumher/galaxy-integration-steam/releases/download/v1.0.8/windows.zip"
)
$fontsFiles = @(
"https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/Hack.zip",
"https://dl.dafont.com/dl/?f=elegant_typewriter",
"https://github.com/ryanoasis/nerd-fonts/releases/download/v3.3.0/Noto.zip"
)
$fileNames = @("windots.zip", "dracula-for-edge.zip", "galaxy-integration-steam.zip")
$fontsNames = @("hack-nerd-font.zip", "elegant-typerwiter.zip", "noto-nerd-font.zip")
getFromWeb -urls $customizationFiles -outputNames $fileNames
getFromWeb -urls $fontsFiles -outputNames $fontsNames
}
function main {
Clear-Host
[System.Console]::ForegroundColor = [System.ConsoleColor]::Magenta
Write-Host "`n[========== WELCOME TO DRUXOREY'S WINDOWS BOOTSTRAP ==========]`n"
[System.Console]::ResetColor()
if (askToExecute "Do you want to update the system? (Y/N)") {
winget upgrade --all
}
if (askToExecute "Do you want to activate Windows? (Y/N)") {
activateWindows
}
if (askToExecute "Do you want to install applications? (Y/N)") {
installApps
}
if (askToExecute "Do you want to download the customization files? (Y/N)") {
getCustomizationFiles
Write-Host "IMPORTANT: The files were downloaded to the 'config' folder."
}
if (askToExecute "Do you want to restart the system? (Y/N)") {
Restart-Computer -Force
}
[System.Console]::ForegroundColor = [System.ConsoleColor]::Magenta
Write-Host "`n[========== SCRIPT EXECUTION COMPLETED ==========]"
[System.Console]::ResetColor()
}
main