From 9f94375e5a6987f3e41a33aaebe799beb160313d Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Fri, 23 Feb 2024 21:17:56 +0800 Subject: [PATCH] =?UTF-8?q?nsis=20=E5=AE=89=E8=A3=85=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/windows/installer/project.nsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build/windows/installer/project.nsi b/build/windows/installer/project.nsi index dbf2915..a6eaf2f 100644 --- a/build/windows/installer/project.nsi +++ b/build/windows/installer/project.nsi @@ -102,6 +102,18 @@ Section SectionEnd +Section "Install" + ; 创建快捷方式,并指定图标 ..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe + CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${INFO_PROJECTNAME}-${ARCH}-installer.exe" "" "$INSTDIR\icon.ico" + + ; 强制刷新图标缓存 + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer" "Shell Icons" "" + DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Explorer" "Shell Icons" + + ; 通知系统图标已更改 + SendMessage 0xFFFF 0x0017 0 0 /TIMEOUT=5000 +SectionEnd + Section "uninstall" !insertmacro wails.setShellContext