Skip to content

The only downloader you need. 下载器的集大成者。

fix(deploy): 设置 macOS bundle id 与 Windows 卸载清理

XiaoYouChR0eaed78e19af
diff --git a/Ghost-Downloader-3.iss b/Ghost-Downloader-3.iss
index 71444259..c185f47d 100644
--- a/Ghost-Downloader-3.iss
+++ b/Ghost-Downloader-3.iss
@@ -55,5 +55,16 @@ Source: "dist/Ghost-Downloader-3.dist/*"; DestDir: "{app}"; Flags: ignoreversion
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
+[Registry]
+; 卸载时清掉运行时写入的 per-user 关联项; dontcreatekey 保证安装时不创建
+Root: HKCU; Subkey: "Software\Classes\GhostDownloader.torrent"; Flags: dontcreatekey uninsdeletekey
+Root: HKCU; Subkey: "Software\Classes\GhostDownloader.m3u8"; Flags: dontcreatekey uninsdeletekey
+Root: HKCU; Subkey: "Software\Classes\GhostDownloader.m3u"; Flags: dontcreatekey uninsdeletekey
+Root: HKCU; Subkey: "Software\Classes\GhostDownloader.mpd"; Flags: dontcreatekey uninsdeletekey
+Root: HKCU; Subkey: "Software\Classes\.torrent\OpenWithProgids"; ValueType: none; ValueName: "GhostDownloader.torrent"; Flags: dontcreatekey uninsdeletevalue
+Root: HKCU; Subkey: "Software\Classes\.m3u8\OpenWithProgids"; ValueType: none; ValueName: "GhostDownloader.m3u8"; Flags: dontcreatekey uninsdeletevalue
+Root: HKCU; Subkey: "Software\Classes\.m3u\OpenWithProgids"; ValueType: none; ValueName: "GhostDownloader.m3u"; Flags: dontcreatekey uninsdeletevalue
+Root: HKCU; Subkey: "Software\Classes\.mpd\OpenWithProgids"; ValueType: none; ValueName: "GhostDownloader.mpd"; Flags: dontcreatekey uninsdeletevalue
+
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
diff --git a/deploy.py b/deploy.py
index 0d7c142c..9d6ca75c 100644
--- a/deploy.py
+++ b/deploy.py
@@ -4,7 +4,7 @@ import subprocess
import sys
from pathlib import Path
-from app.supports.config import VERSION, YEAR, AUTHOR
+from app.supports.config import VERSION, YEAR, AUTHOR, DESKTOP_ID
FEATURES_ROOT = Path("features")
FILE_ICONS_DIR = Path("app/assets/file_icons")
@@ -79,7 +79,7 @@ def build_args() -> list[str]:
# '--show-progress',
'--static-libpython=no',
"--macos-create-app-bundle",
- "--assume-yes-for-download",
+ "--assume-yes-for-downloads",
"--macos-app-mode=gui",
f"--macos-app-version={VERSION}",
"--macos-app-icon=app/assets/logo.icns",
@@ -168,6 +168,8 @@ def patch_macos_app() -> None:
with open(plistPath, "rb") as f:
plist = plistlib.load(f)
plist["CFBundleDocumentTypes"] = documentTypes
+ # LaunchServices 按 bundle id 注册文档类型, 固定成反向域名 id
+ plist["CFBundleIdentifier"] = DESKTOP_ID
with open(plistPath, "wb") as f:
plistlib.dump(plist, f)