Fix Windows tray startup
This commit is contained in:
@@ -42,14 +42,13 @@ func newApp(mw *walk.MainWindow, appDir string, cfg Config, cache *CacheIndex) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
icon, err := walk.NewIconFromSysDLL("shell32.dll", 4)
|
icon, err := walk.NewIconFromSysDLL("shell32", 4)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ni.Dispose()
|
icon = walk.IconApplication()
|
||||||
return nil, fmt.Errorf("加载托盘图标: %w", err)
|
|
||||||
}
|
}
|
||||||
if err := ni.SetIcon(icon); err != nil {
|
if err := ni.SetIcon(icon); err != nil {
|
||||||
ni.Dispose()
|
ni.Dispose()
|
||||||
return nil, err
|
return nil, fmt.Errorf("设置托盘图标: %w", err)
|
||||||
}
|
}
|
||||||
if err := ni.SetToolTip(appName + " - 右键打开菜单"); err != nil {
|
if err := ni.SetToolTip(appName + " - 右键打开菜单"); err != nil {
|
||||||
ni.Dispose()
|
ni.Dispose()
|
||||||
|
|||||||
+7
-1
@@ -2,6 +2,11 @@
|
|||||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||||
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="GoWallpaper" type="win32"/>
|
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="GoWallpaper" type="win32"/>
|
||||||
<description>GoWallpaper</description>
|
<description>GoWallpaper</description>
|
||||||
|
<dependency>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
|
||||||
|
</dependentAssembly>
|
||||||
|
</dependency>
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<security>
|
<security>
|
||||||
<requestedPrivileges>
|
<requestedPrivileges>
|
||||||
@@ -16,7 +21,8 @@
|
|||||||
</compatibility>
|
</compatibility>
|
||||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<windowsSettings>
|
<windowsSettings>
|
||||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
|
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
|
||||||
|
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware>
|
||||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||||
</windowsSettings>
|
</windowsSettings>
|
||||||
</application>
|
</application>
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ param(
|
|||||||
)
|
)
|
||||||
|
|
||||||
$ErrorActionPreference = "Stop"
|
$ErrorActionPreference = "Stop"
|
||||||
|
$ProxyUrl = "http://127.0.0.1:10808"
|
||||||
|
$env:HTTP_PROXY = $ProxyUrl
|
||||||
|
$env:HTTPS_PROXY = $ProxyUrl
|
||||||
|
$env:NO_PROXY = "localhost,127.0.0.1"
|
||||||
$ProjectRoot = $PSScriptRoot
|
$ProjectRoot = $PSScriptRoot
|
||||||
$DistDir = Join-Path $ProjectRoot "dist"
|
$DistDir = Join-Path $ProjectRoot "dist"
|
||||||
$OutputPath = Join-Path $DistDir "GoWallpaper.exe"
|
$OutputPath = Join-Path $DistDir "GoWallpaper.exe"
|
||||||
|
|||||||
Reference in New Issue
Block a user