diff --git a/src/Resizetizer/src/WindowIconGeneratorTask.cs b/src/Resizetizer/src/WindowIconGeneratorTask.cs index 257d383..b39002f 100644 --- a/src/Resizetizer/src/WindowIconGeneratorTask.cs +++ b/src/Resizetizer/src/WindowIconGeneratorTask.cs @@ -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 }}