From 2b89f07fe516e9be4830afc86497acdab86b17b0 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Sun, 25 May 2025 22:39:28 +0800 Subject: [PATCH] refactor: remove old window state file deletion and add compatibility for legacy shortcuts --- src-tauri/packages/windows/installer.nsi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src-tauri/packages/windows/installer.nsi b/src-tauri/packages/windows/installer.nsi index 4b88f0b4..35d7eb96 100644 --- a/src-tauri/packages/windows/installer.nsi +++ b/src-tauri/packages/windows/installer.nsi @@ -761,10 +761,6 @@ SectionEnd Section Install - ;删除 .window-state.json 文件 - SetShellVarContext current - Delete "$APPDATA\io.github.clash-verge-rev.clash-verge-rev\.window-state.json" - SetOutPath $INSTDIR nsExec::Exec 'netsh int tcp res' !insertmacro CheckIfAppIsRunning @@ -985,14 +981,21 @@ Section Uninstall !insertmacro DeleteAppUserModelId !insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" !insertmacro UnpinShortcut "$DESKTOP\${PRODUCTNAME}.lnk" + ; 兼容旧名称快捷方式 + !insertmacro UnpinShortcut "$SMPROGRAMS\$AppStartMenuFolder\clash-verge.lnk" + !insertmacro UnpinShortcut "$DESKTOP\clash-verge.lnk" ; Remove start menu shortcut !insertmacro MUI_STARTMENU_GETFOLDER Application $AppStartMenuFolder Delete "$SMPROGRAMS\$AppStartMenuFolder\${PRODUCTNAME}.lnk" + ; 兼容旧名称快捷方式 + Delete "$SMPROGRAMS\$AppStartMenuFolder\clash-verge.lnk" RMDir "$SMPROGRAMS\$AppStartMenuFolder" ; Remove desktop shortcuts Delete "$DESKTOP\${PRODUCTNAME}.lnk" + ; 兼容旧名称快捷方式 + Delete "$DESKTOP\clash-verge.lnk" ; Remove registry information for add/remove programs !if "${INSTALLMODE}" == "both"