Skip to content

Commit

Permalink
Feat: separate OneDrive and DNS tweaks to GUI (LeDragoX#45)
Browse files Browse the repository at this point in the history
- DNS server will not change by default on Apply Tweaks
- OneDrive will not be removed by default while Applying tweaks
- Put has a comment on CLI version
- Centralized the first tab panels
- Updated Docs about ONEDRIVE removal
- Updated Description on DOCS (it was a little empty)
  • Loading branch information
LeDragoX committed Jul 8, 2022
1 parent 899c790 commit 013c96c
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 23 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ I need to change these files:

<h2 align="center"><i>This Project was adapted from <a href="https://github.com/W4RH4WK/Debloat-Windows-10">W4RH4WK's Project</a></i></h2>

These scripts will Customize, Debloat and Improve Privacy/Performance and System Responsiveness on Windows 10+.
These scripts will Customize, Debloat and Improve Privacy/Performance and System Responsiveness on Windows 10+. A collection of scripts to organize the tweaks per category, using different functions to adjust the system settings and make Windows great again! You can also install your favorite softwares through the GUI with just one click after being selected.

> _Use on a fresh windows install to note the differences._
Expand Down Expand Up @@ -114,6 +114,7 @@ Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force; ls -Recurse *.ps*1 |

- `Apply Tweaks`: Run every Common Tweak scripts;
- `Undo Tweaks`: Re-apply some tweaks and [Revert] all possible ones, covering the `Scheduled Tasks`, `Services`, `Privacy and Performance`, `Personal` and `Optional Features` tweaks, then try to `Reinstall Pre-Installed Apps`;
- `Remove OneDrive`: completely removes OneDrive from the System, re-install is possible via Win Store; ([`remove-onedrive.ps1`](./src/scripts/remove-onedrive.ps1))
- `Remove Xbox`: Wipe Xbox Apps, disable Services related to Xbox and GameBar/GameDVR; ([`remove-xbox.ps1`](./src/scripts/remove-xbox.ps1))
- `Install OneDrive`: Tries to re-install the built-in OneDrive; ([`install-onedrive.ps1`](./src/utils/install-onedrive.ps1))
- `Reinstall Pre-Installed Apps`: Rebloat Windows with all the Pre-Installed Apps; ([`reinstall-pre-installed-apps.ps1`](./src/utils/reinstall-pre-installed-apps.ps1))
Expand All @@ -125,8 +126,9 @@ Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force; ls -Recurse *.ps*1 |
- `Dark Theme & Light Theme`: Apply [Dark Theme](./src/utils/use-dark-theme.reg) or [Light Theme](./src/utils/use-light-theme.reg) on Windows;
- `Enable/Disable Activity History`: [Enables](./src/utils/enable-activity-history.reg) or [Disables](src/utils/disable-activity-history.reg) the **Activity History**;
- `Enable/Disable Background Apps`: [Enables](./src/utils/enable-bg-apps.reg) or [Disables](src/utils/disable-bg-apps.reg) _ALL_ the **Background Apps**;
- `Enable/Disable Cortana`: [Enables](./src/utils/enable-cortana.reg) or [Disables](src/utils/disable-cortana.reg) the **Cortana**;
- `Enable/Disable Clipboard History`: [Enables](./src/utils/enable-clipboard-history.reg) or [Disables](src/utils/disable-clipboard-history.reg) the **Clipboard History**;
- `Enable/Disable Cortana`: [Enables](./src/utils/enable-cortana.reg) or [Disables](src/utils/disable-cortana.reg) the **Cortana**;
- [Enable](src/utils/enable-encrypted-dns-doh.ps1)/[Disable](src/utils/disable-encrypted-dns-doh.ps1) `Encrypted DNS`: Sets the DNS Client Servers to **Cloudflare's** and **Google's** (ipv4 and ipv6), and enables **DNS Over HTTPS** on _Windows 11_.
- `Enable/Disable Old Volume Control`: [Enables](./src/utils/enable-old-volume-control.reg) or [Disables](src/utils/disable-old-volume-control.reg) the **Old Volume Control (Win 7/8.1)**;
- `Enable/Disable Photo Viewer`: [Enables](./src/utils/enable-photo-viewer.reg) or [Disables](src/utils/disable-photo-viewer.reg) the **Photo Viewer (Win 7/8.1)**;
- `Enable/Disable WSearch Service`: [Enables](./src/utils/enable-wsearch-service.ps1) or [Disables](src/utils/disable-wsearch-service.ps1) the **Windows Search Service**;
Expand Down Expand Up @@ -169,7 +171,6 @@ Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force; ls -Recurse *.ps*1 |
- Optimize Performance by changing away from stock configurations that slowdowns the system; ([`optimize-performance.ps1`](./src/scripts/optimize-performance.ps1))
- Apply General Personalization tweaks via Registry and Powershell commands; ([`personal-tweaks.ps1`](./src/scripts/personal-tweaks.ps1))
- Help improve the Security of Windows while maintaining performance; ([`optimize-security.ps1`](./src/scripts/optimize-security.ps1))
- Remove OneDrive completely from the System, re-install is possible via Win Store; ([`remove-onedrive.ps1`](./src/scripts/remove-onedrive.ps1))
- Disable/Enable Windows Features specially for Gaming/Productivity; ([`optimize-windows-features.ps1`](./src/scripts/optimize-windows-features.ps1))

</details>
Expand Down
2 changes: 1 addition & 1 deletion Win10ScriptCLI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Open-Script() {
"optimize-performance.ps1",
"personal-tweaks.ps1",
"optimize-security.ps1",
"remove-onedrive.ps1",
#"remove-onedrive.ps1",
"optimize-windows-features.ps1"
)

Expand Down
35 changes: 26 additions & 9 deletions Win10ScriptGUI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function Show-GUI() {

# <===== Specific Layout =====>

$SystemTweaksHeight = 650
$SystemTweaksHeight = 700
$SoftwareInstallHeight = 1650

# <===== UI =====>
Expand All @@ -93,7 +93,7 @@ function Show-GUI() {
$ClSystemTweaks = New-Label -Text "($((Split-Path -Path $PSCommandPath -Leaf).Split('.')[0]) v$((Get-Item "$(Split-Path -Path $PSCommandPath -Leaf)").LastWriteTimeUtc | Get-Date -Format "yyyy-MM-dd"))" -Width $TotalWidth -Height $CaptionLabelHeight -LocationX 0 -ElementBefore $TlSystemTweaks -MarginTop $DistanceBetweenElements -ForeColor $White

# ==> Tab 1
$CurrentPanelIndex = 0
$CurrentPanelIndex = 1
$T1Panel1 = New-Panel -Width $PanelWidth -Height $SystemTweaksHeight -LocationX ($PanelWidth * $CurrentPanelIndex) -ElementBefore $ClSystemTweaks
$CurrentPanelIndex++
$T1Panel2 = New-Panel -Width $PanelWidth -Height $SystemTweaksHeight -LocationX ($PanelWidth * $CurrentPanelIndex) -ElementBefore $ClSystemTweaks
Expand All @@ -102,7 +102,8 @@ function Show-GUI() {
$ClDebloatTools = New-Label -Text "System Debloat Tools" -Width $PanelElementWidth -Height $CaptionLabelHeight -LocationX $PanelElementX -LocationY 0
$ApplyTweaks = New-Button -Text "✔ Apply Tweaks" -Width $PanelElementWidth -Height $BBHeight -LocationX $PanelElementX -ElementBefore $ClDebloatTools -FontSize $Header3 -ForeColor $WinBlue
$UndoTweaks = New-Button -Text "❌ Undo Tweaks" -Width $PanelElementWidth -Height $ButtonHeight -LocationX $PanelElementX -ElementBefore $ApplyTweaks -MarginTop $DistanceBetweenElements -ForeColor $WarningYellow
$RemoveXbox = New-Button -Text "Remove Xbox" -Width $PanelElementWidth -Height $ButtonHeight -LocationX $PanelElementX -ElementBefore $UndoTweaks -MarginTop $DistanceBetweenElements -ForeColor $WarningYellow
$RemoveOneDrive = New-Button -Text "Remove OneDrive" -Width $PanelElementWidth -Height $ButtonHeight -LocationX $PanelElementX -ElementBefore $UndoTweaks -MarginTop $DistanceBetweenElements -ForeColor $WarningYellow
$RemoveXbox = New-Button -Text "Remove Xbox" -Width $PanelElementWidth -Height $ButtonHeight -LocationX $PanelElementX -ElementBefore $RemoveOneDrive -MarginTop $DistanceBetweenElements -ForeColor $WarningYellow
$PictureBox1 = New-PictureBox -ImageLocation "$PSScriptRoot\src\assets\script-logo.png" -Width $PanelElementWidth -Height (($BBHeight * 2) + $DistanceBetweenElements) -LocationX $PanelElementX -ElementBefore $RemoveXbox -MarginTop $DistanceBetweenElements -SizeMode 'Zoom'
$InstallOneDrive = New-Button -Text "Install OneDrive" -Width $PanelElementWidth -Height $ButtonHeight -LocationX $PanelElementX -ElementBefore $PictureBox1 -MarginTop $DistanceBetweenElements
$ReinstallBloatApps = New-Button -Text "Reinstall Pre-Installed Apps" -Width $PanelElementWidth -Height $ButtonHeight -LocationX $PanelElementX -ElementBefore $InstallOneDrive -MarginTop $DistanceBetweenElements
Expand All @@ -116,7 +117,8 @@ function Show-GUI() {
$CbBackgroundsApps = New-CheckBox -Text "Enable Background Apps" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbActivityHistory
$CbClipboardHistory = New-CheckBox -Text "Enable Clipboard History" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbBackgroundsApps
$CbCortana = New-CheckBox -Text "Enable Cortana" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbClipboardHistory
$CbOldVolumeControl = New-CheckBox -Text "Enable Old Volume Control" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbCortana
$CbEncryptedDNS = New-CheckBox -Text "Enable Encrypted DNS" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbCortana
$CbOldVolumeControl = New-CheckBox -Text "Enable Old Volume Control" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbEncryptedDNS
$CbPhotoViewer = New-CheckBox -Text "Enable Photo Viewer" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbOldVolumeControl
$CbSearchIdx = New-CheckBox -Text "Enable WSearch Service" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbPhotoViewer
$CbTelemetry = New-CheckBox -Text "Enable Telemetry" -Width $PanelElementWidth -Height $CheckBoxHeight -LocationX $PanelElementX -ElementBefore $CbSearchIdx
Expand Down Expand Up @@ -309,9 +311,9 @@ function Show-GUI() {
$TabSystemTweaks.Controls.AddRange(@($TlSystemTweaks, $ClSystemTweaks, $T1Panel1, $T1Panel2))
$TabSoftwareInstall.Controls.AddRange(@($TlSoftwareInstall, $ClSoftwareInstall, $T2Panel1, $T2Panel2, $T2Panel3, $T2Panel4))
# Add Elements to each Tab Panel
$T1Panel1.Controls.AddRange(@($ClDebloatTools, $ApplyTweaks, $UndoTweaks, $RemoveXbox, $InstallOneDrive, $ReinstallBloatApps, $RepairWindows, $ShowDebloatInfo, $PictureBox1))
$T1Panel1.Controls.AddRange(@($ClDebloatTools, $ApplyTweaks, $UndoTweaks, $RemoveOneDrive, $RemoveXbox, $InstallOneDrive, $ReinstallBloatApps, $RepairWindows, $ShowDebloatInfo, $PictureBox1))
$T1Panel2.Controls.AddRange(@($ClCustomizeFeatures))
$T1Panel2.Controls.AddRange(@($CbDarkTheme, $CbActivityHistory, $CbBackgroundsApps, $CbClipboardHistory, $CbCortana, $CbOldVolumeControl, $CbPhotoViewer, $CbSearchIdx, $CbTelemetry, $CbXboxGameBarAndDVR))
$T1Panel2.Controls.AddRange(@($CbDarkTheme, $CbActivityHistory, $CbBackgroundsApps, $CbClipboardHistory, $CbCortana, $CbEncryptedDNS, $CbOldVolumeControl, $CbPhotoViewer, $CbSearchIdx, $CbTelemetry, $CbXboxGameBarAndDVR))
$T1Panel2.Controls.AddRange(@($ClMiscFeatures, $HEVCSupport, $CbGodMode, $CbTakeOwnership, $CbShutdownPCShortcut))

$T2Panel1.Controls.AddRange(@($UpgradeAll))
Expand Down Expand Up @@ -357,7 +359,6 @@ function Show-GUI() {
"optimize-performance.ps1",
"personal-tweaks.ps1",
"optimize-security.ps1",
"remove-onedrive.ps1",
"optimize-windows-features.ps1"
)

Expand All @@ -382,6 +383,12 @@ function Show-GUI() {
$Global:Revert = $false
})

$RemoveOneDrive.Add_Click( {
Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts @("remove-onedrive.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage
$PictureBox1.imageLocation = "$PSScriptRoot\src\assets\script-logo2.png"
$Form.Update()
})

$RemoveXbox.Add_Click( {
Open-PowerShellFilesCollection -RelativeLocation "src\scripts" -Scripts @("remove-xbox.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage
$PictureBox1.imageLocation = "$PSScriptRoot\src\assets\script-logo2.png"
Expand All @@ -407,10 +414,10 @@ function Show-GUI() {
$CbDarkTheme.Add_Click( {
If ($CbDarkTheme.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("use-dark-theme.reg") -NoDialog
$CbDarkTheme.Text = "[ON] Use Dark Theme"
$CbDarkTheme.Text = "[ON] Dark Theme"
} Else {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("use-light-theme.reg") -NoDialog
$CbDarkTheme.Text = "[OFF] Use Dark Theme *"
$CbDarkTheme.Text = "[OFF] Dark Theme *"
}
})

Expand Down Expand Up @@ -454,6 +461,16 @@ function Show-GUI() {
}
})

$CbEncryptedDNS.Add_Click( {
If ($CbEncryptedDNS.CheckState -eq "Checked") {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-encrypted-dns-doh.ps1") -NoDialog
$CbEncryptedDNS.Text = "[ON] Encrypted DNS"
} Else {
Open-PowerShellFilesCollection -RelativeLocation "src\utils" -Scripts @("disable-encrypted-dns-doh.ps1") -NoDialog
$CbEncryptedDNS.Text = "[OFF] Encrypted DNS *"
}
})

$CbOldVolumeControl.Add_Click( {
If ($CbOldVolumeControl.CheckState -eq "Checked") {
Open-RegFilesCollection -RelativeLocation "src\utils" -Scripts @("enable-old-volume-control.reg") -NoDialog
Expand Down
Binary file modified src/assets/script-gui.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions src/scripts/personal-tweaks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,6 @@ function Register-PersonalTweaksList() {
Write-Status -Types $EnableStatus[1].Symbol, $TweakType -Status "$($EnableStatus[1].Status) Error reporting..."
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting" -Name "Disabled" -Type DWord -Value $Zero

# Adapted from: https://techcommunity.microsoft.com/t5/networking-blog/windows-insiders-gain-new-dns-over-https-controls/ba-p/2494644
Write-Status -Types "+", $TweakType -Status "Setting up the DNS over HTTPS for Google and Cloudflare (ipv4 and ipv6)..."
Set-DnsClientDohServerAddress -ServerAddress ("8.8.8.8", "8.8.4.4", "2001:4860:4860::8888", "2001:4860:4860::8844") -AutoUpgrade $true -AllowFallbackToUdp $true
Set-DnsClientDohServerAddress -ServerAddress ("1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001") -AutoUpgrade $true -AllowFallbackToUdp $true

Write-Status -Types "+", $TweakType -Status "Setting up the DNS from Cloudflare and Google (ipv4 and ipv6)..."
#Get-DnsClientServerAddress # To look up the current config. # Cloudflare, Google, Cloudflare, Google
Set-DNSClientServerAddress -InterfaceAlias "Ethernet*" -ServerAddresses ("1.1.1.1", "8.8.8.8", "2606:4700:4700::1111", "2001:4860:4860::8888")
Set-DNSClientServerAddress -InterfaceAlias "Wi-Fi*" -ServerAddresses ("1.1.1.1", "8.8.8.8", "2606:4700:4700::1111", "2001:4860:4860::8888")

Write-Status -Types "+", $TweakType -Status "Bringing back F8 alternative Boot Modes..."
bcdedit /set `{current`} bootmenupolicy Legacy

Expand Down
10 changes: 10 additions & 0 deletions src/utils/disable-encrypted-dns-doh.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"

function Disable-EncryptedDNS() {
# Adapted from: https://stackoverflow.com/questions/64465089/powershell-cmdlet-to-remove-a-statically-configured-dns-addresses-from-a-network
Write-Status -Types "+" -Status "Resetting DNS server configs..."
Set-DnsClientServerAddress -InterfaceAlias "Ethernet*" -ResetServerAddresses
Set-DnsClientServerAddress -InterfaceAlias "Wi-Fi*" -ResetServerAddresses
}

Disable-EncryptedDNS
15 changes: 15 additions & 0 deletions src/utils/enable-encrypted-dns-doh.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Import-Module -DisableNameChecking $PSScriptRoot\..\lib\"title-templates.psm1"

function Enable-EncryptedDNS() {
# Adapted from: https://techcommunity.microsoft.com/t5/networking-blog/windows-insiders-gain-new-dns-over-https-controls/ba-p/2494644
Write-Status -Types "+" -Status "Setting up the DNS over HTTPS for Google and Cloudflare (ipv4 and ipv6)..."
Set-DnsClientDohServerAddress -ServerAddress ("8.8.8.8", "8.8.4.4", "2001:4860:4860::8888", "2001:4860:4860::8844") -AutoUpgrade $true -AllowFallbackToUdp $true
Set-DnsClientDohServerAddress -ServerAddress ("1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001") -AutoUpgrade $true -AllowFallbackToUdp $true

Write-Status -Types "+" -Status "Setting up the DNS from Cloudflare and Google (ipv4 and ipv6)..."
#Get-DnsClientServerAddress # To look up the current config. # Cloudflare, Google, Cloudflare, Google
Set-DNSClientServerAddress -InterfaceAlias "Ethernet*" -ServerAddresses ("1.1.1.1", "8.8.8.8", "2606:4700:4700::1111", "2001:4860:4860::8888")
Set-DNSClientServerAddress -InterfaceAlias "Wi-Fi*" -ServerAddresses ("1.1.1.1", "8.8.8.8", "2606:4700:4700::1111", "2001:4860:4860::8888")
}

Enable-EncryptedDNS

0 comments on commit 013c96c

Please sign in to comment.