From 2d01e4d0de5e2c4e0f7f6746fb91571d66c4f2b9 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Sat, 24 Feb 2024 09:06:29 +0800 Subject: [PATCH] =?UTF-8?q?wails=20=E7=A8=8B=E5=BA=8F=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 | 18 +++++------------- main.go | 7 ++++++- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/build/windows/installer/project.nsi b/build/windows/installer/project.nsi index a6eaf2f..2343d1b 100644 --- a/build/windows/installer/project.nsi +++ b/build/windows/installer/project.nsi @@ -89,7 +89,11 @@ Section !insertmacro wails.files CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" - CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" + CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}" "" ".\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 !insertmacro wails.associateFiles !insertmacro wails.associateCustomProtocols @@ -102,18 +106,6 @@ 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 diff --git a/main.go b/main.go index f3ff9c7..80a86d3 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "changeme/initFunc" "context" "embed" + "strings" "github.com/gogf/gf/util/gconv" "github.com/gogf/gf/v2/frame/g" @@ -84,5 +85,9 @@ func (a *App) ShopUrl() string { if wailsConfigOem == nil { return "https://www.baidu.com" } - return wailsConfigOem["domain"].(string)+"?oem_id="+gconv.String(wailsConfigOem["id"]) + domain := wailsConfigOem["domain"].(string) + if !strings.Contains(domain, "http") { + domain = "https://"+domain + } + return domain+"?oem_id="+gconv.String(wailsConfigOem["id"]) } \ No newline at end of file