14 Commits

Author SHA1 Message Date
edfc168cab chore: release v1.0.29
Some checks failed
Release Build / build-and-release (push) Failing after 7s
2026-01-13 15:24:11 +01:00
1a82bdfd46 chore: release v1.0.28
Some checks failed
Release Build / build-and-release (push) Failing after 6s
2026-01-13 15:21:27 +01:00
cd881150dd Added READM 2026-01-12 21:57:15 +01:00
82bee90c3d Added Gitea actions 2026-01-12 17:35:35 +01:00
64353d3394 chore: release v1.0.27 2025-12-22 17:42:42 +01:00
b6957b8118 feat: add option to force delete registry key if uninstall fails 2025-12-22 17:42:38 +01:00
d31342390e chore: release v1.0.26 2025-12-22 17:38:26 +01:00
9a2b794df6 fix: resolve syntax error in bulk uninstall loop 2025-12-22 17:38:22 +01:00
9d47755cfa chore: release v1.0.25 2025-12-22 17:34:26 +01:00
1eb64bb120 feat: add known Epson GUIDs to removal list 2025-12-22 17:34:22 +01:00
9652a98e3e docs: add get_guids.txt with powershell command for finding GUIDs 2025-12-22 17:30:31 +01:00
adeef97796 feat: add GetGUIDApp.ps1 utility to help find software GUIDs 2025-12-22 17:28:45 +01:00
4486465b67 chore: release v1.0.24 2025-12-22 17:27:31 +01:00
fd285f2cf4 feat: add support for targeting software by known GUIDs 2025-12-22 17:27:27 +01:00
7 changed files with 188 additions and 10 deletions

View File

@@ -0,0 +1,65 @@
name: Release Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Get Version
id: get_version
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
else
VERSION="0.0.0-dev"
fi
echo "Detected Version: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Update Version in Files
run: |
echo "Updating version in PrintCleaner.manifest to ${VERSION}.0"
# Update Manifest (Format: 1.0.0.0)
sed -i "s/version=\"[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*\"/version=\"${VERSION}.0\"/" PrintCleaner.manifest
echo "Updating version in PrintCleaner.ps1 to ${VERSION}"
# Update PowerShell Script
sed -i "s/\$AppVersion = \"0.0.0\"/\$AppVersion = \"${VERSION}\"/" PrintCleaner.ps1
- name: Generate Resources (Icon & Manifest)
run: |
# Install rsrc dependency if not present (handled by go.mod, but go run ensures it)
go run github.com/akavel/rsrc -manifest PrintCleaner.manifest -ico icon.ico -arch amd64 -o rsrc.syso
- name: Build
run: |
output_name="PrintCleaner_v${VERSION}.exe"
echo "Building $output_name..."
GOOS=windows GOARCH=amd64 go build -o "$output_name" main.go
echo "ARTIFACT_NAME=$output_name" >> $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.ARTIFACT_NAME }}
draft: false
prerelease: false
generate_release_notes: true

View File

@@ -3,7 +3,7 @@
<assemblyIdentity <assemblyIdentity
type="win32" type="win32"
name="PrintCleaner.App" name="PrintCleaner.App"
version="1.0.23.0" version="1.0.29.0"
processorArchitecture="amd64" processorArchitecture="amd64"
/> />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">

View File

@@ -241,6 +241,13 @@ function Invoke-UninstallSoftware {
# Common printer brands/keywords # Common printer brands/keywords
$brands = @("HP", "Hewlett-Packard", "Canon", "Epson", "Brother", "Xerox", "Kyocera", "Ricoh", "Lexmark", "Konica", "Samsung", "Oki", "Zebra", "Dymo", "Dell") $brands = @("HP", "Hewlett-Packard", "Canon", "Epson", "Brother", "Xerox", "Kyocera", "Ricoh", "Lexmark", "Konica", "Samsung", "Oki", "Zebra", "Dymo", "Dell")
# Internal Registry of Known Printer App GUIDs (for apps not detected by name)
# Format: "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}"
$knownGuids = @(
"{DB5EDF09-A7A7-47FA-B365-A7500A472878}", # EpsonNet Print
"{3361D415-BA35-4143-B301-661991BA6219}" # MyEpson Portal
)
$allSoftware = Get-InstalledSoftware $allSoftware = Get-InstalledSoftware
# Use ArrayList to avoid type issues # Use ArrayList to avoid type issues
@@ -249,13 +256,27 @@ function Invoke-UninstallSoftware {
# Filter software list # Filter software list
foreach ($sw in $allSoftware) { foreach ($sw in $allSoftware) {
$isMatch = $false
# Check 1: Brand Keywords
foreach ($brand in $brands) { foreach ($brand in $brands) {
if ($sw.DisplayName -match "(?i)\b$brand\b") { # Case insensitive regex match if ($sw.DisplayName -match "(?i)\b$brand\b") {
# This -match operator was overwriting the old $matches variable! $isMatch = $true
[void]$foundSoftware.Add($sw)
break break
} }
} }
# Check 2: Known GUIDs
if (-not $isMatch) {
if ($knownGuids -contains $sw.RegistryKeyName) {
$isMatch = $true
Write-Host " [+] Found by GUID: $($sw.DisplayName)" -ForegroundColor Cyan
}
}
if ($isMatch) {
[void]$foundSoftware.Add($sw)
}
} }
if ($foundSoftware.Count -eq 0) { if ($foundSoftware.Count -eq 0) {
@@ -352,10 +373,20 @@ function Invoke-UninstallSoftware {
Write-Host " [!] Error launching: $($_.Exception.Message)" -ForegroundColor Red Write-Host " [!] Error launching: $($_.Exception.Message)" -ForegroundColor Red
} }
Write-Host " (Press ENTER to continue to next app...)" -ForegroundColor DarkGray Write-Host " (Press ENTER to continue, or 'F' to Force Delete Registry Key...)" -ForegroundColor Yellow
[void](Read-Host) $uInput = Read-Host
if ($uInput -match "^[Ff]$") {
Write-Host " [-] Removing Registry Key: $($app.RegPath)" -ForegroundColor Red
try {
Remove-Item -Path $app.RegPath -Recurse -Force -ErrorAction Stop
Write-Host " Registry entry removed." -ForegroundColor Green
} catch {
Write-Host " [!] Failed to remove registry key: $($_.Exception.Message)" -ForegroundColor Red
} }
Write-Progress -Activity "Uninstalling Software" -Completed Write-Host "`nDone processing list." -ForegroundColor Green }
}
Write-Progress -Activity "Uninstalling Software" -Completed
Write-Host "`nDone processing list." -ForegroundColor Green
Wait-Key Wait-Key
return return
} }
@@ -414,11 +445,23 @@ function Invoke-UninstallSoftware {
} catch { } catch {
Write-Host "Error launching uninstaller: $($_.Exception.Message)" -ForegroundColor Red Write-Host "Error launching uninstaller: $($_.Exception.Message)" -ForegroundColor Red
} }
Write-Host "Done." -ForegroundColor Green
Write-Host "`nPress 'F' to Force Delete Registry Key, or any key to continue..." -ForegroundColor Yellow
$k = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
if ($k.Character -match "[Ff]") {
Write-Host " [-] Removing Registry Key: $($app.RegPath)" -ForegroundColor Red
try {
Remove-Item -Path $app.RegPath -Recurse -Force -ErrorAction Stop
Write-Host " Registry entry removed." -ForegroundColor Green
Start-Sleep -Seconds 1
} catch {
Write-Host " [!] Failed to remove registry key: $($_.Exception.Message)" -ForegroundColor Red
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
} }
} }
} }
}
}
# --- Main Loop --- # --- Main Loop ---

1
README.md Normal file
View File

@@ -0,0 +1 @@
# PrintCleaner

View File

@@ -1 +1 @@
1.0.23 1.0.29

56
utils/GetGUIDApp.ps1 Normal file
View File

@@ -0,0 +1,56 @@
<#
.SYNOPSIS
Lists installed software and their GUIDs/Registry Keys.
.DESCRIPTION
This script scans the Windows Registry (HKLM and WOW6432Node) for installed applications
and outputs their Display Name and Registry Key Name (which is often the MSI GUID).
Useful for finding the GUID of software to target for uninstallation.
.PARAMETER Filter
Optional string to filter the results by Display Name.
.EXAMPLE
.\GetGUIDApp.ps1
Lists all installed software in a grid view.
.EXAMPLE
.\GetGUIDApp.ps1 -Filter "Printer"
Lists only software with "Printer" in the name.
#>
param (
[string]$Filter = ""
)
$paths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
Write-Host "Scanning Registry for Installed Software..." -ForegroundColor Cyan
$results = @()
foreach ($path in $paths) {
$items = Get-ItemProperty $path -ErrorAction SilentlyContinue
foreach ($item in $items) {
if (-not [string]::IsNullOrWhiteSpace($item.DisplayName)) {
$results += [PSCustomObject]@{
DisplayName = $item.DisplayName
RegistryKeyName = $item.PSChildName # This is the GUID for MSI apps
UninstallString = $item.UninstallString
}
}
}
}
if (-not [string]::IsNullOrWhiteSpace($Filter)) {
Write-Host "Filtering for: '$Filter'" -ForegroundColor Yellow
$results = $results | Where-Object { $_.DisplayName -match "(?i)$Filter" }
}
$results | Sort-Object DisplayName | Out-GridView -Title "Installed Software (Select to see details)"
Write-Host "Done. Check the Grid View window." -ForegroundColor Green

13
utils/get_guids.txt Normal file
View File

@@ -0,0 +1,13 @@
# PowerShell command to list installed software and their Registry Key Names (often GUIDs).
# Run this command in a PowerShell window on your Windows machine.
#
# To filter the results, you can use the 'Filter' parameter, e.g., Filter "HP"
#
# Example:
# To get all software:
# Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Select-Object DisplayName, PSChildName | Sort-Object DisplayName | Out-GridView
#
# To filter by a keyword (e.g., "Printer"):
# Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Where-Object { $_.DisplayName -match "Printer" } | Select-Object DisplayName, PSChildName | Sort-Object DisplayName | Out-GridView
#
Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall | Get-ItemProperty | Select-Object DisplayName, PSChildName | Sort-Object DisplayName | Out-GridView