SOLVED

MSIX: How to achieve automatic install of .net 5 required for my application?

%3CLINGO-SUB%20id%3D%22lingo-sub-2372896%22%20slang%3D%22en-US%22%3EMSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2372896%22%20slang%3D%22en-US%22%3E%3CP%3EHi!%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CP%3EI%20wrote%20a%20WPF%20program%20using%20.NET%205%2C%20packed%20it%20into%20the%20MSIX%20bundle%20(Release%2C%20x86%20and%20x64)%20as%20a%20framework-dependent%20package.%20Everything%20seems%20fine%2C%20but%20there%20is%20one%20very%20annoying%20thing%3A%20on%20the%20first%20run%20the%20app%20says%20%22.NET%20runtime%20is%20missing%2C%20would%20you%20like%20to%20install%20it%3F%E2%80%9D.%20If%20you%20click%20yes%2C%20the%20download%20page%20opens%2C%20where%20the%20user%20has%20to%20select%20the%20needed%20runtime%2C%20download%2C%20and%20install%20it.%20Not%20the%20best%20user%20experience%2C%20I'm%20thinking%20about%20how%20to%20improve%20it.%3C%2FP%3E%3CP%3EIs%20there%20an%20option%20to%20add%20.net%205%20runtimes%20(x86%20or%20x64%20depending%20on%20the%20user%20system%2C%20or%20maybe%20both)%20as%20a%20dependency%20so%20it%20installed%20automatically%3F%3C%2FP%3E%3CP%3EI%20know%20I%20can%20define%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fschemas%2Fappinstallerschema%2Felement-dependencies%22%20rel%3D%22noreferrer%20noopener%22%20target%3D%22_blank%22%3Edependencies%3C%2FA%3E%2C%20but%20how%20can%20I%20find%20the%20right%20name%20for%20the%20needed%20dependency%3F%3C%2FP%3E%3CP%3EAlso%2C%20I%20know%20it's%20possible%20to%20define%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fschemas%2Fappxpackage%2Fuapmanifestschema%2Felement-desktop6-installactions%22%20rel%3D%22noreferrer%20noopener%22%20target%3D%22_blank%22%3Ecustom%20install%20action%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ebut%20I%20haven't%20tried%20it%20yet%2C%20because%20I%20want%20to%20find%20a%20simpler%20solution.%20Looks%20like%20for%20that%20option%20I'll%20have%20to%20create%20a%20small%20app%20or%20script%20that%20will%20check%20if%20the%20needed%20runtime%20exists%20and%20if%20not%20-%20check%20the%20platform%20and%20ask%20the%20user%20to%20install%20the%20specific%20version%20of%20the%20runtime.%20Not%20the%20best%20user%20experience%20too.%3C%2FP%3E%3CP%3EOf%20course%2C%20I%20still%20have%20an%20option%20to%20go%20with%20self-contained%2C%20but%20I%20don't%20want%20to%20distribute%20so%20many%20megabytes%20of%20.net%20every%20time%2C%20especially%20given%20the%20fact%20that%20I%20expect%20frequent%20updates.%3C%2FP%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2380541%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2380541%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F149589%22%20target%3D%22_blank%22%3E%40Tim%20Mangan%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F11847%22%20target%3D%22_blank%22%3E%40John%20Vintzel%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147865%22%20target%3D%22_blank%22%3E%40Bogdan%20Mitrache%3C%2FA%3E%20-%20UR%20all%20great%20pros%2C%20if%20somebody%20could%20just%20point%20me%20in%20the%20right%20direction%2C%20I%20would%20be%20very%20glad.%20Thank%20you.%3CBR%20%2F%3EIt%20looks%20like%20quite%20an%20ordinary%20task%2C%20but%20I%20read%20all%20the%20docs%20and%20dozens%20of%20posts%20on%20the%20internet%20and%20didn't%20find%20a%20good%20solution%20for%20it%2C%20I%20think%20I'm%20losing%20something%20obvious.%3CBR%20%2F%3EAs%20I%20understood%2C%20with%20dependencies%20I%20can%20point%20to%20shared%20%22framework%22%20packages%20only%2C%20but%20I%20don't%20have%20one.%20With%20install%20actions%20or%20with%20PSF%20I%20will%20need%20to%20bundle%20the%20Dotnet%20installer%20with%20me%2C%20or%20download%20it%20from%20the%20MS%20site%20and%20run%20it%20with%20%2Fquiet%20(because%20install-dotnet.ps1%20intended%20only%20for%20CI%20machines)%2C%20all%20of%20that%20looks%20far%20from%20an%20optimal%20solution.%20The%20best%20solution%20from%20bad%20ones%20I%20see%20is%20to%20use%20self-contained%20publish%2C%20but%20it's%20not%20the%20best%20too.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381066%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381066%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1058684%22%20target%3D%22_blank%22%3E%40levyas%3C%2FA%3E%26nbsp%3BI%20haven't%20replied%20as%20I%20don't%20know%20the%20package%20name%20you'd%20need.%26nbsp%3B%20But%20ultimately%2C%20the%20AppXManifest%20file%20should%20have%20it%20listed%20as%20a%20Dependency%20package.%26nbsp%3B%20By%20listing%20it%20in%20as%20a%20dependency%20there%2C%20the%20system%20will%20install%20the%20dependency%20for%20you%20from%20the%20Windows%20Store.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20form%20will%20be%20something%20like%20this%20example%20for%20the%20.Net.Native%20framefwork%3A%20%22Microsoft.Net.Native.Framework.2.2.2.2.29512.0_x64__8wekyb3dbabbwe%22%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20would%20guess%20you%20might%20need%20both%20framework%20and%20runtime%20referenced.%26nbsp%3B%20I'm%20not%20using%20any%20.NET%205%20yet%2C%20so%20I'm%20not%20sure.%26nbsp%3B%20Possibly%20you%20can%20run%20the%20PowerShell%20command%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20get-appxpackage%20-PackageTypeFilter%20Framework%3C%2FP%3E%0A%3CP%3EOn%20a%20system%20where%20the%20sdks%20are%20installed%20and%20they%20might%20show%20up.%26nbsp%3B%20You'd%20want%20value%20from%20the%20PackageFullName%20in%20your%20appxmanifest%20dependencies.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20find%20the%20answer%2C%20please%20post%20back%20and%20share!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381092%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381092%22%20slang%3D%22en-US%22%3EHello%2C%20if%20it's%20an%20application%20based%20on%20.NET%20Core%20%2F%20.NET%205%20(as%20I%20seem%20to%20understand%20from%20the%20description)%2C%20the%20suggested%20and%20best%20way%20to%20distribuite%20via%20MSIX%20is%20to%20use%20the%20self-deployment%20approach.%20Thanks%20to%20MSIX%20features%20like%20differential%20updates%20and%20single%20disk%20instance%2C%20you%20don't%20have%20to%20worry%20too%20much%20about%20the%20increased%20size%2C%20since%20the%20runtime%20will%20be%20downloaded%20only%20at%20the%20first%20install.%3CBR%20%2F%3EOtherwise%2C%20if%20you%20don't%20like%20self-deployment%2C%20you%20will%20need%20to%20use%20a%20script%20to%20pre-install%20the%20runtime.%20You%20can%20leverage%20some%20of%20the%20available%20script%20we%20release%20for%20CI%2FCD%20purposes%20here%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fcore%2Ftools%2Fdotnet-install-script%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fcore%2Ftools%2Fdotnet-install-script%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EI%20hope%20it%20helps!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381490%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381490%22%20slang%3D%22en-US%22%3EThank%20you%20for%20the%20reply!%20You%20gave%20me%20the%20way%20to%20browse%20the%20catalog%20of%20available%20dependencies%3B%20that's%20very%20helpful!%20I%20read%20about%20the%20command%2C%20run%20on%20my%20machine%2C%20looks%20like%20it%20contains%20only%20frameworks%20used%20by%20UWP%20hence%20there%20are%20no%20familiar%20to%20me%20names%20or%20versions%20(like%20.net%204.7%2C%20or%20.net%20core%20or%20.net%205).%20At%20least%20now%20I%20know%20that%20it%20is%20not%20what%20I'm%20looking%20for%2C%20so%20thank%20you%20again.%3CBR%20%2F%3EMaybe%20someday%20regular%20.net%20runtimes%20will%20be%20there%20too%2C%20that'd%20be%20nice.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381539%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381539%22%20slang%3D%22en-US%22%3EThank%20you!%20I%20thought%20about%20using%20the%20install-dotnet.ps1%2C%20but%20looks%20like%20it's%20much%20more%20complicated%20than%20to%20just%20use%20a%20self-contained%20package.%3CBR%20%2F%3EAlso%2C%20I'm%20%22scared%22%20a%20little%20of%20%22To%20set%20up%20a%20development%20environment%20or%20to%20run%20apps%2C%20use%20the%20installers%20rather%20than%20these%20scripts.%22%20and%20the%20fact%20that%20there%20will%20be%20no%20registry%20entries%20or%20persistent%20PATH%20to%20dotnet.%3CBR%20%2F%3ESo%2C%20I'll%20take%20a%20less%20risky%20and%20simpler%20approach%20by%20making%20the%20app%20self-contained.%3CBR%20%2F%3EThank%20you%20again%2C%20Matteo.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2384135%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2384135%22%20slang%3D%22en-US%22%3EHi%20Matheo%2C%20can%20you%20please%20provide%20some%20explanations%20to%20your%20suggestion%20%22to%20use%20a%20script%20to%20pre-install%20the%20runtime%22%3F%20Can%20this%20script%20be%20added%20to%20the%20MSIX%20package%20and%20referenced%20in%20the%20manifest%3F%20If%20yes%2C%20how%3F%3CBR%20%2F%3ECustom%20install%20action%20mentioned%20by%20levyas%20does%20seem%20to%20be%20applicable%20since%20%22it%20is%20intended%20to%20be%20used%20only%20by%20desktop%20PC%20games%20that%20are%20packaged%20in%20an%20MSIXVC%20container%22%20as%20stated%20in%20desktop6%3AInstallActions.%20If%20instead%20of%20running%20scripts%2C%20it%20would%20be%20possible%20to%20add%20the%20.NET%205%20and%20ASP..Net%20references%20as%20Dependency%20packages%20to%20the%20AppXManifest%20file%2C%20could%20you%20provide%20an%20example%20of%20such%20an%20extension%20deploying%20.NET%205%20and%20ASP.%2CNet%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2381072%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2381072%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1058684%22%20target%3D%22_blank%22%3E%40levyas%3C%2FA%3E%26nbsp%3BAdding%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F44595%22%20target%3D%22_blank%22%3E%40Matteo%20Pagani%3C%2FA%3E%26nbsp%3Bfor%20possible%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2430673%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2430673%22%20slang%3D%22en-US%22%3EHi%20Matteo%2C%3CBR%20%2F%3ETwo%20weeks%20ago%20I%20asked%20you%20to%20explain%20how%20to%20add%20.NET%205%20and%20ASP..Net%20references%20as%20Dependency%20packages%20to%20the%20AppXManifest%20file%20or%20to%20to%20pre-install%20the%20runtime%20using%20a%20script%20Thanks%20in%20advance%20for%20your%20suggestions%20and%20recommendations.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2430781%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2430781%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146856%22%20target%3D%22_blank%22%3E%40Valery%20Atlas%3C%2FA%3E%26nbsp%3BI%20apologize%2C%20I%20missed%20the%20notification%20about%20your%20question.%20In%20a%20.NET%205%20scenario%2C%20the%20best%20to%20achieve%20what%20you're%20trying%20to%20do%20is%20to%20use%20the%20self-contained%20deployment%20model%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fcore%2Fdeploying%2F%23publish-self-contained%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fcore%2Fdeploying%2F%23publish-self-contained%3C%2FA%3E)%2C%20where%20the%20full%20runtime%20and%20all%20its%20dependencies%20will%20be%20included%20inside%20the%20package.%3C%2FP%3E%0A%3CP%3EScripts%20can%20be%20executed%20at%20the%20first%20launch%20using%20the%20Package%20Support%20Framework%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fpsf%2Frun-scripts-with-package-support-framework%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fpsf%2Frun-scripts-with-package-support-framework%3C%2FA%3E)%2C%20but%20they%20still%20run%20inside%20the%20container%2C%20so%20it's%20not%20a%20good%20way%20to%20install%20dependencies%20which%20must%20be%20system-wide.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20it%20helps!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2430841%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2430841%22%20slang%3D%22en-US%22%3EHi%20Matteo%2C%3CBR%20%2F%3EThanks%20for%20your%20considerations.%3CBR%20%2F%3EThe%20self-contained%20deployment%20model%20seems%20to%20have%20significant%20security%20related%20issues%20and%20may%20require%20regular%20patches%20from%20ISVs.%20This%20is%20what%20Microsoft%20Tech%20Support%20experts%20mentioned%20in%20their%20reply%20to%20my%20inquiry%20about%20deploying%20..NET%20and%20Asp.NET%20components.%20They%20said%20that%20the%20global%20distribution%20of%20these%20prerequisites%20is%20the%20most%20reliable%20option%20that%20has%20a%20number%20of%20advantages%2C%20If%20you%20wish%2C%20I%20can%20share%20with%20you%20our%20email%20exchange.%3CBR%20%2F%3EThis%20is%20why%20I%20would%20like%20to%20concretize%20how%20to%20deploy%20the%20redistributable%20packages%2C%20such%20as%20.NET%2C%20Asp..NET%20or%20.NET%20SDK.%20Running%20a%20script%20using%20PSF%20seems%20to%20be%20quite%20problematic%20because%20deployment%20of%20these%20prerequisites%20will%20require%20elevation.%20Is%20it%20possible%20to%20add%20the%20.NET%205%20and%20ASP..Net%20references%20as%20Dependency%20packages%20to%20the%20AppXManifest%20file%3F%3CBR%20%2F%3EThanks%20for%20your%20suggestions!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2430845%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2430845%22%20slang%3D%22en-US%22%3ENo%2C%20unfortunately%20that's%20not%20possible.%20The%20Dependencies%20section%20of%20the%20manifest%20supports%20only%20a%20very%20specific%20subset%20of%20packages%20created%20by%20the%20Windows%20team%2C%20like%20VC%2B%2B%20libraries%20or%20the%20Project%20Reunion%20framework.%20.NET%20and%20ASP.NET%20aren't%20supported%20dependencies.%20I'm%20afraid%20that%2C%20if%20you%20want%20to%20go%20with%20MSIX%2C%20your%20best%20option%20is%20to%20use%20self-contained.%20I%20don't%20fully%20agree%20that%20the%20self-contained%20model%20has%20significant%20security%20issues%20but%2C%20for%20sure%2C%20it%20requires%20the%20ISV%20to%20own%20the%20patching%20and%20updating%20of%20the%20runtime%20(which%20might%20make%20things%20complicated%20in%20big%20enteprise%20environment%2C%20where%20a%20new%20version%20of%20the%20app%20must%20be%20deployed%20to%20all%20the%20devices%20in%20the%20company).%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2430857%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2430857%22%20slang%3D%22en-US%22%3EWell%2C%20this%20seems%20to%20be%20a%20significant%20limitation.%20Why%20are%20VC%2B%2B%20libraries%20or%20the%20Project%20Reunion%20framework%20supported%20for%20such%20a%20distribution%2C%20whereas%20.NET%20prerequisites%20cannot%20be%20added%20to%20this%20%22very%20specific%20subset%20of%20packages%22%3F%3CBR%20%2F%3EAs%20you%20mentioned%2C%20a%20self-containing%20deployment%20model%20does%20make%20things%20complicated%20in%20a%20big%20enterprise%20environment%2C%20this%20is%20why%20it%20would%20be%20very%20advantageous%20to%20provide%20the%20support%20for%20distribution%20of%20.NET%20prerequisites%20using%20the%20Dependencies%20section%20of%20the%20manifest.%20Why%20.NET%20prerequisites%20have%20a%20different%20status%20compared%20with%20VC%2B%2B%20runtime%20and%20what%20are%20the%20main%20obstacles%20for%20adding%20the%20to%20the%20subset%20of%20the%20supported%20packages%3F%3CBR%20%2F%3EAs%20long%20as%20this%20support%20is%20not%20provided%2C%20how%20to%20use%20the%20script%20related%20alternative%20mentioned%20in%20your%20message%3F%20Script%20will%20require%20elevation%2C%20and%20this%20will%20mean%20that%20the%20%3Bmain%20app%20in%20the%20MSIX%20package%20will%20be%20launched%20prior%20to%20completing%20the%20script%20execution.%20Can%20you%20please%20shed%20some%20light%20on%20this%20alternate%20option%20or%2C%20perhaps%2C%20provide%20a%20simple%20example%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2430966%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2430966%22%20slang%3D%22en-US%22%3EYours%20is%20a%20good%20question%2C%20but%20I%20don't%20really%20have%20an%20answer%20unfortunately.%20.NET%20uses%20different%20distribution%20channels%20for%20their%20runtimes%2C%20and%20they%20aren't%20currently%20distributed%20as%20MSIX%2C%20therefore%20they%20aren't%20available%20as%20dependencies.%20%3CBR%20%2F%3EAs%20I%20mentioned%20in%20the%20other%20comment%2C%20the%20scripting%20option%20wouldn't%20be%20a%20good%20fit%20here.%20Since%20the%20script%20is%20executed%20inside%20the%20same%20container%20of%20the%20MSIX%20packaged%20app%2C%20this%20feature%20isn't%20a%20good%20fit%20for%20dependencies%20which%20must%20be%20installed%20system%20wide%20(like%20the%20.NET%20runtime)%20and%20with%20administrative%20rights.%3CBR%20%2F%3EUnfortunately%2C%20out%20of%20the%20box%2C%20I%20can't%20think%20of%20an%20easy%20solution%20for%20your%20scenario%20other%20than%20using%20self-contained%20deployment.%20Sorry!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2430990%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2430990%22%20slang%3D%22en-US%22%3EThanks%20for%20your%20considerations%2C%20Matteo.%20As%20you%20can%20see%2C%20this%20seems%20to%20be%20a%20common%20deployment%20scenario%2C%20and%20in%20many%20cases%20a%20system-wide%20deployment%20of%20.NET%20prerequisites%20may%20be%20the%20only%20plausible%20option.%20BTW%2C%20the%20popular%20MsixHero%20tool%20also%20utilizes%20the%20.NET%20system-wide%20deployment%20model%20instead%20of%20rather%20problematic%20self-contained%20option%2C%20and%20adding%20support%20for%20.NET%20distribution%20would%20significantly%20simplify%20its%20deployment.%20I%20would%20appreciate%20if%20you%20could%20submit%20to%20the%20MSIX%20team%20the%20request%20to%20add%20at%20least%20.NET%20and%20Asp.NET%20packages%20to%20the%20subset%20of%20supported%20libraries%2C%20this%20would%20be%20indeed%20very%20helpful.%20Thank%20you%20very%20much%20in%20advance!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2431258%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2431258%22%20slang%3D%22en-US%22%3ETo%20state%20the%20obvious%2C%20if%20Microsoft%20wants%20to%20encourage%20developers%20to%20move%20to%20these%20technologies%2C%20there%20must%20be%20a%20better%20way%20to%20handle%20the%20dependencies%20outside%20of%20those%20suggested%20here.%20The%20same%20reasons%20for%20wanting%20the%20components%20outlined%20by%20Matteo%20that%20are%20supported%20as%20package%20dependencies%20apply%20to%20.Net%205%2C%20and%20Microsoft%20should%20add%20a%20solution.%20The%20package%20dependency%20route%20seems%20the%20most%20obvious%20to%20me%2C%20but%20I'm%20guessing%20there%20are%20technical%20reasons%20this%20hasn't%20been%20(yet).%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2431277%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2431277%22%20slang%3D%22en-US%22%3EThanks%20for%20the%20feedback%20Timothy%20and%20Valery.%20I'll%20make%20sure%20to%20convey%20it%20to%20the%20MSIX%20team%2C%20to%20see%20if%20they%20can%20start%20a%20conversation%20with%20the%20.NET%20team%20on%20this%20topic.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2431384%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2431384%22%20slang%3D%22en-US%22%3EMany%20thanks%2C%20Matteo%2C%20much%20appreciated!%3CBR%20%2F%3EI%20think%20the%20requested%20extension%20will%20be%20very%20beneficial%20for%20ISVs.%3CBR%20%2F%3EBTW%2C%20I%20have%20a%20question%20about%20your%20recommendations%20in%20Chapter%204%20of%20your%20MSIX%20Succinctly%20book%20(%3CA%20href%3D%22https%3A%2F%2Fwww.syncfusion.com%2Fsuccinctly-free-ebooks%2Fmsix-succinctly%2Fthe-package-support-framework%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.syncfusion.com%2Fsuccinctly-free-ebooks%2Fmsix-succinctly%2Fthe-package-support-framework%3C%2FA%3E)%20Would%20it%20be%20possible%20to%20clarify%20with%20you%20some%20issues%20in%20this%20regard%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2431410%22%20slang%3D%22en-US%22%3ERe%3A%20MSIX%3A%20How%20to%20achieve%20automatic%20install%20of%20.net%205%20required%20for%20my%20application%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2431410%22%20slang%3D%22en-US%22%3ESure%2C%20feel%20free%20to%20send%20me%20a%20mail%20at%20name.surname%20%5Bat%5D%20microsoft.com%3C%2FLINGO-BODY%3E
Occasional Contributor

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 first run the app says ".NET runtime is missing, would you like to install it?”. If you click yes, the download page opens, where the user has to select the needed runtime, download, and install it. Not the best user experience, I'm thinking about how to improve it.

Is there an option to add .net 5 runtimes (x86 or x64 depending on the user system, or maybe both) as a dependency so it installed automatically?

I know I can define dependencies, but how can I find the right name for the needed dependency?

Also, I know it's possible to define custom install action but I haven't tried it yet, because I want to find a simpler solution. Looks like for that option I'll have to create a small app or script that will check if the needed runtime exists and if not - check the platform and ask the user to install the specific version of the runtime. Not the best user experience too.

Of course, I still have an option to go with self-contained, but I don't want to distribute so many megabytes of .net every time, especially given the fact that I expect frequent updates.

 
 
18 Replies
@Tim Mangan, @TIMOTHY MANGAN, @John Vintzel, @Bogdan Mitrache - UR all great pros, if somebody could just point me in the right direction, I would be very glad. Thank you.
It looks like quite an ordinary task, but I read all the docs and dozens of posts on the internet and didn't find a good solution for it, I think I'm losing something obvious.
As I understood, with dependencies I can point to shared "framework" packages only, but I don't have one. With install actions or with PSF I will need to bundle the Dotnet installer with me, or download it from the MS site and run it with /quiet (because install-dotnet.ps1 intended only for CI machines), all of that looks far from an optimal solution. The best solution from bad ones I see is to use self-contained publish, but it's not the best too.

@levyas I haven't replied as I don't know the package name you'd need.  But ultimately, the AppXManifest file should have it listed as a Dependency package.  By listing it in as a dependency there, the system will install the dependency for you from the Windows Store.

 

The form will be something like this example for the .Net.Native framefwork: "Microsoft.Net.Native.Framework.2.2.2.2.29512.0_x64__8wekyb3dbabbwe"

 

I would guess you might need both framework and runtime referenced.  I'm not using any .NET 5 yet, so I'm not sure.  Possibly you can run the PowerShell command

              get-appxpackage -PackageTypeFilter Framework

On a system where the sdks are installed and they might show up.  You'd want value from the PackageFullName in your appxmanifest dependencies.

 

If you find the answer, please post back and share!

 

best response confirmed by levyas (Occasional Contributor)
Solution
Hello, 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!
Thank you for the reply! You gave me the way to browse the catalog of available dependencies; that's very helpful! I read about the command, run on my machine, looks like it contains only frameworks used by UWP hence there are no familiar to me names or versions (like .net 4.7, or .net core or .net 5). At least now I know that it is not what I'm looking for, so thank you again.
Maybe someday regular .net runtimes will be there too, that'd be nice.
Thank 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.
Hi 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?
Hi 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.

@Valery Atlas 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!

Hi 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!
No, unfortunately that's not possible. The Dependencies section of the manifest supports only a very specific subset of packages created by the Windows team, like VC++ libraries or the Project Reunion framework. .NET and ASP.NET aren't supported dependencies. I'm afraid that, if you want to go with MSIX, your best option is to use self-contained. I don't fully agree that the self-contained model has significant security issues but, for sure, it requires the ISV to own the patching and updating of the runtime (which might make things complicated in big enteprise environment, where a new version of the app must be deployed to all the devices in the company).
Well, this seems to be a significant limitation. Why are VC++ libraries or the Project Reunion framework supported for such a distribution, whereas .NET prerequisites cannot be added to this "very specific subset of packages"?
As you mentioned, a self-containing deployment model does make things complicated in a big enterprise environment, this is why it would be very advantageous to provide the support for distribution of .NET prerequisites using the Dependencies section of the manifest. Why .NET prerequisites have a different status compared with VC++ runtime and what are the main obstacles for adding the to the subset of the supported packages?
As long as this support is not provided, how to use the script related alternative mentioned in your message? Script will require elevation, and this will mean that the ;main app in the MSIX package will be launched prior to completing the script execution. Can you please shed some light on this alternate option or, perhaps, provide a simple example?
Yours is a good question, but I don't really have an answer unfortunately. .NET uses different distribution channels for their runtimes, and they aren't currently distributed as MSIX, therefore they aren't available as dependencies.
As I mentioned in the other comment, the scripting option wouldn't be a good fit here. Since the script is executed inside the same container of the MSIX packaged app, this feature isn't a good fit for dependencies which must be installed system wide (like the .NET runtime) and with administrative rights.
Unfortunately, out of the box, I can't think of an easy solution for your scenario other than using self-contained deployment. Sorry!
Thanks for your considerations, Matteo. As you can see, this seems to be a common deployment scenario, and in many cases a system-wide deployment of .NET prerequisites may be the only plausible option. BTW, the popular MsixHero tool also utilizes the .NET system-wide deployment model instead of rather problematic self-contained option, and adding support for .NET distribution would significantly simplify its deployment. I would appreciate if you could submit to the MSIX team the request to add at least .NET and Asp.NET packages to the subset of supported libraries, this would be indeed very helpful. Thank you very much in advance!
To state the obvious, if Microsoft wants to encourage developers to move to these technologies, there must be a better way to handle the dependencies outside of those suggested here. The same reasons for wanting the components outlined by Matteo that are supported as package dependencies apply to .Net 5, and Microsoft should add a solution. The package dependency route seems the most obvious to me, but I'm guessing there are technical reasons this hasn't been (yet).
Thanks for the feedback Timothy and Valery. I'll make sure to convey it to the MSIX team, to see if they can start a conversation with the .NET team on this topic.
Many thanks, Matteo, much appreciated!
I think the requested extension will be very beneficial for ISVs.
BTW, I have a question about your recommendations in Chapter 4 of your MSIX Succinctly book (https://www.syncfusion.com/succinctly-free-ebooks/msix-succinctly/the-package-support-framework) Would it be possible to clarify with you some issues in this regard?
Sure, feel free to send me a mail at name.surname [at] microsoft.com