Skip to content

Commit

Permalink
feat: Avoid startup exception for WinAppSDK Unpackaged apps
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Sep 18, 2024
1 parent bc87481 commit 89c4a45
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/Resizetizer/src/WindowIconGeneratorTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,11 @@ public static void SetWindowIcon(this global::Microsoft.UI.Xaml.Window window)
static bool IsPackaged()
{{
try
{{
if (global::Windows.ApplicationModel.Package.Current != null)
return true;
}}
catch
{{
// no-op
}}
#if WINAPPSDK_PACKAGED // Defined in the Uno.Sdk for WinAppSDK Packaged apps.
return true;
#else
return false;
#endif
}}
#endif
}}
Expand Down

0 comments on commit 89c4a45

Please sign in to comment.