-1

in good old days, I created MFC or some other app, compile it, and I could copy *exe file (or, contens of bin\release folder) to diskette (flashdrive) and give it to my friend. He could simply click on .exe file to start app.

Currently, same procedure can be used for WPF app. UWP app cannot be distributed this way (I should 'publish' it to package, friend has to switch sideloading on in Windows...). But what about WinUI3 app? And what about MAUI app?

I tried to copy contens of bin\debug folder (of WinUI3 app, package) to another location on my own desktop, and click on .exe. Nothing happens (app is not started).

4
  • With UWP or WinUI3 you'll never get the simplicity of deploying a (small) exe, by design (WinUI3 is designed to be shipped in lifecycles smaller than Windows and independent). See this discussion on WinUI3 github.com/microsoft/microsoft-ui-xaml/issues/2500 . With WinUI3 you can however choose packaged vs unpackaged app learn.microsoft.com/en-us/windows/apps/package-and-deploy but it's not "just an exe". You can manage to "pack" your program with dependencies and satellite files into an almost single exe (but it will be like ~200Mb) Commented Feb 1, 2024 at 11:02
  • a) how to pack? bin\ folder contens from winUI3.pack is not sufficient. b) what is newest technology in which I can make "simple exe" (maybe files in folder, but startable as .exe without install), which is small enough to be sent via email in ZIP file? Commented Feb 1, 2024 at 13:29
  • There's no other UI technology than .NET with Winforms or WPF (which are still supported) with .NET or MFC (which is also supported) with C/C++ beyond WinUI3 (which supports .NET and C/C++). You can use various options to pack the file. PublishSingleFile (.NET) learn.microsoft.com/en-us/dotnet/core/deploying/single-file/… etc. Commented Feb 1, 2024 at 13:33
  • WinUI3 has a self-contained deployment guide, Windows App SDK deployment guide for self-contained apps. Also see the Windows App SDK self-contained deployment sample. Commented Feb 2, 2024 at 5:46

1 Answer 1

2

for WinUI 3, you can Create an Exe file like wpf or mfc and you can copy paste in any system (windows 10+) you want. for doing this you need to config some options:

First of all, you need to change App type from packaged to unpackaged. you can do this easily in visual studio

enter image description here

Then you can right click on the project and click on Publish

enter image description here

now you can find your exe file (with some files next to it.) and you can copy paste your publish folder.

Note: By default, publication is created depending on the framework (Framework-Dependent) This means that the size of your published app is reduced, but you have to install the WindowsAppSDK MSIX package (size ~ 80mb) on the user's system.

your app size: ~ 5mb

SDK: ~ 80mb

you can zip/rar all of them and size can be reduced.

Also, you can publish app Self-Contained, which does not need to install the framework. in this case your app size will be 100mb ~ 200mb, but you can zip/rar your publish folder and final size will be 40mb ~ 70mb Which in my opinion is excellent and not too much. Also, if you activate the trim options, its size may be halved.

If you want your app to be just an exe file, you should activate the PublishSingleFile But currently it is not working properly and you have to wait for the next updates.

this is my suggestion for publishing:

add this in your csproj:

<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.