-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial work to get unpackaged WinUI apps #4460
Conversation
We shouldn't just rip out the option to have packaged as well it should be an option |
Yup! We t both. It is literally just a MSBuild property (and then the updated launchSettings.json). Both can work in the same project seamlessly. |
src/Controls/samples/Controls.Sample.SingleProject/Maui.Controls.Sample.SingleProject.csproj
Show resolved
Hide resolved
src/Controls/samples/Controls.Sample.SingleProject/Properties/launchSettings.json
Show resolved
Hide resolved
@@ -25,5 +25,7 @@ public static partial class AppInfo | |||
|
|||
/// <include file="../../docs/Microsoft.Maui.Essentials/AppInfo.xml" path="//Member[@MemberName='RequestedTheme']/Docs" /> | |||
public static AppTheme RequestedTheme => PlatformRequestedTheme(); | |||
|
|||
public static bool IsPackagedApp => PlatformIsPackagedApp(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a new API and we may want to change this a bit. Not sure if this is the right name, but basically represents a single package that is "installed" on the OS using the OS "store" or sideloading. This does not mean that using some single file, .msi installer magically makes it work. It means that the app has no package identity. Probably need a new name tbh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example is that a macOS/Cocoa app might be packaged but a WPF app will never be. Unless the rules change if the app is published to the store as a Win32 app. Then it probably gets a package identifier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Packaged isn't a bad choice. I also think something along the lines of what the "App Model" is. Should this be more than a bool, and maybe an enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh, sounds like a good idea there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a third model? There doesn't have to be one to use an enum, but is it possible to have a third? The 2 modes I can think of: "in a self contained package with an ID" and "just a folder on disk"
I tested the APIs with a WinForms app and the Windows Application Packaging Project, and that uses the same native APIs that throw when run as an exe and has an ID when using the packaging project.
# Conflicts: # src/Essentials/src/AppInfo/AppInfo.android.cs # src/Essentials/src/AppInfo/AppInfo.netstandard.cs # src/Essentials/src/AppInfo/AppInfo.shared.cs # src/Essentials/src/AppInfo/AppInfo.tizen.cs # src/Essentials/src/AppInfo/AppInfo.uwp.cs # src/Essentials/src/FileSystem/FileSystem.ios.tvos.watchos.macos.cs
Will we not need ot make sure that the ziped still is allow some people might prefare their app being single executable in fact that was whole point of .net 6 was it not? @mattleibow |
That is correct. This code is just our sample app. And, it is adding the feature. So after this PR, our sample will build as a store packaged app or a exe from a folder. |
Description of Change
This PR gets the very basic in place to allow the Maui sample app to launch as an unpackaged app.
Partially implements #3166
Notes
You will need to download and install the Windows App SDK runtime and MSIX packages which are required to run and deploy unpackaged apps: https://docs.microsoft.com/en-us/windows/apps/windows-app-sdk/downloads
For example, for the stable 1.0.0 version of the Windows App SDK, you will need to download and install: https://aka.ms/windowsappsdk/1.0-stable/msix-installer