What is the size of a Hello World WinUI 3 program (packed with all dependencies)? #7683
-
Assuming I am installing the Hello World WinUI 3 program on a freshly installed Windows 10 PC, what would be the size of the installer? This answer will help me to decide whether to go ahead with WinUI 3 or not. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
It depends on a number of things:
But in either case you propably won't like the answer. Naked apps created with the "Blank App, Packaged (WinUI 3 in Desktop)" template have around 100 MB. Yes Megabytes! |
Beta Was this translation helpful? Give feedback.
-
Well, I didn't want to provide information for this because of the type of question it is. Windows App SDK redistributables The thing that you learn about these is that you only have to install what you need. You can also not install packages like DDLM, Main and Singleton, but they only save you a few hundred KiB. So, what are the size of the dependencies streamlining as much as possible? If you want a complete redistributable install. x86 - 13 + 17.8 = 30.8MiB (Add on sizes as needed for complete redistributables if you want.) To show that this is actually true. .NET Framework First, the difficulty with the .NET framework Windows App SDK/WinUI3 projects is that they are set as self contained by default. Then there is the issue with the file size of the C#/WinRT SDK Reference package. But setting the project to not be self contained drops the size of the layout down to 33MiB. But it seems there isn't much more that can be done right now since it requires IL trimming. But, once this has been implemented, I wouldn't be surprised to see the raw C# layout get reduced in size to a couple of MiB. With this out of the way, the redistributable components for .NET are the Windows App SDK redistributable mentioned above, and the .NET Framework redistributable. .NET Framework Desktop Redistributable 6.0.8 So this means the expected redistributable size should be. But the other thing to remember is that you are not going to provide the installer uncompressed. A half hearted compression of the application's layout (by just creating a .zip file through Explorer) decreases the size to 8.7MiB. Using a more aggressive compression method (LZMA2) reduces that to under 5MiB. So properly processed the compressed .NET installer package can be: But after seeing this, a blithe response would be, if you only care about size then obviously C++ with WinUI 3 would be the obvious choice. If you really care about size then statically linked C++ using Direct2D would be the best option because you don't have to redistribute anything. But that would be horrible to work with. |
Beta Was this translation helpful? Give feedback.
Well, I didn't want to provide information for this because of the type of question it is.
But since there has been an answer, I really want to provide complete information.
First, let's list the components that could be part of an installer.
C++
Visual C++ redistributable.
x86 - 13MiB
x64 - 24MiB
arm64 - 11MiB
Windows App SDK redistributables
Executable redistributable 56.8MiB for each architecture. (But this installs all packages possible for a system.)
.misx packages
x86 - 17.8MiB
x64 - 20.3MiB
arm64 - 18.3MiB
The thing that you learn about these is that you only have to install what you need. You can also not install packages like DDLM, Main and Singleton, but they only save you a few…