fix: preserve packaged deeplink registration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Scott Hanselman 2026-04-27 05:21:39 -07:00
parent 0ca2014244
commit cd67ae8485
2 changed files with 9 additions and 13 deletions

View File

@ -45,19 +45,11 @@ public static class DeepLinkHandler
}
}
private static bool IsPackagedApp()
{
try
{
var packageType = Type.GetType("Windows.ApplicationModel.Package, Windows, ContentType=WindowsRuntime");
var current = packageType?.GetProperty("Current")?.GetValue(null);
return current != null;
}
catch
{
return false;
}
}
#if OPENCLAW_TRAY_TESTS
private static bool IsPackagedApp() => false;
#else
private static bool IsPackagedApp() => OpenClawTray.Helpers.PackageHelper.IsPackaged;
#endif
public static void Handle(string uri, DeepLinkActions actions)
{

View File

@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<DefineConstants>$(DefineConstants);OPENCLAW_TRAY_TESTS</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\OpenClaw.Shared\OpenClaw.Shared.csproj" />
</ItemGroup>