🎨 LDUninstaller-v2.5.0 — Yeni Logo ve Baslangic Yoneticisi Guncellemesi
This commit is contained in:
parent
9b3061444f
commit
f062d00475
16 changed files with 294 additions and 116 deletions
|
|
@ -1,8 +1,8 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>2.4.0</Version>
|
||||
<AssemblyVersion>2.4.0.0</AssemblyVersion>
|
||||
<FileVersion>2.4.0.0</FileVersion>
|
||||
<Version>2.5.0</Version>
|
||||
<AssemblyVersion>2.5.0.0</AssemblyVersion>
|
||||
<FileVersion>2.5.0.0</FileVersion>
|
||||
<Product>LD Uninstaller</Product>
|
||||
<Company>LD Software</Company>
|
||||
<Authors>LD Software</Authors>
|
||||
|
|
|
|||
BIN
app.ico
Normal file
BIN
app.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 187 KiB |
BIN
logo.png
Normal file
BIN
logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
84
release.ps1
84
release.ps1
|
|
@ -34,7 +34,7 @@ switch ($Type.ToLowerInvariant()) {
|
|||
$patch += 1
|
||||
}
|
||||
"current" {
|
||||
# Keep existing version for initial packaging
|
||||
# Keep existing version
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,13 +62,13 @@ $propsContent = @"
|
|||
Set-Content -Path $propsFile -Value $propsContent -Encoding UTF8
|
||||
|
||||
Write-Host "==========================================" -ForegroundColor Cyan
|
||||
Write-Host " LD UNINSTALLER SÜRÜM YAYINLAMA: v$newVersion" -ForegroundColor Yellow
|
||||
Write-Host " LD UNINSTALLER SURUM YAYINLAMA: v$newVersion" -ForegroundColor Yellow
|
||||
Write-Host "==========================================" -ForegroundColor Cyan
|
||||
|
||||
# 1. Ana klasörde eski sürümleri temizle (Sadece tek ve son sürüm kalacak şekilde)
|
||||
# 1. Ana klasorde eski surumleri temizle
|
||||
$oldFolders = Get-ChildItem -Path $root -Directory -Filter "LD Uninstaller v*"
|
||||
foreach ($old in $oldFolders) {
|
||||
Write-Host "Eski sürüm klasörü temizleniyor: $($old.Name)..." -ForegroundColor Gray
|
||||
Write-Host "Eski surum klasoru temizleniyor: $($old.Name)..." -ForegroundColor Gray
|
||||
try {
|
||||
Remove-Item -Path $old.FullName -Recurse -Force -ErrorAction SilentlyContinue
|
||||
} catch { }
|
||||
|
|
@ -77,11 +77,11 @@ foreach ($old in $oldFolders) {
|
|||
$targetFolderName = "LD Uninstaller v$newVersion"
|
||||
$targetDir = Join-Path $root $targetFolderName
|
||||
|
||||
Write-Host "Yeni sürüm klasörü oluşturuluyor: $targetFolderName..." -ForegroundColor Green
|
||||
Write-Host "Yeni surum klasoru olusturuluyor: $targetFolderName..." -ForegroundColor Green
|
||||
New-Item -ItemType Directory -Path $targetDir -Force | Out-Null
|
||||
|
||||
# 2. Projeleri Release modunda derle ve tek klasöre aktar
|
||||
Write-Host "Projeler derleniyor ve yayınlanıyor..." -ForegroundColor Cyan
|
||||
# 2. Projeleri Release modunda derle ve yayinla
|
||||
Write-Host "Projeler derleniyor ve yayinlaniyor..." -ForegroundColor Cyan
|
||||
|
||||
$projects = @(
|
||||
"src/LDUninstaller.UI/LDUninstaller.UI.csproj",
|
||||
|
|
@ -92,18 +92,18 @@ $projects = @(
|
|||
|
||||
foreach ($proj in $projects) {
|
||||
$projPath = Join-Path $root $proj
|
||||
Write-Host " -> Yayınlanıyor: $proj" -ForegroundColor Gray
|
||||
Write-Host " -> Yayinlaniyor: $proj" -ForegroundColor Gray
|
||||
dotnet publish $projPath -c Release -o $targetDir --nologo -v q
|
||||
}
|
||||
|
||||
# 3. Gereksiz pdb ve log dosyalarını temizle
|
||||
# 3. Gereksiz pdb ve log dosyalarini temizle
|
||||
Get-ChildItem -Path $targetDir -Filter "*.pdb" | Remove-Item -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# 4. Eski publish ve dist klasörlerini de temizle
|
||||
# 4. Eski publish ve dist klasorlerini de temizle
|
||||
try { Remove-Item -Path (Join-Path $root "publish") -Recurse -Force -ErrorAction SilentlyContinue } catch { }
|
||||
try { Remove-Item -Path (Join-Path $root "dist") -Recurse -Force -ErrorAction SilentlyContinue } catch { }
|
||||
|
||||
# 5. Sürüm ZIP Arşivini Oluştur (GitHub Releases için)
|
||||
# 5. Surum ZIP Arsivini Olustur
|
||||
$oldZips = Get-ChildItem -Path $root -File -Filter "LD-Uninstaller-v*.zip"
|
||||
foreach ($oz in $oldZips) {
|
||||
try { Remove-Item -Path $oz.FullName -Force -ErrorAction SilentlyContinue } catch { }
|
||||
|
|
@ -111,15 +111,15 @@ foreach ($oz in $oldZips) {
|
|||
|
||||
$zipName = "LD-Uninstaller-v$newVersion.zip"
|
||||
$zipPath = Join-Path $root $zipName
|
||||
Write-Host "Sürüm arşivi oluşturuluyor: $zipName..." -ForegroundColor Cyan
|
||||
Write-Host "Surum arsivi olusturuluyor: $zipName..." -ForegroundColor Cyan
|
||||
Compress-Archive -Path "$targetDir\*" -DestinationPath $zipPath -Force
|
||||
|
||||
# 6. Git DeÄŸiÅŸiklikleri, Etiket (Tag) ve GitHub Senkronizasyonu
|
||||
# 6. Git Islemleri ve GitHub Push
|
||||
if (Test-Path (Join-Path $root ".git")) {
|
||||
Write-Host "`nGit değişiklikleri işleniyor ve GitHub'a aktarılıyor..." -ForegroundColor Cyan
|
||||
Write-Host "`nGit degisiklikleri isleniyor ve GitHub'a aktariliyor..." -ForegroundColor Cyan
|
||||
try {
|
||||
if ([string]::IsNullOrWhiteSpace($Message)) {
|
||||
$Message = "Release v${newVersion}: 20 Katmanli Derin Kalinti Temizleme Motoru ve Arayuz SadeleÅŸtirmesi"
|
||||
$Message = "Release v${newVersion}: Yeni Logo ve Baslangic Yoneticisi Guncellemesi"
|
||||
}
|
||||
git add .
|
||||
git commit -m $Message
|
||||
|
|
@ -127,24 +127,24 @@ if (Test-Path (Join-Path $root ".git")) {
|
|||
|
||||
$remote = git remote get-url origin 2>$null
|
||||
if ($remote) {
|
||||
Write-Host "GitHub'a gönderiliyor (origin master --tags)..." -ForegroundColor Yellow
|
||||
Write-Host "GitHub'a gonderiliyor (origin master --tags)..." -ForegroundColor Yellow
|
||||
git push origin master --tags -u -f
|
||||
}
|
||||
} catch {
|
||||
Write-Host "Git işlemi uyarısı: $_" -ForegroundColor Yellow
|
||||
Write-Host "Git islemi uyarisi: $_" -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
# 7. GitHub Releases API Üzerinde Sürüm ve Değişiklik Notlarını Yayınla
|
||||
# 7. GitHub Releases API Uzerinde Surum ve Notlari Yayinla
|
||||
try {
|
||||
Write-Host "`nGitHub Releases API üzerinden sürüm ve notlar yayınlanıyor..." -ForegroundColor Cyan
|
||||
Write-Host "`nGitHub Releases API uzerinden surum ve notlar yayinlaniyor..." -ForegroundColor Cyan
|
||||
|
||||
$code = @"
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
public class GitCredsPublisher
|
||||
public class GitCredsEngine
|
||||
{
|
||||
[DllImport("Advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
public static extern bool CredRead(string target, int type, int reservedFlag, out IntPtr credentialPtr);
|
||||
|
|
@ -180,16 +180,16 @@ public class GitCredsPublisher
|
|||
}
|
||||
}
|
||||
"@
|
||||
if (-not ([System.Management.Automation.PSTypeName]'GitCredsPublisher').Type) {
|
||||
if (-not ([System.Management.Automation.PSTypeName]'GitCredsEngine').Type) {
|
||||
Add-Type -TypeDefinition $code -Language CSharp
|
||||
}
|
||||
|
||||
$token = [GitCredsPublisher]::GetToken()
|
||||
$token = [GitCredsEngine]::GetToken()
|
||||
if ($env:GITHUB_TOKEN) { $token = $env:GITHUB_TOKEN }
|
||||
if ($env:GH_TOKEN) { $token = $env:GH_TOKEN }
|
||||
|
||||
if (-not $token) {
|
||||
Write-Host "Uyarı: GitHub kimlik belirteci (token) bulunamadı. Release API atlanıyor." -ForegroundColor Yellow
|
||||
Write-Host "Uyari: GitHub kimlik belirteci bulunamadi. Release API atlaniyor." -ForegroundColor Yellow
|
||||
} else {
|
||||
$apiHeaders = @{
|
||||
"Authorization" = "Bearer $token"
|
||||
|
|
@ -200,17 +200,17 @@ public class GitCredsPublisher
|
|||
$repoOwner = "LilDosto"
|
||||
$repoName = "LD-Unistaller"
|
||||
|
||||
# Changelog / Sürüm Notları (Şablon dosyasından temiz UTF-8 olarak yüklenir)
|
||||
# Changelog / Surum Notlari (Sablon dosyasindan UTF-8 olarak okunur)
|
||||
$templatePath = Join-Path $root "release_notes_template.md"
|
||||
$releaseNotes = ""
|
||||
if (Test-Path $templatePath) {
|
||||
$releaseNotes = [System.IO.File]::ReadAllText($templatePath, [System.Text.Encoding]::UTF8)
|
||||
$releaseNotes = $releaseNotes.Replace("{VERSION}", $newVersion)
|
||||
} else {
|
||||
$releaseNotes = "LD Uninstaller v$newVersion güncellemesi."
|
||||
$releaseNotes = "LD Uninstaller v$newVersion guncellemesi."
|
||||
}
|
||||
|
||||
$releaseTitle = "🧹 LDUninstaller-v$newVersion — Derin Kalıntı Temizleme ve Çoklu Disk Güncellemesi"
|
||||
$releaseTitle = if (![string]::IsNullOrWhiteSpace($Message)) { $Message } else { "LDUninstaller-v$newVersion - Guncelleme" }
|
||||
|
||||
$releasePayload = @{
|
||||
tag_name = "v$newVersion"
|
||||
|
|
@ -222,7 +222,6 @@ public class GitCredsPublisher
|
|||
|
||||
$jsonBytes = [System.Text.Encoding]::UTF8.GetBytes($releasePayload)
|
||||
|
||||
# Release var mı kontrol et
|
||||
$releaseUrl = "https://api.github.com/repos/$repoOwner/$repoName/releases/tags/v$newVersion"
|
||||
$ghRelease = $null
|
||||
try {
|
||||
|
|
@ -230,20 +229,19 @@ public class GitCredsPublisher
|
|||
} catch { }
|
||||
|
||||
if ($ghRelease) {
|
||||
Write-Host "Mevcut release güncelleniyor (ID: $($ghRelease.id))..." -ForegroundColor Yellow
|
||||
Write-Host "Mevcut release guncelleniyor (ID: $($ghRelease.id))..." -ForegroundColor Yellow
|
||||
$patchUrl = "https://api.github.com/repos/$repoOwner/$repoName/releases/$($ghRelease.id)"
|
||||
$ghRelease = Invoke-RestMethod -Uri $patchUrl -Headers $apiHeaders -Method Patch -Body $jsonBytes -ContentType "application/json; charset=utf-8"
|
||||
} else {
|
||||
Write-Host "Yeni release oluÅŸturuluyor..." -ForegroundColor Green
|
||||
Write-Host "Yeni release olusturuluyor..." -ForegroundColor Green
|
||||
$postUrl = "https://api.github.com/repos/$repoOwner/$repoName/releases"
|
||||
$ghRelease = Invoke-RestMethod -Uri $postUrl -Headers $apiHeaders -Method Post -Body $jsonBytes -ContentType "application/json; charset=utf-8"
|
||||
}
|
||||
|
||||
# ZIP dosyasını release asset olarak yükle
|
||||
# ZIP dosyasini release asset olarak yukle
|
||||
if ($ghRelease -and (Test-Path $zipPath)) {
|
||||
Write-Host "Sürüm paketi ($zipName) release sayfasına yükleniyor..." -ForegroundColor Cyan
|
||||
Write-Host "Surum paketi ($zipName) release sayfasina yukleniyor..." -ForegroundColor Cyan
|
||||
|
||||
# Eski asset varsa sil
|
||||
if ($ghRelease.assets) {
|
||||
foreach ($asset in $ghRelease.assets) {
|
||||
if ($asset.name -eq $zipName) {
|
||||
|
|
@ -262,23 +260,23 @@ public class GitCredsPublisher
|
|||
}
|
||||
$zipBytes = [System.IO.File]::ReadAllBytes($zipPath)
|
||||
$uploadResult = Invoke-RestMethod -Uri $uploadUri -Headers $uploadHeaders -Method Post -Body $zipBytes -ContentType "application/zip"
|
||||
Write-Host "Asset başarıyla yüklendi: $($uploadResult.browser_download_url)" -ForegroundColor Green
|
||||
Write-Host "Asset basariyla yuklendi: $($uploadResult.browser_download_url)" -ForegroundColor Green
|
||||
}
|
||||
|
||||
Write-Host "`nGitHub Release yayında:" -ForegroundColor Yellow
|
||||
Write-Host "`nGitHub Release yayinda:" -ForegroundColor Yellow
|
||||
Write-Host " -> https://github.com/$repoOwner/$repoName/releases/tag/v$newVersion" -ForegroundColor White
|
||||
}
|
||||
} catch {
|
||||
Write-Host "GitHub Releases API işlemi uyarısı: $_" -ForegroundColor Yellow
|
||||
Write-Host "GitHub Releases API islemi uyarisi: $_" -ForegroundColor Yellow
|
||||
}
|
||||
|
||||
Write-Host "`n✅ Başarıyla Tamamlandı!" -ForegroundColor Green
|
||||
Write-Host "Ana dizinde oluşturulan son güncel sürüm klasörü:" -ForegroundColor Yellow
|
||||
Write-Host "`n[+] Basariyla Tamamlandi!" -ForegroundColor Green
|
||||
Write-Host "Ana dizinde olusturulan son guncel surum klasoru:" -ForegroundColor Yellow
|
||||
Write-Host " -> $targetFolderName" -ForegroundColor White
|
||||
Write-Host "GitHub Release için hazır paket:" -ForegroundColor White
|
||||
Write-Host "GitHub Release hazir paketi:" -ForegroundColor White
|
||||
Write-Host " -> $zipName" -ForegroundColor Cyan
|
||||
Write-Host "Kullanıma hazır yürütülebilir dosyalar:" -ForegroundColor Gray
|
||||
Write-Host " - LDUninstaller.Launcher.exe (Yönetici yetkili başlatıcı)"
|
||||
Write-Host " - LDUninstaller.UI.exe (Modern Fluent Arayüz)"
|
||||
Write-Host " - LDUninstaller.CLI.exe (Konsol aracı)"
|
||||
Write-Host " - LDUninstaller.Automatizer.exe (Otomasyon ajanı)`n"
|
||||
Write-Host "Kullanima hazir yurutulebilir dosyalar:" -ForegroundColor Gray
|
||||
Write-Host " - LDUninstaller.Launcher.exe (Yonetici yetkili baslatici)"
|
||||
Write-Host " - LDUninstaller.UI.exe (Modern Fluent Arayuz)"
|
||||
Write-Host " - LDUninstaller.CLI.exe (Konsol araci)"
|
||||
Write-Host " - LDUninstaller.Automatizer.exe (Otomasyon ajani)`n"
|
||||
|
|
|
|||
|
|
@ -1,28 +1,26 @@
|
|||
Bu sürümde, kaldırılan uygulamaların arkasında bıraktığı tüm dosya, kayıt defteri, servis ve görev kalıntılarını eksiksiz temizleyen 20 katmanlı derin tarama motoru ve çoklu sürücü analiz sistemi arayüze entegre edilmiştir.
|
||||
Bu sürümde, LD Uninstaller için özel tasarlanan modern logo/ikon paketi entegre edilmiş ve Başlangıç Yöneticisi'ndeki yetki ve açılış engelleme sorunları tamamen giderilmiştir.
|
||||
|
||||
---
|
||||
|
||||
### ✨ Neler Eklendi ve İyileştirildi?
|
||||
|
||||
**1. 🧹 20 Katmanlı Derin Kalıntı ve Artık Temizleme Motoru**
|
||||
- Kaldırma işlemi (tekli veya çoklu) tamamlandığı anda otomatik devreye giren kalıntı temizleme arayüzü eklendi:
|
||||
- **Servis & Görev Temizliği:** Arka planda unutulan Windows Servisleri (`sc delete`) ve Görev Zamanlayıcı (`Tasks`) updater görevleri otomatik taranıp temizlenir.
|
||||
- **Kayıt Defteri & COM:** Shell sağ tık menüleri (`ContextMenuHandlers`), `App Paths`, `Run/RunOnce` ve yetim `CLSID` nesneleri temizlenir.
|
||||
- **Kullanıcı Verileri:** `%AppData%`, `%LocalAppData%`, `%USERPROFILE%` altındaki gizli `.appname` / `.config` klasörleri ve boş kalan yayıncı dizinleri silinir.
|
||||
- **Güvenli Yedek:** Silme işleminden önce kayıt defteri anahtarları otomatik olarak `.reg` yedeğine aktarılır.
|
||||
**1. 🎨 Yepyeni Modern Logo ve Uygulama Simgesi (App Icon)**
|
||||
- Uygulama için modern Windows 11 Fluent tasarımına uyumlu fütüristik 'LD' amblemi ve temizleme girdabı motifli yeni logo tasarlandı.
|
||||
- **Tüm Alanlara Entegre Edildi:**
|
||||
- Arayüzün sol üst köşesindeki geçici mavi kutu kaldırılarak yüksek çözünürlüklü yeni logo yerleştirildi.
|
||||
- Görev Yöneticisi (Task Manager), pencere başlıkları ve Windows Gezgini (klasör) üzerinde görünmesi için çoklu çözünürlüklü (`16x16`'dan `256x256`'ya) `.ico` dosyası yürütülebilir dosyalara gömüldü.
|
||||
|
||||
**2. 💾 Çoklu Disk Analizi ve Üst Sekmeler**
|
||||
- Sistemdeki tüm takılı sürücüler (`C:`, `D:`, harici diskler vb.) otomatik analiz edilerek üst kısıma modern sekme butonları olarak eklendi:
|
||||
- **Dinamik Disk Haritası:** Sürücü sekmeleri arasında geçiş yapıldığında hem uygulama tablosu hem de görsel Treemap haritası anında seçilen diske göre filtrelenir.
|
||||
- **Oyun ve Kütüphane Tespiti:** İkincil disklerdeki `Games`, `Oyunlar` ve `SteamLibrary` dizinleri eksiksiz taranır.
|
||||
**2. ⚡ Başlangıç Yöneticisi ve Yetki Hatası Düzeltmesi**
|
||||
- Uygulama zaten Yönetici olarak açılmasına rağmen bazı uygulamaları kapatırken ortaya çıkan *"Yönetici yetkisi gerekebilir"* uyarısı ve kapatamama sorunu kökten çözüldü:
|
||||
- **Başlangıç Klasörü Desteği:** `StartupFolder` altındaki kısayollar için hem `StartupApproved` ikili anahtarı hem de dosya devre dışı bırakma desteği eklendi.
|
||||
- **HKLM & 32-bit (Run32) Uyumu:** 64-bit Windows sistemlerinde `WOW6432Node` ve `HKLM` anahtarlarına ait programların açılış durumları doğru kayıt defteri dallarına yazılarak sorunsuz hale getirildi.
|
||||
- **Servis Yönetimi:** Windows Servisleri'nin başlangıç durumları (`Automatic`/`Disabled`) doğrudan `sc.exe config` ve sistem kayıt defteri üzerinden anında değiştirilebilir kılındı.
|
||||
|
||||
**3. ⚡ Ultra Akıcı Arayüz ve Sıfır Takılma**
|
||||
- Arama çubuğuna yazarken UI kilitlenmesini önleyen 160ms gecikmeli filtreleme (debounced search) getirildi.
|
||||
- Donanım hızlandırmalı sanallaştırılmış liste kaydırması (`Pixel` scroll unit) ile yüksek kare hızında akıcılık sağlandı.
|
||||
**3. 🧹 20 Katmanlı Derin Kalıntı Temizleme Motoru**
|
||||
- Kaldırma işlemi bittiğinde arkada kalan tüm öksüz servisler, zamanlanmış görevler, kayıt defteri dalları ve gizli kullanıcı yapılandırma dosyaları eksiksiz taranır ve silinir.
|
||||
|
||||
**4. 🗑️ Sadeleştirilmiş Tek Tuşla Kaldırma**
|
||||
- Arayüzdeki kafa karıştırıcı çoklu kaldırma butonları kaldırılarak tek ve akıllı bir **`🗑️ Kaldır`** butonu eklendi.
|
||||
- Tek uygulama seçildiğinde doğrudan kaldırma, birden fazla seçildiğinde çakışma önleyici akıllı kuyruk devreye girer.
|
||||
**4. 💾 Çoklu Sürücü Yönetimi ve Disk Haritası**
|
||||
- Bilgisayara takılı birden fazla disk (`C:`, `D:` vb.) varsa üst sekme çubuğu üzerinden kolayca geçiş yapılır ve görsel Treemap haritası seçilen diske göre dinamik güncellenir.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ namespace LDUninstaller.Core.Models
|
|||
public string Publisher { get; set; } = string.Empty;
|
||||
public StartupType Type { get; set; }
|
||||
public string Location { get; set; } = string.Empty;
|
||||
public string ServiceName { get; set; } = string.Empty;
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
public byte[]? StartupApprovedBinary { get; set; }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.ServiceProcess;
|
||||
using LDUninstaller.Core.Models;
|
||||
|
|
@ -14,11 +15,15 @@ namespace LDUninstaller.Core.Startup
|
|||
var list = new List<StartupEntry>();
|
||||
|
||||
// 1. Registry HKCU Run
|
||||
ScanRegistryRun(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Run", StartupType.RegistryRun, list);
|
||||
ScanRegistryRun(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Run", StartupType.RegistryRun, list, isHklm: false, isWow64: false);
|
||||
|
||||
// 2. Registry HKLM Run
|
||||
ScanRegistryRun(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", StartupType.RegistryRun, list);
|
||||
ScanRegistryRun(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", StartupType.RegistryRun, list, isHklm: true, isWow64: false);
|
||||
|
||||
// 3. Registry HKLM 32-bit (Wow6432Node)
|
||||
if (Environment.Is64BitOperatingSystem)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var baseKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32);
|
||||
using var key = baseKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
|
||||
|
|
@ -33,15 +38,17 @@ namespace LDUninstaller.Core.Startup
|
|||
Command = val,
|
||||
Type = StartupType.RegistryRun,
|
||||
Location = @"HKLM\Software\Wow6432Node\...\Run",
|
||||
IsEnabled = CheckStartupApproved(name)
|
||||
IsEnabled = CheckStartupApproved(name, isHklm: true, isWow64: true)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// 4. Startup Folders
|
||||
ScanFolder(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "User Startup Folder", list);
|
||||
ScanFolder(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup), "All Users Startup Folder", list);
|
||||
ScanFolder(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "Kullanıcı Başlangıç Klasörü", list, isCommon: false);
|
||||
ScanFolder(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup), "Tüm Kullanıcılar Başlangıç Klasörü", list, isCommon: true);
|
||||
|
||||
// 5. Services (3rd party automatic)
|
||||
ScanServices(list);
|
||||
|
|
@ -49,7 +56,7 @@ namespace LDUninstaller.Core.Startup
|
|||
return list;
|
||||
}
|
||||
|
||||
private static void ScanRegistryRun(RegistryKey root, string subKey, StartupType type, List<StartupEntry> list)
|
||||
private static void ScanRegistryRun(RegistryKey root, string subKey, StartupType type, List<StartupEntry> list, bool isHklm, bool isWow64)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -65,28 +72,40 @@ namespace LDUninstaller.Core.Startup
|
|||
Command = cmd,
|
||||
Type = type,
|
||||
Location = $"{root.Name}\\{subKey}",
|
||||
IsEnabled = CheckStartupApproved(name)
|
||||
IsEnabled = CheckStartupApproved(name, isHklm, isWow64)
|
||||
});
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private static void ScanFolder(string path, string locationDesc, List<StartupEntry> list)
|
||||
private static void ScanFolder(string path, string locationDesc, List<StartupEntry> list, bool isCommon)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path) || !Directory.Exists(path)) return;
|
||||
try
|
||||
{
|
||||
foreach (var file in Directory.GetFiles(path))
|
||||
{
|
||||
string name = Path.GetFileNameWithoutExtension(file);
|
||||
string ext = Path.GetExtension(file).ToLowerInvariant();
|
||||
if (ext != ".lnk" && ext != ".url" && ext != ".disabled") continue;
|
||||
|
||||
string fileName = Path.GetFileName(file);
|
||||
string displayName = Path.GetFileNameWithoutExtension(file);
|
||||
bool isEnabled = !ext.Equals(".disabled", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
// Check StartupApproved for startup folder
|
||||
if (isEnabled)
|
||||
{
|
||||
isEnabled = CheckStartupFolderApproved(fileName, isCommon);
|
||||
}
|
||||
|
||||
list.Add(new StartupEntry
|
||||
{
|
||||
Name = name,
|
||||
Name = displayName,
|
||||
Command = file,
|
||||
Type = StartupType.StartupFolder,
|
||||
Location = locationDesc,
|
||||
IsEnabled = true
|
||||
IsEnabled = isEnabled
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -106,19 +125,25 @@ namespace LDUninstaller.Core.Startup
|
|||
if (key != null)
|
||||
{
|
||||
int startType = (int)(key.GetValue("Start") ?? 3);
|
||||
// 2 = Automatic
|
||||
if (startType == 2)
|
||||
{
|
||||
string imgPath = key.GetValue("ImagePath")?.ToString() ?? "";
|
||||
if (!imgPath.ToLowerInvariant().Contains(@"windows\system32"))
|
||||
string imgLower = imgPath.ToLowerInvariant();
|
||||
|
||||
// 2 = Automatic, 3 = Manual, 4 = Disabled
|
||||
// Exclude internal OS services
|
||||
if (!imgLower.Contains(@"\windows\system32\svchost.exe") &&
|
||||
!imgLower.Contains(@"\windows\system32\services.exe") &&
|
||||
!imgLower.Contains(@"\windows\system32\lsass.exe"))
|
||||
{
|
||||
if (startType == 2 || startType == 4)
|
||||
{
|
||||
list.Add(new StartupEntry
|
||||
{
|
||||
Name = sc.DisplayName,
|
||||
ServiceName = sc.ServiceName,
|
||||
Command = imgPath,
|
||||
Type = StartupType.Service,
|
||||
Location = "Windows Service",
|
||||
IsEnabled = sc.Status == ServiceControllerStatus.Running
|
||||
Location = "Windows Servisi",
|
||||
IsEnabled = (startType == 2)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -130,17 +155,59 @@ namespace LDUninstaller.Core.Startup
|
|||
catch { }
|
||||
}
|
||||
|
||||
public static bool CheckStartupApproved(string entryName)
|
||||
public static bool CheckStartupApproved(string entryName, bool isHklm = false, bool isWow64 = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run");
|
||||
string approvedSub = isWow64 ? @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run32"
|
||||
: @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run";
|
||||
|
||||
// First check HKCU
|
||||
using (var key = Registry.CurrentUser.OpenSubKey(approvedSub))
|
||||
{
|
||||
if (key?.GetValue(entryName) is byte[] data && data.Length > 0)
|
||||
{
|
||||
// 0x02 is enabled, 0x03 or other is disabled
|
||||
return data[0] == 0x02;
|
||||
}
|
||||
}
|
||||
|
||||
// If HKLM, also check HKLM StartupApproved
|
||||
if (isHklm)
|
||||
{
|
||||
using var hklmKey = Registry.LocalMachine.OpenSubKey(approvedSub);
|
||||
if (hklmKey?.GetValue(entryName) is byte[] data && data.Length > 0)
|
||||
{
|
||||
return data[0] == 0x02;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool CheckStartupFolderApproved(string fileName, bool isCommon)
|
||||
{
|
||||
try
|
||||
{
|
||||
const string approvedSub = @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder";
|
||||
|
||||
using (var key = Registry.CurrentUser.OpenSubKey(approvedSub))
|
||||
{
|
||||
if (key?.GetValue(fileName) is byte[] data && data.Length > 0)
|
||||
{
|
||||
return data[0] == 0x02;
|
||||
}
|
||||
}
|
||||
|
||||
if (isCommon)
|
||||
{
|
||||
using var hklmKey = Registry.LocalMachine.OpenSubKey(approvedSub);
|
||||
if (hklmKey?.GetValue(fileName) is byte[] data && data.Length > 0)
|
||||
{
|
||||
return data[0] == 0x02;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return true;
|
||||
}
|
||||
|
|
@ -149,36 +216,136 @@ namespace LDUninstaller.Core.Startup
|
|||
{
|
||||
try
|
||||
{
|
||||
if (entry.Type == StartupType.RegistryRun)
|
||||
{
|
||||
using var key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run");
|
||||
if (key != null)
|
||||
{
|
||||
byte[] data = enable
|
||||
byte[] binaryData = enable
|
||||
? new byte[] { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
: new byte[] { 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
key.SetValue(entry.Name, data, RegistryValueKind.Binary);
|
||||
|
||||
if (entry.Type == StartupType.RegistryRun)
|
||||
{
|
||||
bool isWow64 = entry.Location.Contains("Wow6432Node", StringComparison.OrdinalIgnoreCase);
|
||||
bool isHklm = entry.Location.Contains("HKEY_LOCAL_MACHINE", StringComparison.OrdinalIgnoreCase) || entry.Location.Contains("HKLM", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
string approvedSub = isWow64 ? @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run32"
|
||||
: @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run";
|
||||
|
||||
// Always write to HKCU
|
||||
using (var key = Registry.CurrentUser.CreateSubKey(approvedSub))
|
||||
{
|
||||
key?.SetValue(entry.Name, binaryData, RegistryValueKind.Binary);
|
||||
}
|
||||
|
||||
// If it was in HKLM, also write to HKLM
|
||||
if (isHklm)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var key = Registry.LocalMachine.CreateSubKey(approvedSub);
|
||||
key?.SetValue(entry.Name, binaryData, RegistryValueKind.Binary);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
entry.IsEnabled = enable;
|
||||
return true;
|
||||
}
|
||||
else if (entry.Type == StartupType.StartupFolder)
|
||||
{
|
||||
string fileName = Path.GetFileName(entry.Command);
|
||||
bool isCommon = entry.Location.Contains("Tüm Kullanıcılar", StringComparison.OrdinalIgnoreCase) || entry.Location.Contains("All Users", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
const string approvedFolderSub = @"Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\StartupFolder";
|
||||
|
||||
// Write to StartupApproved\StartupFolder in HKCU
|
||||
using (var key = Registry.CurrentUser.CreateSubKey(approvedFolderSub))
|
||||
{
|
||||
key?.SetValue(fileName, binaryData, RegistryValueKind.Binary);
|
||||
}
|
||||
|
||||
if (isCommon)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var key = Registry.LocalMachine.CreateSubKey(approvedFolderSub);
|
||||
key?.SetValue(fileName, binaryData, RegistryValueKind.Binary);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
// Fallback rename if StartupApproved is not respected
|
||||
try
|
||||
{
|
||||
if (!enable && File.Exists(entry.Command) && !entry.Command.EndsWith(".disabled", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string newPath = entry.Command + ".disabled";
|
||||
File.Move(entry.Command, newPath);
|
||||
entry.Command = newPath;
|
||||
}
|
||||
else if (enable && File.Exists(entry.Command) && entry.Command.EndsWith(".disabled", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
string newPath = entry.Command.Substring(0, entry.Command.Length - ".disabled".Length);
|
||||
File.Move(entry.Command, newPath);
|
||||
entry.Command = newPath;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
entry.IsEnabled = enable;
|
||||
return true;
|
||||
}
|
||||
else if (entry.Type == StartupType.Service)
|
||||
{
|
||||
string svcName = !string.IsNullOrEmpty(entry.ServiceName) ? entry.ServiceName : entry.Name;
|
||||
int targetStartType = enable ? 2 : 4; // 2 = Auto, 4 = Disabled
|
||||
|
||||
// 1. Update Registry Start type directly
|
||||
try
|
||||
{
|
||||
using var key = Registry.LocalMachine.OpenSubKey($@"SYSTEM\CurrentControlSet\Services\{svcName}", true);
|
||||
if (key != null)
|
||||
{
|
||||
key.SetValue("Start", targetStartType, RegistryValueKind.DWord);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
// 2. Run sc.exe config start= auto / disabled
|
||||
try
|
||||
{
|
||||
string mode = enable ? "auto" : "disabled";
|
||||
var psi = new ProcessStartInfo("sc.exe", $"config \"{svcName}\" start= {mode}")
|
||||
{
|
||||
CreateNoWindow = true,
|
||||
UseShellExecute = false
|
||||
};
|
||||
using var p = Process.Start(psi);
|
||||
p?.WaitForExit(3000);
|
||||
}
|
||||
catch { }
|
||||
|
||||
// 3. Stop or Start the service
|
||||
try
|
||||
{
|
||||
using var sc = new ServiceController(svcName);
|
||||
if (!enable && sc.Status == ServiceControllerStatus.Running)
|
||||
{
|
||||
sc.Stop();
|
||||
sc.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromSeconds(3));
|
||||
}
|
||||
else if (enable && sc.Status == ServiceControllerStatus.Stopped)
|
||||
{
|
||||
sc.Start();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
entry.IsEnabled = enable;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (entry.Type == StartupType.Service)
|
||||
catch (Exception ex)
|
||||
{
|
||||
using var sc = new ServiceController(entry.Name);
|
||||
if (enable && sc.Status != ServiceControllerStatus.Running)
|
||||
{
|
||||
sc.Start();
|
||||
entry.IsEnabled = true;
|
||||
Debug.WriteLine($"ToggleStartupEntry error: {ex.Message}");
|
||||
}
|
||||
else if (!enable && sc.Status == ServiceControllerStatus.Running)
|
||||
{
|
||||
sc.Stop();
|
||||
entry.IsEnabled = false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,13 @@
|
|||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<RootNamespace>LDUninstaller.Launcher</RootNamespace>
|
||||
<AssemblyName>LDUninstaller.Launcher</AssemblyName>
|
||||
<ApplicationIcon>Resources\app.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\app.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LDUninstaller.Core\LDUninstaller.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
BIN
src/LDUninstaller.Launcher/Resources/app.ico
Normal file
BIN
src/LDUninstaller.Launcher/Resources/app.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 187 KiB |
|
|
@ -7,6 +7,7 @@
|
|||
Background="{StaticResource BrushBgDark}"
|
||||
Foreground="{StaticResource BrushTextPrimary}"
|
||||
FontFamily="Segoe UI"
|
||||
Icon="pack://application:,,,/Resources/app.ico"
|
||||
BorderBrush="{StaticResource BrushBorder}"
|
||||
BorderThickness="1">
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
Background="{StaticResource BrushBgDark}"
|
||||
Foreground="{StaticResource BrushTextPrimary}"
|
||||
FontFamily="Segoe UI"
|
||||
Icon="pack://application:,,,/Resources/app.ico"
|
||||
BorderBrush="{StaticResource BrushBorder}"
|
||||
BorderThickness="1">
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,14 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>LDUninstaller.UI</RootNamespace>
|
||||
<AssemblyName>LDUninstaller.UI</AssemblyName>
|
||||
<ApplicationIcon>Resources\app.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\app.ico" />
|
||||
<Resource Include="Resources\logo.png" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LDUninstaller.Core\LDUninstaller.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
Background="{StaticResource BrushBgDark}"
|
||||
Foreground="{StaticResource BrushTextPrimary}"
|
||||
FontFamily="Segoe UI"
|
||||
Icon="pack://application:,,,/Resources/app.ico"
|
||||
BorderBrush="{StaticResource BrushBorder}"
|
||||
BorderThickness="1">
|
||||
|
||||
|
|
@ -33,8 +34,8 @@
|
|||
|
||||
<!-- App Brand / Logo -->
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="20,0">
|
||||
<Border Background="#2563EB" CornerRadius="8" Width="36" Height="36" Margin="0,0,12,0">
|
||||
<TextBlock Text="LD" FontSize="16" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||
<Border CornerRadius="8" Width="36" Height="36" Margin="0,0,12,0" ClipToBounds="True">
|
||||
<Image Source="pack://application:,,,/Resources/logo.png" Width="36" Height="36" RenderOptions.BitmapScalingMode="HighQuality" />
|
||||
</Border>
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<TextBlock Text="LD Uninstaller" FontSize="15" FontWeight="Bold" Foreground="White" />
|
||||
|
|
|
|||
BIN
src/LDUninstaller.UI/Resources/app.ico
Normal file
BIN
src/LDUninstaller.UI/Resources/app.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 187 KiB |
BIN
src/LDUninstaller.UI/Resources/logo.png
Normal file
BIN
src/LDUninstaller.UI/Resources/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 MiB |
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"major": 2,
|
||||
"minor": 4,
|
||||
"minor": 5,
|
||||
"patch": 0,
|
||||
"version": "2.4.0"
|
||||
"version": "2.5.0"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue