Skip to content

Commit

Permalink
Merge pull request #317 from unoplatform/dev/mazi/packaged-check
Browse files Browse the repository at this point in the history
feat: Avoid startup exception for WinAppSDK Unpackaged apps
  • Loading branch information
MartinZikmund authored Sep 18, 2024
2 parents bc87481 + 89c4a45 commit b17e1d5
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 b17e1d5

Please sign in to comment.