feat: Windows 应用管理卸载支持
- uninstall.vbs:静默卸载(杀进程、清自启项、删快捷方式、删目录、删注册项) - register-uninstall.ps1:注册 HKCU Uninstall 项(设置->应用 可卸载)
This commit is contained in:
1 parent
0b868418cb
commit
880915bf01
2 files changed
+56
No files matched your search
@@ -0,0 +1,23 @@
|
|||||||
|
# Register DeepSeek Harness in Windows Apps & Features (uninstall entry)
|
||||||
|
# DisplayName built via [char] codes to avoid file-encoding issues
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\DeepSeekHarness'
|
||||||
|
$install = "$env:LOCALAPPDATA\DeepSeekHarness"
|
||||||
|
$uninst = "$install\uninstall.vbs"
|
||||||
|
|
||||||
|
if (-not (Test-Path $uninst)) { Write-Output "MISSING uninstall.vbs at $uninst"; exit 1 }
|
||||||
|
|
||||||
|
# 'DeepSeek Harness ' + 桌面客户端 (U+684C U+9762 U+5BA2 U+6237 U+7AEF)
|
||||||
|
$name = 'DeepSeek Harness ' + [char]0x684C + [char]0x9762 + [char]0x5BA2 + [char]0x6237 + [char]0x7AEF
|
||||||
|
|
||||||
|
New-Item -Path $key -Force | Out-Null
|
||||||
|
Set-ItemProperty -Path $key -Name 'DisplayName' -Value $name -Type String
|
||||||
|
Set-ItemProperty -Path $key -Name 'DisplayVersion' -Value '1.0.0' -Type String
|
||||||
|
Set-ItemProperty -Path $key -Name 'Publisher' -Value 'VanuSystems' -Type String
|
||||||
|
Set-ItemProperty -Path $key -Name 'InstallLocation' -Value $install -Type String
|
||||||
|
Set-ItemProperty -Path $key -Name 'DisplayIcon' -Value "$install\dsh.ico" -Type String
|
||||||
|
Set-ItemProperty -Path $key -Name 'UninstallString' -Value ('"' + "$env:SystemRoot\System32\wscript.exe" + '" "' + $uninst + '"') -Type String
|
||||||
|
Set-ItemProperty -Path $key -Name 'NoModify' -Value 1 -Type DWord
|
||||||
|
Set-ItemProperty -Path $key -Name 'NoRepair' -Value 1 -Type DWord
|
||||||
|
Set-ItemProperty -Path $key -Name 'EstimatedSize' -Value 343000 -Type DWord
|
||||||
|
Write-Output 'Registered OK'
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
' DeepSeek Harness uninstaller (silent)
|
||||||
|
' Invoked from Windows Apps & Features via UninstallString
|
||||||
|
Set ws = CreateObject("WScript.Shell")
|
||||||
|
Set fso = CreateObject("Scripting.FileSystemObject")
|
||||||
|
|
||||||
|
' 1. stop app and backend service
|
||||||
|
ws.Run "taskkill /F /IM dsh-app.exe /T", 0, True
|
||||||
|
ws.Run "taskkill /F /IM node.exe /T", 0, True
|
||||||
|
|
||||||
|
' 2. remove autostart registry entry
|
||||||
|
On Error Resume Next
|
||||||
|
ws.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run\DeepSeekHarnessService"
|
||||||
|
Err.Clear
|
||||||
|
|
||||||
|
' 3. remove desktop shortcuts
|
||||||
|
Dim desktop
|
||||||
|
desktop = ws.SpecialFolders("Desktop")
|
||||||
|
On Error Resume Next
|
||||||
|
If fso.FileExists(desktop & "\DeepSeek Harness.lnk") Then fso.DeleteFile desktop & "\DeepSeek Harness.lnk"
|
||||||
|
If fso.FileExists("C:\Users\VanuSystems-Mu\DeskBox\AI\DeepSeek Harness.lnk") Then fso.DeleteFile "C:\Users\VanuSystems-Mu\DeskBox\AI\DeepSeek Harness.lnk"
|
||||||
|
Err.Clear
|
||||||
|
|
||||||
|
' 4. remove uninstall registry key
|
||||||
|
On Error Resume Next
|
||||||
|
ws.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\DeepSeekHarness"
|
||||||
|
Err.Clear
|
||||||
|
|
||||||
|
' 5. remove install directory
|
||||||
|
On Error Resume Next
|
||||||
|
Dim installDir
|
||||||
|
installDir = ws.ExpandEnvironmentStrings("%LOCALAPPDATA%\DeepSeekHarness")
|
||||||
|
If fso.FolderExists(installDir) Then fso.DeleteFolder installDir, True
|
||||||
|
Err.Clear
|
||||||
Reference in new issue
Block a user