fix(release): 支持单文件发布产物

改为从应用程序自身提取托盘图标,移除发布目录中的外部 app.ico 依赖。
确保 v0.1.0 发布目录只包含 OmniNotify.exe,便于手动上传到 Gitea Release。
This commit is contained in:
2026-05-19 01:41:37 +08:00
parent c353845fad
commit 26a0f59901
2 changed files with 1 additions and 6 deletions

View File

@@ -86,10 +86,9 @@ public partial class App : System.Windows.Application
private void CreateTrayIcon()
{
var iconPath = Path.Combine(AppContext.BaseDirectory, "app.ico");
_notifyIcon = new Forms.NotifyIcon
{
Icon = new System.Drawing.Icon(iconPath),
Icon = System.Drawing.Icon.ExtractAssociatedIcon(Environment.ProcessPath ?? "") ?? System.Drawing.SystemIcons.Application,
Text = "Omni-Notify",
Visible = true
};

View File

@@ -10,8 +10,4 @@
<ApplicationIcon>app.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Content Include="app.ico" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
</Project>