Skip to content

Commit

Permalink
Keep only the main branch (#183)
Browse files Browse the repository at this point in the history
* Change resolution check to use the primary monitor's working area. (#168)

Fixes oversized windows on multiple monitor setups when using dpi scaling.

* Use Pascal Casing inside Get-CurrentResolution.psm1
- Remove unused variable $bounds

* Fix ArchWSL cert install
- No manual steps required

* Fix GPG signing key when a key already exists for git config

* Stop logging before using the GPG/SSH setup

* Fix Java EclipseAdoptium JDK installation

* Remove Outlook app

* fix: revert Stand by time when plugged in to 30 minutes

* docs: Add section to import all modules in the terminal

* refactor: Remove unneeded Windows Optional Features (#180)
- NET Framework 3.5
- NET Framework 4.x + ASPNET 4.x

* docs: Prepare to use main branch only
- Set the Architecture as a requirement

---------

Co-authored-by: Haxy <[email protected]>
  • Loading branch information
LeDragoX and clienthax committed Sep 8, 2024
1 parent 5fe5fc9 commit 96e90aa
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 35 deletions.
13 changes: 8 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Warning**: this file is subject to changing without notice.

I would be happy to extend the collection of scripts.
If you want to send me a **PULL REQUEST**, send you PRs to the `develop` branch, select your `local branch (from)` and put into `develop`, i'll check your code, request changes if necessary or approve, and merge directly unless it's a "Draft PR".
If you want to send me a **PULL REQUEST**, send you PRs to the `main` branch, I'll check your code, request changes if necessary or approve, and merge directly unless it's a "Draft PR".

## 🖌 Coding Style

Expand Down Expand Up @@ -51,13 +51,16 @@ Follow at least the minimal required to help.
### Via HTTPS

```sh
git clone -b develop --filter=tree:0 https://github.com/LeDragoX/Win-Debloat-Tools.git
git clone --filter=tree:0 https://github.com/LeDragoX/Win-Debloat-Tools.git
```

### Or SSH
## 👾 Debugging with all modules

```sh
git clone -b develop --filter=tree:0 [email protected]:LeDragoX/Win-Debloat-Tools.git
On VSCode the modules seems to not load all the divergent variables and functions dynamically, to fix that, all modules should be imported manually:

```ps1
Get-Item .\src\lib\*.psm1 | Import-Module -PassThru -Force
Get-Item .\src\lib\**\*.psm1 | Import-Module -PassThru -Force
```

## 🔎 How to find specific Tweaks? (One method)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ I need to change these files:
## 🚀 Download Latest Version

Code located in the `main` branch is considered stable, the `develop` branch contains the most recent features.
Code located in the `main` branch is considered bleeding-edge, but big features/reworks will be implemented in a separate branch.

> [!IMPORTANT]
> *Use on a fresh Windows install to notice the differences. Using an admin account is recommended to avoid any compatibility issues.*
Expand All @@ -42,22 +42,22 @@ Code located in the `main` branch is considered stable, the `develop` branch con
<th>Branch to Download</th>
<th>Version(s) Supported</th>
<th>Edition(s)</th>
<th>Architecture</th>
<th>PowerShell Version</th>
</tr>
</thead>
<tbody align="center">
<tr>
<td>
<h4><a href="https://github.com/LeDragoX/Win-Debloat-Tools/archive/main.zip">⬇️ Main</a></h4>(Stable)
<h4><a href="https://github.com/LeDragoX/Win-Debloat-Tools/archive/main.zip">⬇️ Main</a></h4>(Current)
</td>
<td rowspan="2">23H2 or Older</td>
<td rowspan="2">Home / Pro</td>
<td rowspan="2"><img width=20px src="src/assets/powershell-icon.png" style="vertical-align: bottom" /> v5.1+</td>
</tr>
<tr>
<td>
<h4><a href="https://github.com/LeDragoX/Win-Debloat-Tools/archive/develop.zip">⬇️ Develop</a></h4>(Newer)
<td rowspan="2">
x86/x64 ONLY<br>
ARM/ARM64 will break your installation (<a href="https://github.com/LeDragoX/Win-Debloat-Tools/issues/97">#97</a>)
</td>
<td rowspan="2"><img width=20px src="src/assets/powershell-icon.png" style="vertical-align: bottom" /> v5.1+</td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 3 additions & 1 deletion WinDebloatTools.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1544,7 +1544,9 @@ function Show-GUI() {

If ($InstallGitGnupgSshSetup.CheckState -eq "Checked") {
If (!($Script:UninstallSwitch)) {
Stop-Logging # Don't log any credential info after this point
Open-PowerShellFilesCollection -RelativeLocation "src\scripts\other-scripts" -Scripts @("Git-GnupgSshKeysSetup.ps1") -DoneTitle $DoneTitle -DoneMessage $DoneMessage
Start-Logging -File "$CurrentFileName-$(Get-Date -Format "yyyy-MM")"
} Else {
$AppsSelected.WingetApps.AddRange(@("Git.Git", "GnuPG.GnuPG")) # Installed before inside the script
}
Expand Down Expand Up @@ -1572,7 +1574,7 @@ function Show-GUI() {
}

If ($InstallJavaJdks.CheckState -eq "Checked") {
$AppsSelected.WingetApps.AddRange(@("EclipseAdoptium.Temurin.8", "EclipseAdoptium.Temurin.11", "EclipseAdoptium.Temurin.18"))
$AppsSelected.WingetApps.AddRange(@("EclipseAdoptium.Temurin.8.JDK", "EclipseAdoptium.Temurin.11.JDK", "EclipseAdoptium.Temurin.18.JDK"))
$InstallJavaJdks.CheckState = "Unchecked"
}

Expand Down
8 changes: 0 additions & 8 deletions src/scripts/Optimize-WindowsFeaturesList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ function Optimize-WindowsFeaturesList() {
"WorkFolders-Client" # Work Folders Client
)

$EnableFeatures = @(
"NetFx3" # NET Framework 3.5
"NetFx4Extended-ASPNET45" # NET Framework 4.x + ASPNET 4.x
)

Write-Title "Optional Features Tweaks"
Write-Section "Uninstall Optional Features from Windows"

Expand All @@ -36,9 +31,6 @@ function Optimize-WindowsFeaturesList() {
} Else {
Set-OptionalFeatureState -State 'Disabled' -OptionalFeatures $DisableFeatures
}

Write-Section "Install Optional Features from Windows"
Set-OptionalFeatureState -State 'Enabled' -OptionalFeatures $EnableFeatures
}

# List all Optional Features:
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/Register-PersonalTweaksList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function Register-PersonalTweaksList() {
$TimeoutScreenPluggedIn = 10

$TimeoutStandByBattery = 15
$TimeoutStandByPluggedIn = 180
$TimeoutStandByPluggedIn = 30

$TimeoutDiskBattery = 20
$TimeoutDiskPluggedIn = 30
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/Remove-BloatwareAppsList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ function Remove-BloatwareAppsList() {

# Default Windows 11 apps
"Clipchamp.Clipchamp" # Clipchamp – Video Editor
"Microsoft.OutlookForWindows" # Microsoft Outlook
"MicrosoftTeams" # Microsoft Teams
"MicrosoftWindows.Client.WebExperience" # Taskbar Widgets
"MicrosoftTeams" # Microsoft Teams / Preview

# [DIY] Remove the # to Uninstall

Expand Down
17 changes: 9 additions & 8 deletions src/scripts/other-scripts/Git-GnupgSshKeysSetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ function Set-GPGKey() {
Write-Host "Before exporting your public and private keys, add manually an email." -ForegroundColor Cyan
Write-Host "Type: 1 (RSA and RSA) [ENTER]." -ForegroundColor Cyan
Write-Host "Type: 4096 [ENTER]." -ForegroundColor Cyan
Write-Host "Then: 0 (does not expire at all) [ENTER]." -ForegroundColor Cyan
Write-Host "Then: 0 (does not expire at all) or `"10y`" [ENTER]." -ForegroundColor Cyan
Write-Host "Then: y [ENTER]." -ForegroundColor Cyan
Write-Host "Then: $(git config --global user.name) [ENTER]." -ForegroundColor Cyan
Write-Host "Then: $(git config --global user.email) [ENTER]" -ForegroundColor Cyan
Write-Host "Then: Anything you want (e.g. git keys) [ENTER]." -ForegroundColor Cyan
Write-Host "Then: Anything you want (e.g. Git Keys) [ENTER]." -ForegroundColor Cyan
Write-Host "Then: O (Ok) [ENTER]." -ForegroundColor Cyan
Write-Host "Then: [your passphrase] [ENTER]." -ForegroundColor Cyan
Write-Host "Then: [your passphrase again] [ENTER]." -ForegroundColor Cyan
Expand All @@ -160,7 +160,7 @@ function Set-GPGKey() {
Write-Status -Types "@" -Status 'gpg --delete-keys $(git config --global user.name)'

Write-Host "Copying all files to $GnuPGPath"
Copy-Item -Path "$GnuPGGeneratePath/*" -Destination "$GnuPGPath/" -Recurse
Copy-Item -Path "$GnuPGGeneratePath/*" -Destination "$GnuPGPath/" -Recurse -Force
Remove-ItemVerified -Path "$GnuPGPath/*" -Exclude "*.gpg", "*.key", "*.pub", "*.rev" -Recurse
Remove-ItemVerified -Path "$GnuPGPath/trustdb.gpg"

Expand All @@ -169,12 +169,13 @@ function Set-GPGKey() {
gpg --output "$($GnuPGFileName)_secret.gpg" --armor --export-secret-key "$(git config --global user.email)"

# Get the exact Key ID from the system
$key_id = $((gpg --list-keys --keyid-format LONG).Split(" ")[5].Split("/")[1])
$KeyId = $((gpg --list-keys --keyid-format LONG).Split(" ")[5].Split("/")[1])
$CurrentGPGKey = $(git config --global user.signingkey)

If (!(($key_id -eq "") -or ($null -eq $key_id))) {
Write-Host "GPG Key id found: $key_id."
If (($KeyId -eq "") -or ($null -eq $KeyId) -or ($KeyId -ne $CurrentGPGKey)) {
Write-Host "GPG Key id found: $KeyId."
Write-Host "Registering the GPG Key ID to git user..."
git config --global user.signingkey "$key_id"
git config --global user.signingkey "$KeyId"
Write-Host "Your user.signingkey on git is: $(git config --global user.signingkey)"

Write-Host "Enabling commit.gpgsign on git..."
Expand All @@ -183,7 +184,7 @@ function Set-GPGKey() {
Write-Host "Copy and Paste the lines below on your`nGithub/Gitlab > Settings > SSH and GPG Keys > New GPG Key"
Get-Content -Path "$GnuPGPath/$($GnuPGFileName)_public.gpg" -Encoding UTF8
} Else {
Write-Host "Failed to retrieve your key_id: $key_id"
Write-Host "Failed to retrieve your key_id: $KeyId"
}

Write-Host "Importing your key on $GnuPGPath\$($GnuPGFileName)_public.gpg and $($GnuPGFileName)_secret.gpg"
Expand Down
5 changes: 1 addition & 4 deletions src/scripts/other-scripts/Install-ArchWSL.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ function Install-ArchWSL() {
If ($OSArch -like "x64") {
$CertOutput = Get-APIFile -URI "https://api.github.com/repos/yuk7/ArchWSL/releases/latest" -ObjectProperty "assets" -FileNameLike "ArchWSL-AppX_*_$OSArch.cer" -PropertyValue "browser_download_url" -OutputFile "ArchWSL.cer"
Write-Status -Types "+" -Status "Installing ArchWSL Certificate ($OSArch)..."
Import-Certificate -FilePath $CertOutput -CertStoreLocation Cert:\LocalMachine\Root | Out-Host
Write-Status -Types "?" -Status "The certificate needs to be installed manually, the cmdlet didn't work for some reason..." -Warning
Write-Status -Types "@" -Status "Steps: Install Certificate... (Next) > Select Local Machine (Next) > Next > Finish > OK" -Warning
Start-Process -FilePath "$CertOutput" -Wait
certutil.exe -addstore "Root" $CertOutput | Out-Host
$ArchWSLOutput = Get-APIFile -URI "https://api.github.com/repos/yuk7/ArchWSL/releases/latest" -ObjectProperty "assets" -FileNameLike "ArchWSL-AppX_*_$OSArch.appx" -PropertyValue "browser_download_url" -OutputFile "ArchWSL.appx"
Write-Status -Types "+" -Status "Installing ArchWSL ($OSArch)..."
Add-AppxPackage -Path $ArchWSLOutput
Expand Down

0 comments on commit 96e90aa

Please sign in to comment.