Fully GUI implementation / Dividing Script into Manual/Automated and integrate Basic SW Install repo with here.
parent
e2c7ea17f4
commit
6c36b93757
@ -0,0 +1,339 @@
|
||||
function QuickPrivilegesElevation {
|
||||
# Used from https://stackoverflow.com/a/31602095 because it preserves the working directory!
|
||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
|
||||
}
|
||||
|
||||
function PrepareRun {
|
||||
|
||||
Write-Host "Current Script Folder $PSScriptRoot"
|
||||
Write-Host ""
|
||||
Push-Location $PSScriptRoot
|
||||
|
||||
Push-Location -Path .\lib
|
||||
Get-ChildItem -Recurse *.ps*1 | Unblock-File
|
||||
Pop-Location
|
||||
|
||||
#Import-Module -DisableNameChecking $PSScriptRoot\lib\"Check-OS-Info.psm1" # Not Used
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\lib\"Count-N-Seconds.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\lib\"Set-Script-Policy.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\lib\"Setup-Console-Style.psm1" # Make the Console look how i want
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\lib\"Simple-Message-Box.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\lib\"Title-Templates.psm1"
|
||||
|
||||
}
|
||||
|
||||
function PromptPcRestart {
|
||||
|
||||
$Ask = "If you want to see the changes restart your computer!
|
||||
Do you want to Restart now?"
|
||||
|
||||
switch (ShowQuestion -Title "Read carefully" -Message $Ask) {
|
||||
'Yes' {
|
||||
Write-Host "You choose Yes."
|
||||
Restart-Computer
|
||||
}
|
||||
'No' {
|
||||
Write-Host "You choose to Restart later"
|
||||
Write-Host "You choose No. (No = Cancel)"
|
||||
}
|
||||
'Cancel' { # With Yes, No and Cancel, the user can press Esc to exit
|
||||
Write-Host "You choose to Restart later"
|
||||
Write-Host "You choose Cancel. (Cancel = No)"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# https://docs.microsoft.com/pt-br/powershell/scripting/samples/creating-a-custom-input-box?view=powershell-7.1
|
||||
# Adapted majorly from https://github.com/ChrisTitusTech/win10script and https://github.com/Sycnex/Windows10Debloater
|
||||
function PrepareGUI {
|
||||
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
# Main Window:
|
||||
$Form = New-Object System.Windows.Forms.Form
|
||||
$Form.Text = "Windows 10 Smart Debloat"
|
||||
$Form.Size = New-Object System.Drawing.Size(854,480)
|
||||
$Form.StartPosition = 'CenterScreen' # Appears on the center
|
||||
$Form.FormBorderStyle = 'FixedSingle' # Not adjustable
|
||||
$Form.MinimizeBox = $false # Remove the Minimize Button
|
||||
$Form.MaximizeBox = $false # Remove the Maximize Button
|
||||
$Form.TopMost = $false
|
||||
$Form.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#252525")
|
||||
|
||||
# Icon: https://stackoverflow.com/a/53377253
|
||||
$iconBase64 = [Convert]::ToBase64String((Get-Content ".\lib\images\Windows-10-logo_icon.png" -Encoding Byte))
|
||||
$iconBytes = [Convert]::FromBase64String($iconBase64)
|
||||
$stream = New-Object IO.MemoryStream($iconBytes, 0, $iconBytes.Length)
|
||||
$stream.Write($iconBytes, 0, $iconBytes.Length);
|
||||
$Form.Icon = [System.Drawing.Icon]::FromHandle((New-Object System.Drawing.Bitmap -Argument $stream).GetHIcon())
|
||||
|
||||
# Panel 1 to put Labels and Buttons
|
||||
$Panel1 = New-Object system.Windows.Forms.Panel
|
||||
$Panel1.width = 284
|
||||
$Panel1.height = 480
|
||||
$Panel1.location = New-Object System.Drawing.Point(0,0)
|
||||
|
||||
# Title Label 1 for Panel 1
|
||||
$TitleLabel1 = New-Object system.Windows.Forms.Label
|
||||
$TitleLabel1.text = "System Tweaks"
|
||||
$TitleLabel1.AutoSize = $true
|
||||
$TitleLabel1.width = 25
|
||||
$TitleLabel1.height = 10
|
||||
$TitleLabel1.location = New-Object System.Drawing.Point(50,10)
|
||||
$TitleLabel1.Font = New-Object System.Drawing.Font('Arial',16)
|
||||
$TitleLabel1.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel1.Controls.Add($TitleLabel1)
|
||||
|
||||
# Button 1
|
||||
$automatedTweaks = New-Object system.Windows.Forms.Button
|
||||
$automatedTweaks.text = "Automated Tweaks"
|
||||
$automatedTweaks.width = 200
|
||||
$automatedTweaks.height = 70
|
||||
$automatedTweaks.location = New-Object System.Drawing.Point(25,50)
|
||||
$automatedTweaks.Font = New-Object System.Drawing.Font('Arial',13)
|
||||
$automatedTweaks.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel1.Controls.Add($automatedTweaks)
|
||||
|
||||
# Button 2
|
||||
$uiTweaks = New-Object system.Windows.Forms.Button
|
||||
$uiTweaks.text = "UI/UX Tweaks (WinAero)"
|
||||
$uiTweaks.width = 200
|
||||
$uiTweaks.height = 70
|
||||
$uiTweaks.location = New-Object System.Drawing.Point(25,140)
|
||||
$uiTweaks.Font = New-Object System.Drawing.Font('Arial',13)
|
||||
$uiTweaks.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel1.Controls.Add($uiTweaks)
|
||||
|
||||
# Button 3
|
||||
$FixProblems = New-Object system.Windows.Forms.Button
|
||||
$FixProblems.text = "Fix Windows Problems"
|
||||
$FixProblems.width = 200
|
||||
$FixProblems.height = 70
|
||||
$FixProblems.location = New-Object System.Drawing.Point(25,230)
|
||||
$FixProblems.Font = New-Object System.Drawing.Font('Arial',13)
|
||||
$FixProblems.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel1.Controls.Add($FixProblems)
|
||||
|
||||
# Panel 2 to put Labels and Buttons
|
||||
$Panel2 = New-Object system.Windows.Forms.Panel
|
||||
$Panel2.width = 284
|
||||
$Panel2.height = 250
|
||||
$Panel2.location = New-Object System.Drawing.Point(300,0)
|
||||
|
||||
# Title Label 2 for Panel 2
|
||||
$TitleLabel2 = New-Object system.Windows.Forms.Label
|
||||
$TitleLabel2.text = "Miscellaneous Tweaks"
|
||||
$TitleLabel2.AutoSize = $true
|
||||
$TitleLabel2.width = 25
|
||||
$TitleLabel2.height = 10
|
||||
$TitleLabel2.location = New-Object System.Drawing.Point(10,10)
|
||||
$TitleLabel2.Font = New-Object System.Drawing.Font('Arial',16)
|
||||
$TitleLabel2.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel2.Controls.Add($TitleLabel2)
|
||||
|
||||
# Button 4
|
||||
$DarkMode = New-Object system.Windows.Forms.Button
|
||||
$DarkMode.text = "Dark Mode"
|
||||
$DarkMode.width = 200
|
||||
$DarkMode.height = 70
|
||||
$DarkMode.location = New-Object System.Drawing.Point(25,50)
|
||||
$DarkMode.Font = New-Object System.Drawing.Font('Arial',13)
|
||||
$DarkMode.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel2.Controls.Add($DarkMode)
|
||||
|
||||
# Button 5
|
||||
$LightMode = New-Object system.Windows.Forms.Button
|
||||
$LightMode.text = "Light Mode"
|
||||
$LightMode.width = 200
|
||||
$LightMode.height = 70
|
||||
$LightMode.location = New-Object System.Drawing.Point(25,140)
|
||||
$LightMode.Font = New-Object System.Drawing.Font('Arial',13)
|
||||
$LightMode.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel2.Controls.Add($LightMode)
|
||||
|
||||
$PictureBox1 = New-Object system.Windows.Forms.PictureBox
|
||||
$PictureBox1.width = 170
|
||||
$PictureBox1.height = 170
|
||||
$PictureBox1.location = New-Object System.Drawing.Point(340,250)
|
||||
$PictureBox1.imageLocation = ".\lib\images\Script-Icon_2.png"
|
||||
$PictureBox1.SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::zoom
|
||||
|
||||
# Panel 3 to put Labels and Buttons
|
||||
$Panel3 = New-Object system.Windows.Forms.Panel
|
||||
$Panel3.width = 284
|
||||
$Panel3.height = 250
|
||||
$Panel3.location = New-Object System.Drawing.Point(600,0)
|
||||
|
||||
# Title Label 3 for Panel 3
|
||||
$TitleLabel3 = New-Object system.Windows.Forms.Label
|
||||
$TitleLabel3.text = "Software Install/Upg"
|
||||
$TitleLabel3.AutoSize = $true
|
||||
$TitleLabel3.width = 25
|
||||
$TitleLabel3.height = 10
|
||||
$TitleLabel3.location = New-Object System.Drawing.Point(10,10)
|
||||
$TitleLabel3.Font = New-Object System.Drawing.Font('Arial',16)
|
||||
$TitleLabel3.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel3.Controls.Add($TitleLabel3)
|
||||
|
||||
# Button 6
|
||||
$ChocolateySwInstaller = New-Object system.Windows.Forms.Button
|
||||
$ChocolateySwInstaller.text = "Choco SW Installer"
|
||||
$ChocolateySwInstaller.width = 200
|
||||
$ChocolateySwInstaller.height = 70
|
||||
$ChocolateySwInstaller.location = New-Object System.Drawing.Point(10,50)
|
||||
$ChocolateySwInstaller.Font = New-Object System.Drawing.Font('Arial',13)
|
||||
$ChocolateySwInstaller.ForeColor = [System.Drawing.ColorTranslator]::FromHtml("#eeeeee")
|
||||
$Panel3.Controls.Add($ChocolateySwInstaller)
|
||||
|
||||
# Button 1 Mouse Click listener
|
||||
$automatedTweaks.Add_Click({
|
||||
|
||||
Push-Location -Path .\scripts
|
||||
|
||||
Get-ChildItem -Recurse *.ps*1 | Unblock-File
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "backup-system.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"backup-system.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "all-in-one-tweaks.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"all-in-one-tweaks.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "fix-privacy-settings.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"fix-privacy-settings.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "optimize-user-interface.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"optimize-user-interface.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "remove-onedrive.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"remove-onedrive.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
Pop-Location
|
||||
Clear-Host
|
||||
|
||||
Write-Host "Done!"
|
||||
})
|
||||
|
||||
# Button 2 Mouse Click listener
|
||||
$uiTweaks.Add_Click({
|
||||
|
||||
Push-Location -Path .\scripts
|
||||
|
||||
Get-ChildItem -Recurse *.ps*1 | Unblock-File
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "manual-debloat-softwares.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"manual-debloat-softwares.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
Pop-Location
|
||||
Write-Host "Done!"
|
||||
|
||||
})
|
||||
|
||||
# Button 3 Mouse Click listener
|
||||
$FixProblems.Add_Click({
|
||||
|
||||
Push-Location -Path .\scripts
|
||||
|
||||
Get-ChildItem -Recurse *.ps*1 | Unblock-File
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "backup-system.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"backup-system.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
$Ask = "This part is OPTIONAL, only do this if you want to repair your Windows.
|
||||
Do you want to continue?"
|
||||
|
||||
switch (ShowQuestion -Title "Read carefully" -Message $Ask) {
|
||||
'Yes' {
|
||||
Write-Host "You choose Yes."
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "fix-general-problems.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"fix-general-problems.ps1"
|
||||
}
|
||||
'No' {
|
||||
Write-Host "You choose No. (No = Cancel)"
|
||||
}
|
||||
'Cancel' { # With Yes, No and Cancel, the user can press Esc to exit
|
||||
Write-Host "You choose Cancel. (Cancel = No)"
|
||||
}
|
||||
}
|
||||
|
||||
Pop-Location
|
||||
Write-Host "Done!"
|
||||
|
||||
})
|
||||
|
||||
# Button 4 Mouse Click listener
|
||||
$DarkMode.Add_Click({
|
||||
|
||||
Push-Location ".\utils"
|
||||
Write-Host "+ Enabling Dark theme..."
|
||||
regedit /s dark-theme.reg
|
||||
Pop-Location
|
||||
|
||||
})
|
||||
|
||||
# Button 5 Mouse Click listener
|
||||
$LightMode.Add_Click({
|
||||
|
||||
Push-Location ".\utils"
|
||||
Write-Host "+ Enabling Light theme..."
|
||||
regedit /s light-theme.reg
|
||||
Pop-Location
|
||||
|
||||
})
|
||||
|
||||
# Button 6 Mouse Click listener
|
||||
$ChocolateySwInstaller.Add_Click({
|
||||
|
||||
Push-Location -Path .\scripts
|
||||
|
||||
Get-ChildItem -Recurse *.ps*1 | Unblock-File
|
||||
|
||||
Clear-Host
|
||||
SimpleTitleTemplate -Text "choco-sw-installer.ps1"
|
||||
PowerShell -NoProfile -ExecutionPolicy Bypass -file .\"choco-sw-installer.ps1"
|
||||
# pause ### FOR DEBUGGING PURPOSES
|
||||
|
||||
Pop-Location
|
||||
Write-Host "Done!"
|
||||
|
||||
})
|
||||
|
||||
# Add all Panels to the Form (Screen)
|
||||
$Form.controls.AddRange(@($Panel1,$Panel2,$Panel3,$Panel4,$PictureBox1))
|
||||
|
||||
# Show the Window
|
||||
[void]$Form.ShowDialog()
|
||||
|
||||
# when done, dispose of the form
|
||||
$Form.Dispose()
|
||||
|
||||
}
|
||||
|
||||
QuickPrivilegesElevation # Check admin rights
|
||||
PrepareRun # Import modules from lib folder
|
||||
UnrestrictPermissions # Unlock script usage
|
||||
SetupConsoleStyle # Just fix the font on the PS console
|
||||
|
||||
PrepareGUI # Load the GUI
|
||||
|
||||
PromptPcRestart # Prompt options to Restart the PC
|
||||
RestrictPermissions # Lock script usage
|
||||
CountNseconds # Count 3 seconds (default) then exit
|
||||
Taskkill /F /IM $PID # Kill this task by PID because it won't exit with the command 'exit'
|
Binary file not shown.
After Width: | Height: | Size: 58 KiB |
Binary file not shown.
After Width: | Height: | Size: 54 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
@ -0,0 +1,94 @@
|
||||
<h1>
|
||||
<img width=30px src="./../lib/images/Windows-10-logo.png"> Win10 Basic SW Install
|
||||
<img width=30px src="./../lib/images/PowerShell-icon.png">
|
||||
</h1>
|
||||
|
||||
This was made to install all needed softwares on a Post-Install Windows.
|
||||
You can modify it as you want.
|
||||
|
||||
The best part is, if a Software was installed with Chocolatey,
|
||||
in this specific case, they'll upgrade automatically.
|
||||
|
||||
## Usage Requirements
|
||||
|
||||
The `choco-sw-installer.ps1` do not make everything automatically, follow these steps.
|
||||
|
||||
- Open `OpenPowershellHere.cmd` (For beginners) or the Powershell as admin on its folder.
|
||||
- Enable execution of PowerShell scripts and Unblock PowerShell scripts and modules within this directory.
|
||||
|
||||
### Easy way (Prepare and Run once):
|
||||
|
||||
- Copy and Paste this entire line below on **Powershell**:
|
||||
```Powershell
|
||||
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force; ls -Recurse .ps1 | Unblock-File; .\scripts\"choco-sw-installer.ps1"
|
||||
```
|
||||
|
||||
## Softwares that'll be Installed:
|
||||
|
||||
- Obviously, [Chocolatey](https://chocolatey.org/why-chocolatey) !!!
|
||||
- The Lastest Graphics driver of your GPU (Except AMD. See [Intel](https://chocolatey.org/packages/intel-graphics-driver), including [DSA](https://chocolatey.org/packages/intel-dsa) and [NVIDIA](https://chocolatey.org/packages/geforce-game-ready-driver), including [GeForce Experience](https://chocolatey.org/packages/geforce-experience));
|
||||
- [7-Zip](https://chocolatey.org/packages/7zip);
|
||||
- [Google Chrome](https://chocolatey.org/packages/GoogleChrome);
|
||||
- [Notepad++](https://chocolatey.org/packages/notepadplusplus.install);
|
||||
- [ONLYOffice Editors](https://chocolatey.org/packages/onlyoffice);
|
||||
- [qBitTorrent](https://chocolatey.org/packages/qbittorrent);
|
||||
- [Spotify](https://chocolatey.org/packages/spotify);
|
||||
- [uBlock Origin for Chrome](https://chocolatey.org/packages/ublockorigin-chrome);
|
||||
- [WinRAR](https://chocolatey.org/packages/winrar) ( English only :/ );
|
||||
- [VLC](https://chocolatey.org/packages/vlc);
|
||||
- [Java SE Runtime Environment](https://chocolatey.org/packages/jre8). (This matches with your OS Architecture and install the XX-bits only)
|
||||
|
||||
### [Optional] If you do play Games on PC, you'll want this (probably):
|
||||
|
||||
- [DirectX](https://chocolatey.org/packages/directx);
|
||||
- [Discord](https://chocolatey.org/packages/discord.install);
|
||||
- [Microsoft .NET Framework](https://chocolatey.org/packages/dotnetfx) (Latest);
|
||||
- [Parsec](https://chocolatey.org/packages/parsec);
|
||||
- [Steam](https://chocolatey.org/packages/steam);
|
||||
- [Microsoft Visual C++ 2005 SP1 Redistributable Package](https://chocolatey.org/packages/vcredist2005);
|
||||
- [Microsoft Visual C++ 2008 SP1 Redistributable Package](https://chocolatey.org/packages/vcredist2008);
|
||||
- [Microsoft Visual C++ 2010 Redistributable Package](https://chocolatey.org/packages/vcredist2010);
|
||||
- [Microsoft Visual C++ 2012 Redistributable Package](https://chocolatey.org/packages/vcredist2012);
|
||||
- [Visual C++ Redistributable Packages for Visual Studio 2013](https://chocolatey.org/packages/vcredist2013)
|
||||
- [Microsoft Visual C++ Redistributable for Visual Studio 2015-2019](https://chocolatey.org/packages/vcredist140);
|
||||
|
||||
### These listed now are OPTIONAL, if you want to install them, just remove the # ( DIY ;D ).
|
||||
|
||||
- [Audacity](https://chocolatey.org/packages/audacity);
|
||||
- [Brave](https://chocolatey.org/packages/brave/1.19.86);
|
||||
- [Firefox](https://chocolatey.org/packages/Firefox);
|
||||
- [ImgBurn](https://chocolatey.org/packages/imgburn);
|
||||
- [OBS Studio](https://chocolatey.org/packages/obs-studio);
|
||||
- [Paint.NET](https://chocolatey.org/packages/paint.net);
|
||||
- [Python](https://chocolatey.org/packages/python/) (Latest);
|
||||
- [Radmin VPN](https://chocolatey.org/packages/radmin-vpn);
|
||||
- [Sys Internals](https://chocolatey.org/packages/sysinternals);
|
||||
- [Wireshark](https://chocolatey.org/packages/wireshark).
|
||||
|
||||
#### DIY From the Gaming part:
|
||||
|
||||
- [Origin](https://chocolatey.org/packages/origin).
|
||||
|
||||
## LICENSE
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 Plínio Larrubia
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -0,0 +1,188 @@
|
||||
function QuickPrivilegesElevation {
|
||||
# Used from https://stackoverflow.com/a/31602095 because it preserves the working directory!
|
||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
|
||||
}
|
||||
# Your script here
|
||||
|
||||
function PrepareRun {
|
||||
|
||||
Push-Location -Path .\lib
|
||||
Get-ChildItem -Recurse *.ps*1 | Unblock-File
|
||||
Pop-Location
|
||||
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"Check-OS-Info.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"Count-N-Seconds.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"Set-Script-Policy.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"Setup-Console-Style.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"Simple-Message-Box.psm1"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"Title-Templates.psm1"
|
||||
|
||||
Write-Host "Current Script Folder $PSScriptRoot"
|
||||
Write-Host ""
|
||||
Push-Location $PSScriptRoot
|
||||
|
||||
}
|
||||
|
||||
function InstallChocolatey {
|
||||
|
||||
# This function will use Windows package manager to bootstrap Chocolatey and install a list of packages.
|
||||
|
||||
# Adapted From https://github.com/W4RH4WK/Debloat-Windows-10/blob/master/utils/install-basic-software.ps1
|
||||
Write-Host "Setting up Chocolatey software package manager"
|
||||
Get-PackageProvider -Name chocolatey -Force
|
||||
|
||||
Write-Host "Setting up Full Chocolatey Install"
|
||||
Install-Package -Name Chocolatey -Force -ProviderName chocolatey
|
||||
# Install Chocolatey
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
choco upgrade all -y
|
||||
choco install chocolatey-core.extension -y #--force
|
||||
|
||||
Write-Host "Creating daily task to automatically upgrade Chocolatey packages"
|
||||
# adapted from https://blogs.technet.microsoft.com/heyscriptingguy/2013/11/23/using-scheduled-tasks-and-scheduled-jobs-in-powershell/
|
||||
# Find it on "Microsoft\Windows\PowerShell\ScheduledJobs\Chocolatey Daily Upgrade"
|
||||
$JobName = "Chocolatey Daily Upgrade"
|
||||
$ScheduledJob = @{
|
||||
Name = $JobName
|
||||
ScriptBlock = {choco upgrade all -y}
|
||||
Trigger = New-JobTrigger -Daily -At 00:00
|
||||
ScheduledJobOption = New-ScheduledJobOption -RunElevated -MultipleInstancePolicy StopExisting -RequireNetwork
|
||||
}
|
||||
|
||||
# If the Sched. Job already exists, delete
|
||||
if (Get-ScheduledJob -Name $JobName) {
|
||||
Write-Host "ScheduledJob: $JobName FOUND! Deleting..."
|
||||
Unregister-ScheduledJob -Name $JobName
|
||||
}
|
||||
# Then register it again
|
||||
Register-ScheduledJob @ScheduledJob
|
||||
|
||||
}
|
||||
|
||||
function InstallPackages {
|
||||
|
||||
# Install GPU drivers first
|
||||
BeautyTitleTemplate -Text "Installing Graphics driver"
|
||||
|
||||
if ($GPU.contains("AMD")) {
|
||||
|
||||
BeautySectionTemplate -Text "Installing AMD drivers!"
|
||||
Write-Host "Unfortunately, Chocolatey doesn't have a package for AMD"
|
||||
|
||||
} elseif ($GPU.contains("Intel")) {
|
||||
|
||||
BeautySectionTemplate -Text "Installing Intel drivers!"
|
||||
choco install "chocolatey-misc-helpers.extension" -y # intel-dsa Dependency
|
||||
choco install "dotnet4.7" -y # intel-dsa Dependency
|
||||
choco install "intel-dsa" -y # Intel® Driver & Support Assistant (Intel® DSA)
|
||||
choco install "intel-graphics-driver" -y # Intel Graphics Driver (latest)
|
||||
|
||||
} elseif ($GPU.contains("NVIDIA")) {
|
||||
|
||||
BeautySectionTemplate -Text "Installing NVIDIA drivers!"
|
||||
choco install "geforce-experience" -y # GeForce Experience (latest)
|
||||
choco feature enable -n=useRememberedArgumentsForUpgrades
|
||||
cinst geforce-game-ready-driver --package-parameters="'/dch'"
|
||||
choco install "geforce-game-ready-driver" -y # GeForce Game Ready Driver (latest)
|
||||
|
||||
}
|
||||
|
||||
$EssentialPackages = @(
|
||||
"7zip.install" # 7-Zip
|
||||
"googlechrome" # Google Chrome
|
||||
"notepadplusplus.install" # Notepad++
|
||||
"onlyoffice" # ONLYOffice Editors
|
||||
"qbittorrent" # qBittorrent
|
||||
"spotify" # Spotify
|
||||
"ublockorigin-chrome" # uBlock Origin extension for Chrome
|
||||
"winrar" # English only
|
||||
"vlc" # VLC
|
||||
|
||||
# [DIY] Remove the # if you want to install something.
|
||||
|
||||
#"audacity" # Audacity
|
||||
#"brave" # Brave Browser
|
||||
#"firefox" # The person may likes Chrome
|
||||
#"imgburn" # Img Burn
|
||||
#"obs-studio" # OBS Studio
|
||||
#"paint.net" # Paint.NET
|
||||
#"python" # Python (Programming Language)
|
||||
#"radmin-vpn" # Radmin VPN
|
||||
#"sysinternals" # Sys Internals Suite
|
||||
#"wireshark" # Wire Shark
|
||||
)
|
||||
$TotalPackagesLenght = $EssentialPackages.Length+1
|
||||
|
||||
BeautyTitleTemplate -Text "Installing Packages"
|
||||
foreach ($Package in $EssentialPackages) {
|
||||
TitleWithContinuousCounter -Text "Installing: $Package" -MaxNum $TotalPackagesLenght
|
||||
choco install $Package -y # --force
|
||||
}
|
||||
|
||||
# For Java (JRE) correct installation
|
||||
if ($Architecture.contains("32-bits")) {
|
||||
TitleWithContinuousCounter -Text "Installing: jre8 (32-bits)"
|
||||
choco install "jre8" -PackageParameters "/exclude:64" -y
|
||||
} elseif ($Architecture.contains("64-bits")) {
|
||||
TitleWithContinuousCounter -Text "Installing: jre8 (64-bits)"
|
||||
choco install "jre8" -PackageParameters "/exclude:32" -y
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$Ask = "Do you plan to play Games on this Machine?
|
||||
All important Gaming clients and Required Game Softwares to Run Games will be installed.
|
||||
+ Discord included."
|
||||
function InstallGamingPackages { # You Choose
|
||||
|
||||
switch (ShowQuestion -Title "Read carefully" -Message $Ask) {
|
||||
'Yes' {
|
||||
|
||||
Write-Host "You choose Yes."
|
||||
$GamingPackages = @(
|
||||
"directx" # DirectX End-User Runtimes
|
||||
"discord.install" # Discord
|
||||
"dotnetfx" # Microsoft .NET Framework (Latest)
|
||||
"parsec" # Parsec
|
||||
"steam" # Steam
|
||||
"vcredist2005" # Microsoft Visual C++ 2005 SP1 Redistributable Package
|
||||
"vcredist2008" # Microsoft Visual C++ 2008 SP1 Redistributable Package
|
||||
"vcredist2010" # Microsoft Visual C++ 2010 Redistributable Package
|
||||
"vcredist2012" # Microsoft Visual C++ 2012 Redistributable Package
|
||||
"vcredist2013" # Visual C++ Redistributable Packages for Visual Studio 2013
|
||||
"vcredist140" # Microsoft Visual C++ Redistributable for Visual Studio 2015-2019
|
||||
|
||||
# [DIY] Remove the # if you want to install something.
|
||||
|
||||
#"origin" # [DIY] I don't like Origin
|
||||
)
|
||||
$TotalPackagesLenght += $GamingPackages.Length
|
||||
|
||||
BeautyTitleTemplate -Text "Installing Packages"
|
||||
foreach ($Package in $GamingPackages) {
|
||||
TitleWithContinuousCounter -Text "Installing: $Package" -MaxNum $TotalPackagesLenght
|
||||
choco install $Package -y # --force
|
||||
}
|
||||
|
||||
}
|
||||
'No' {
|
||||
Write-Host "You choose No. (No = Cancel)"
|
||||
}
|
||||
'Cancel' { # With Yes, No and Cancel, the user can press Esc to exit
|
||||
Write-Host "You choose Cancel. (Cancel = No)"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
QuickPrivilegesElevation # Check admin rights
|
||||
PrepareRun # Import modules from lib folder
|
||||
UnrestrictPermissions # Unlock script usage
|
||||
SetupConsoleStyle # Make the Console looks how i want
|
||||
$Architecture = CheckOSArchitecture # Checks if the System is 32-bits or 64-bits or Something Else
|
||||
$GPU = DetectVideoCard # Detects the current GPU
|
||||
InstallChocolatey # Install Chocolatey on Powershell
|
||||
InstallPackages # Install the Showed Softwares
|
||||
InstallGamingPackages # Install the most important Gaming Clients and Required Softwares to Run Games
|
||||
RestrictPermissions # Lock script usage
|
||||
Taskkill /F /IM $PID # Kill this task by PID because it won't exit with the command 'exit'
|
@ -0,0 +1,40 @@
|
||||
# Made by LeDragoX
|
||||
|
||||
Write-Host "Current Script Folder $PSScriptRoot"
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\Count-N-Seconds.psm1
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\New-FolderForced.psm1
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\Simple-Message-Box.psm1
|
||||
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\Title-Templates.psm1
|
||||
|
||||
function RunManualDebloatSoftwares {
|
||||
|
||||
$Message = "[This is a DIY step]
|
||||
1 - If showed click [I AGREE]
|
||||
2 - Click on the guide Tools >
|
||||
3 - Go on Import/Export Tweaks >
|
||||
4 - Import tweaks from a file >
|
||||
5 - hit Next > Browse... > Select 'My_Winaero_Profile.ini' >
|
||||
6 - Next > Finish (DON'T SPAM)
|
||||
7 - Close it then OK"
|
||||
|
||||
# If changing the programs folder move here!!!
|
||||
Push-Location "..\lib\Debloat-Softwares"
|
||||
|
||||
Write-Host "+ [DIY] Running WinAero Tweaker..."
|
||||
Expand-Archive '.\Winaero Tweaker.zip'
|
||||
Push-Location "Winaero Tweaker"
|
||||
Remove-Item ".\Winaero.url" -Force -Recurse # Web page Shortcut
|
||||
Start-Process -FilePath ".\WinaeroTweaker.exe" # Could not download it (Tried Start-BitsTransfer and WebClient, but nothing)
|
||||
Pop-Location
|
||||
|
||||
CountNseconds -Time 2 -Msg "Waiting" # Count 2 seconds then show the Message
|
||||
ShowMessage -Title "DON'T CLOSE YET" -Message $Message
|
||||
Taskkill /F /IM "WinaeroTweaker.exe"
|
||||
Taskkill /F /IM "WinaeroTweakerHelper.exe"
|
||||
Remove-Item ".\Winaero Tweaker\" -Exclude "*.ini" -Force -Recurse
|
||||
|
||||
Pop-Location
|
||||
|
||||
}
|
||||
|
||||
RunManualDebloatSoftwares # [DIY] Run WinAeroTweaker.
|
Loading…
Reference in New Issue