Forum Discussion
levyas
May 20, 2021Brass Contributor
MSIX: How to achieve automatic install of .net 5 required for my application?
Hi! I wrote a WPF program using .NET 5, packed it into the MSIX bundle (Release, x86 and x64) as a framework-dependent package. Everything seems fine, but there is one very annoying thing: on the ...
- May 24, 2021Hello, if it's an application based on .NET Core / .NET 5 (as I seem to understand from the description), the suggested and best way to distribuite via MSIX is to use the self-deployment approach. Thanks to MSIX features like differential updates and single disk instance, you don't have to worry too much about the increased size, since the runtime will be downloaded only at the first install.
Otherwise, if you don't like self-deployment, you will need to use a script to pre-install the runtime. You can leverage some of the available script we release for CI/CD purposes here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
I hope it helps!
May 24, 2021
levyas Adding Matteo Pagani for possible help.
Matteo Pagani
Microsoft
May 24, 2021Hello, if it's an application based on .NET Core / .NET 5 (as I seem to understand from the description), the suggested and best way to distribuite via MSIX is to use the self-deployment approach. Thanks to MSIX features like differential updates and single disk instance, you don't have to worry too much about the increased size, since the runtime will be downloaded only at the first install.
Otherwise, if you don't like self-deployment, you will need to use a script to pre-install the runtime. You can leverage some of the available script we release for CI/CD purposes here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
I hope it helps!
Otherwise, if you don't like self-deployment, you will need to use a script to pre-install the runtime. You can leverage some of the available script we release for CI/CD purposes here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
I hope it helps!
- Telemak68Jun 09, 2021Copper ContributorHi Matteo,
Two weeks ago I asked you to explain how to add .NET 5 and ASP..Net references as Dependency packages to the AppXManifest file or to to pre-install the runtime using a script Thanks in advance for your suggestions and recommendations.- Matteo PaganiJun 09, 2021
Microsoft
Telemak68 I apologize, I missed the notification about your question. In a .NET 5 scenario, the best to achieve what you're trying to do is to use the self-contained deployment model (https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained), where the full runtime and all its dependencies will be included inside the package.
Scripts can be executed at the first launch using the Package Support Framework (https://docs.microsoft.com/en-us/windows/msix/psf/run-scripts-with-package-support-framework), but they still run inside the container, so it's not a good way to install dependencies which must be system-wide.
I hope it helps!
- Telemak68Jun 09, 2021Copper ContributorHi Matteo,
Thanks for your considerations.
The self-contained deployment model seems to have significant security related issues and may require regular patches from ISVs. This is what Microsoft Tech Support experts mentioned in their reply to my inquiry about deploying ..NET and Asp.NET components. They said that the global distribution of these prerequisites is the most reliable option that has a number of advantages, If you wish, I can share with you our email exchange.
This is why I would like to concretize how to deploy the redistributable packages, such as .NET, Asp..NET or .NET SDK. Running a script using PSF seems to be quite problematic because deployment of these prerequisites will require elevation. Is it possible to add the .NET 5 and ASP..Net references as Dependency packages to the AppXManifest file?
Thanks for your suggestions!
- Telemak68May 25, 2021Copper ContributorHi Matheo, can you please provide some explanations to your suggestion "to use a script to pre-install the runtime"? Can this script be added to the MSIX package and referenced in the manifest? If yes, how?
Custom install action mentioned by levyas does seem to be applicable since "it is intended to be used only by desktop PC games that are packaged in an MSIXVC container" as stated in desktop6:InstallActions. If instead of running scripts, it would be possible to add the .NET 5 and ASP..Net references as Dependency packages to the AppXManifest file, could you provide an example of such an extension deploying .NET 5 and ASP.,Net? - levyasMay 24, 2021Brass ContributorThank you! I thought about using the install-dotnet.ps1, but looks like it's much more complicated than to just use a self-contained package.
Also, I'm "scared" a little of "To set up a development environment or to run apps, use the installers rather than these scripts." and the fact that there will be no registry entries or persistent PATH to dotnet.
So, I'll take a less risky and simpler approach by making the app self-contained.
Thank you again, Matteo.