Compare commits
21 Commits
5f822cc9b5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 04065a0dd1 | |||
| 47628638e2 | |||
| 39dfbfc618 | |||
| 63bb8f463d | |||
| e393fc5b6b | |||
| 57eb55cb23 | |||
| 1cdfffa4f8 | |||
| edfc168cab | |||
| 1a82bdfd46 | |||
| cd881150dd | |||
| 82bee90c3d | |||
| 64353d3394 | |||
| b6957b8118 | |||
| d31342390e | |||
| 9a2b794df6 | |||
| 9d47755cfa | |||
| 1eb64bb120 | |||
| 9652a98e3e | |||
| adeef97796 | |||
| 4486465b67 | |||
| fd285f2cf4 |
51
.github/workflows/release.yml
vendored
51
.github/workflows/release.yml
vendored
@@ -56,10 +56,49 @@ jobs:
|
|||||||
echo "ARTIFACT_NAME=$output_name" >> $GITHUB_ENV
|
echo "ARTIFACT_NAME=$output_name" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
with:
|
env:
|
||||||
files: ${{ env.ARTIFACT_NAME }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
draft: false
|
run: |
|
||||||
prerelease: false
|
# Define Variables
|
||||||
generate_release_notes: true
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||||
|
API_URL="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases"
|
||||||
|
FILE_NAME="${{ env.ARTIFACT_NAME }}"
|
||||||
|
|
||||||
|
echo "Creating release for $TAG_NAME on Gitea..."
|
||||||
|
|
||||||
|
# 1. Create Release
|
||||||
|
RESPONSE=$(curl -s -X POST "$API_URL" \
|
||||||
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"$TAG_NAME\",
|
||||||
|
\"name\": \"$TAG_NAME\",
|
||||||
|
\"body\": \"Automated release for $TAG_NAME\",
|
||||||
|
\"draft\": false,
|
||||||
|
\"prerelease\": false
|
||||||
|
}")
|
||||||
|
|
||||||
|
# Extract Release ID (simple grep fallback)
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id": *[0-9]*' | head -1 | grep -o '[0-9]*')
|
||||||
|
|
||||||
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
|
echo "Error: Failed to create release. API Response:"
|
||||||
|
echo "$RESPONSE"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Release created with ID: $RELEASE_ID"
|
||||||
|
|
||||||
|
# 2. Upload Asset
|
||||||
|
# Gitea API: POST /repos/{owner}/{repo}/releases/{id}/assets
|
||||||
|
UPLOAD_URL="${API_URL}/${RELEASE_ID}/assets"
|
||||||
|
|
||||||
|
echo "Uploading artifact: $FILE_NAME to $UPLOAD_URL"
|
||||||
|
|
||||||
|
curl -f -X POST "$UPLOAD_URL?name=$FILE_NAME" \
|
||||||
|
-H "Authorization: token $GITHUB_TOKEN" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary "@$FILE_NAME"
|
||||||
|
|
||||||
|
echo "Asset uploaded successfully."
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<assemblyIdentity
|
<assemblyIdentity
|
||||||
type="win32"
|
type="win32"
|
||||||
name="PrintCleaner.App"
|
name="PrintCleaner.App"
|
||||||
version="1.0.23.0"
|
version="1.0.35.0"
|
||||||
processorArchitecture="amd64"
|
processorArchitecture="amd64"
|
||||||
/>
|
/>
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
|
|||||||
@@ -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,10 +445,22 @@ 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 ---
|
||||||
|
|||||||
56
utils/GetGUIDApp.ps1
Normal file
56
utils/GetGUIDApp.ps1
Normal 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
13
utils/get_guids.txt
Normal 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
|
||||||
Reference in New Issue
Block a user