How to use AddOptionalPackageAsync?

%3CLINGO-SUB%20id%3D%22lingo-sub-1449002%22%20slang%3D%22en-US%22%3EHow%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1449002%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20build%20a%20MSIX%20solution%20for%20the%20%5BJulia%5D(%3CA%20href%3D%22https%3A%2F%2Fjulialang.org%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fjulialang.org%2F%3C%2FA%3E)%20language%2C%20but%20I'm%20stuck%20in%20that%20I%20can't%20get%20AddOptionalPackageAsync%20to%20work.%20In%20general%2C%20I'm%20using%20a%20PackagingLayout.xml%20that%20creates%20a%20bunch%20of%20packages%20and%20upload%20them%20all%20to%20a%20S3%20bucket.%20I%20then%20also%20upload%20an%20appinstaller%20file.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20what%20works%3A%20I%20can%20install%20the%20main%20app%20from%20the%20appinstaller%20file%2C%20and%20it%20also%20successfully%20installs%20the%20optional%20packages%20that%20I%20specify%20as%20optional%20in%20the%20appinstaller%20file.%20What%20doesn't%20work%20is%20my%20attempt%20to%20install%20additional%20optional%20packages%20from%20code%20with%20a%20call%20to%20AddOptionalPackageAsync.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20code%20that%20I'm%20using%20to%20call%20AddOptionalPackageAsync%20looks%20like%20this%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-cpp%22%3E%3CCODE%3Eauto%20packageToInstall%20%3D%20L%22Julia-1.4.2%22%3B%0A%0Aauto%20res%20%3D%20catalog.AddOptionalPackageAsync(packageToInstall).get()%3B%0A%0Aauto%20err%20%3D%20hresult_error(res.ExtendedError())%3B%0A%0Astd%3A%3Awcout%20%26lt%3B%26lt%3B%20err.message().c_str()%20%26lt%3B%26lt%3B%20std%3A%3Aendl%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20produces%20an%20output%20of%20%22Access%20is%20denied.%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20content%20of%20the%20Julia.appinstaller%20is%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-basic%22%3E%3CCODE%3E%0A%3CAPPINSTALLER%20xmlns%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fappinstaller%2F2017%2F2%22%20version%3D%221.0.0.0%22%20uri%3D%22https%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2FJulia.appinstaller%22%3E%0A%0A%20%20%20%20%3CMAINBUNDLE%20name%3D%22Julia%22%20publisher%3D%22CN%3DJulialang%22%20version%3D%221.0.0.0%22%20uri%3D%22https%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2FJulia.appxbundle%22%3E%3C%2FMAINBUNDLE%3E%0A%0A%20%20%20%20%3COPTIONALPACKAGES%3E%0A%20%20%20%20%20%20%20%20%3CBUNDLE%20name%3D%22Julia-1.4.1%22%20publisher%3D%22CN%3DJulialang%22%20version%3D%221.0.0.0%22%20uri%3D%22https%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2FJulia-1.4.1.appxbundle%22%3E%3C%2FBUNDLE%3E%0A%0A%20%20%20%20%3C%2FOPTIONALPACKAGES%3E%0A%0A%20%20%20%20%3CRELATEDPACKAGES%3E%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%3CBUNDLE%20name%3D%22Julia-1.4.2%22%20publisher%3D%22CN%3DJulialang%22%20version%3D%221.0.0.0%22%20uri%3D%22https%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2FJulia-1.4.2.appxbundle%22%3E%3C%2FBUNDLE%3E%0A%0A%20%20%20%20%3C%2FRELATEDPACKAGES%3E%0A%20%20%20%20%0A%20%20%20%20%3CUPDATESETTINGS%3E%0A%20%20%20%20%3CONLAUNCH%20hoursbetweenupdatechecks%3D%220%22%3E%3C%2FONLAUNCH%3E%20%20%20%0A%20%20%3C%2FUPDATESETTINGS%3E%0A%0A%3C%2FAPPINSTALLER%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20package%20%60Julia-1.4.1%60%20(which%20specified%20as%20an%20%3COPTIONALPACKAGES%3E%20child)%20gets%20successfully%20installed%20with%20the%20main%20app%2C%20and%20if%20I%20swap%20things%20and%20put%20%60Julia-1.4.2%60%20into%20the%20%3COPTIONALPACKAGES%3E%20parent%20and%20%60Julia-1.4.1%60%20into%20the%20%3CRELATEDPACKAGES%3E%20element%2C%20then%20%60Julia-1.4.2%60%20gets%20installed%20correctly%20(but%20then%20I%20can't%20get%26nbsp%3BAddOptionalPackageAsync%26nbsp%3B%20to%20install%20Julia-1.4.1.%3C%2FRELATEDPACKAGES%3E%3C%2FOPTIONALPACKAGES%3E%3C%2FOPTIONALPACKAGES%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20guess%20I'm%20passing%20the%20wrong%20string%20to%26nbsp%3BAddOptionalPackageAsync%2C%20maybe%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20is%20there%20an%20API%20that%20I%20can%20call%20from%20within%20my%20main%20package%20that%20would%20essentially%20give%20me%20the%20family%20package%20ID%20of%20all%20the%20packages%20that%20I%20have%20listed%20in%20the%20appinstaller%20either%20in%20the%20%3COPTIONALPACKAGES%3E%20or%20in%20the%20%3CRELATEDPACKAGES%3E%20element%3F%3C%2FRELATEDPACKAGES%3E%3C%2FOPTIONALPACKAGES%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOh%2C%20and%20actually%2C%20I'm%20not%20even%20sure%20that%20putting%20things%20into%20the%20%3CRELATEDPACKAGES%3E%20parent%20is%20the%20correct%20move%20%3A)%3C%2Fimg%3E%3C%2FRELATEDPACKAGES%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20is%20much%20appreciated!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1452153%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1452153%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F693020%22%20target%3D%22_blank%22%3E%40davidanthoff%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECan%20you%20try%20add%20the%20second%20package%20under%20optional%20packages%20as%20well%20in%20your%20AppInstaller%20file%20something%20like%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-basic%22%3E%3CCODE%3E%20%3COPTIONALPACKAGES%3E%0A%20%20%20%20%20%20%20%20%3CBUNDLE%20name%3D%22Julia-1.4.1%22%20publisher%3D%22CN%3DJulialang%22%20version%3D%221.0.0.0%22%20uri%3D%22https%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2FJulia-1.4.1.appxbundle%22%3E%3C%2FBUNDLE%3E%0A%20%20%20%20%20%20%20%20%3CBUNDLE%20name%3D%22Julia-1.4.2%22%20publisher%3D%22CN%3DJulialang%22%20version%3D%221.0.0.0%22%20uri%3D%22https%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2FJulia-1.4.2.appxbundle%22%3E%3C%2FBUNDLE%3E%0A%20%3C%2FOPTIONALPACKAGES%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20should%20install%20both%20packages%2C%20or%20is%20that%20not%20your%20desired%20workflow%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20another%20install%20option%20from%20your%20code%2C%20consider%20using%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.management.deployment.packagemanager.addpackagebyappinstallerfileasync%3Fview%3Dwinrt-19041%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAddPackageByAppInstallerFileAsync%3C%2FA%3E%26nbsp%3Bto%20install%20packages%20defined%20in%20your%20AppInstaller%20file.%20You%20can%20find%20other%20AppInstaller%20file%20APIs%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fapp-installer%2Fapp-installer-documentation%23app-installer-file-apis%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAbout%20using%20AddOptionalPackageAsync%20from%20code%2C%20can%20you%20try%20a%20few%20things%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EAdd%20the%20packagemanagement%20capability%20to%20your%20app%20doing%20performing%20the%20install.%3CBR%20%2F%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3CPACKAGE%3E%0A...%0A%0A%20%20%3CCAPABILITIES%3E%0A%20%20%20%20%3CCAPABILITY%20name%3D%22packageManagement%22%3E%3C%2FCAPABILITY%3E%0A%20%20%3C%2FCAPABILITIES%3E%0A%20%20%0A...%0A%3C%2FPACKAGE%3E%E2%80%8B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLI%3E%0A%3CLI%3EUse%20the%20%3CSTRONG%3Epackagefamilyname%3C%2FSTRONG%3E%20when%20calling%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.applicationmodel.packagecatalog.addoptionalpackageasync%3Fview%3Dwinrt-19041%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAddOptionalPackageAsync%3C%2FA%3E%26nbsp%3B-%20you%20can%20get%20the%20specific%20package's%20packagefamilyname%20by%20running%20Get-AppxPackage%20when%20it's%20installed%20on%20a%20machine.%20So%20you'd%20have%20to%20install%20it%20and%20run%20the%20command%20to%20get%20the%20correct%20value%20for%20future%20use.%20There's%20an%20explanation%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmem%2Fconfigmgr%2Fprotect%2Fdeploy-use%2Ffind-a-pfn-for-per-app-vpn%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E%26nbsp%3B%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EMake%20sure%20your%20packages%20are%20part%20of%20a%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fmsix%2Fpackage%2Foptional-packages%23related_sets%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Erelated%20set%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ECheers%2C%3C%2FP%3E%0A%3CP%3ETanaka%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1452249%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1452249%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F387730%22%20target%3D%22_blank%22%3E%40Tanaka_Jimha%3C%2FA%3E%26nbsp%3BThanks!%20I%20tried%20all%20your%20suggestions%2C%20but%20no%20luck%20so%20far.%20Here%20are%20some%20more%20details%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20want%20to%20install%20all%20the%20optional%20dependencies%20at%20the%20same%20time%20when%20the%20main%20app%20is%20installed%2C%20so%20I%20don't%20think%20I%20should%20add%20all%20of%20them%20to%20the%20%3COPTIONALPACKAGES%3E%20element%20in%20the%20appinstaller%20file%2C%20right%3F%20I%20only%20want%20one%20of%20them%20installed%20with%20the%20main%20app%2C%20so%20I%20add%20that%20optional%20package%20to%20the%20%3COPTIONALPACKAGES%3E%20element%2C%20and%20then%20all%20the%20other%20optional%20packages%20I%20want%20to%20be%20able%20to%20install%20via%20an%20in-app%20option%2C%20so%20I%20add%20all%20of%20those%20packages%20to%20the%20%3CRELATEDPACKAGES%3E%20element%20in%20the%20appinstaller%20file.%20You%20can%20see%20the%20details%20of%20how%20I%20do%20this%20in%20the%20code%20that%20I%20posted%20with%20the%20original%20message.%3C%2FRELATEDPACKAGES%3E%3C%2FOPTIONALPACKAGES%3E%3C%2FOPTIONALPACKAGES%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20think%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fuwp%2Fapi%2Fwindows.management.deployment.packagemanager.addpackagebyappinstallerfileasync%3Fview%3Dwinrt-19041%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAddPackageByAppInstallerFileAsync%3C%2FA%3E%26nbsp%3Bfor%20the%20same%20reason%20is%20also%20not%20the%20right%20tool%20to%20implement%20my%20in-app%20feature%20add%20thing%2C%20right%3F%20As%20far%20as%20I%20can%20tell%2C%20it%20doesn't%20provide%20an%20option%20to%20install%20a%20specific%20optional%20package%20of%20the%20app%2C%20right%3F%20Or%20did%20I%20miss%20an%20option%20there%20somewhere%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20add%26nbsp%3B%3CCAPABILITY%20name%3D%22%26quot%3BpackageManagement%26quot%3B%22%3E%3C%2FCAPABILITY%3E%20to%20my%20main%20app%20now%2C%20and%20it%20shows%20up%20in%20the%20UI%20when%20I%20install%20that%2C%20but%20it%20doesn't%20change%20the%20error%20message%20I%20get.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20install%20all%20the%20optional%20packages%20on%20my%20system%2C%20and%20then%20run%20the%20following%20ps%20code%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3E%26gt%3B%20%24x%20%3D%20Get-AppxPackage%20Julia*%0A%26gt%3B%20%24x.Dependencies%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EI%20get%20this%20output%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20Julia-1.4.1%0APublisher%20%20%20%20%20%20%20%20%20%3A%20CN%3DJulialang%0AArchitecture%20%20%20%20%20%20%3A%20X64%0AResourceId%20%20%20%20%20%20%20%20%3A%0AVersion%20%20%20%20%20%20%20%20%20%20%20%3A%201.0.0.0%0APackageFullName%20%20%20%3A%20Julia-1.4.1_1.0.0.0_x64__87dh6scs60qg2%0AInstallLocation%20%20%20%3A%20C%3A%5CProgram%20Files%5CWindowsApps%5CJulia-1.4.1_1.0.0.0_x64__87dh6scs60qg2%0AIsFramework%20%20%20%20%20%20%20%3A%20False%0APackageFamilyName%20%3A%20Julia-1.4.1_87dh6scs60qg2%0APublisherId%20%20%20%20%20%20%20%3A%2087dh6scs60qg2%0AIsResourcePackage%20%3A%20False%0AIsBundle%20%20%20%20%20%20%20%20%20%20%3A%20False%0AIsDevelopmentMode%20%3A%20False%0ANonRemovable%20%20%20%20%20%20%3A%20False%0AIsPartiallyStaged%20%3A%20False%0ASignatureKind%20%20%20%20%20%3A%20Developer%0AStatus%20%20%20%20%20%20%20%20%20%20%20%20%3A%20Ok%0A%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%20Julia-1.4.2%0APublisher%20%20%20%20%20%20%20%20%20%3A%20CN%3DJulialang%0AArchitecture%20%20%20%20%20%20%3A%20X64%0AResourceId%20%20%20%20%20%20%20%20%3A%0AVersion%20%20%20%20%20%20%20%20%20%20%20%3A%201.0.0.0%0APackageFullName%20%20%20%3A%20Julia-1.4.2_1.0.0.0_x64__87dh6scs60qg2%0AInstallLocation%20%20%20%3A%20C%3A%5CProgram%20Files%5CWindowsApps%5CJulia-1.4.2_1.0.0.0_x64__87dh6scs60qg2%0AIsFramework%20%20%20%20%20%20%20%3A%20False%0APackageFamilyName%20%3A%20Julia-1.4.2_87dh6scs60qg2%0APublisherId%20%20%20%20%20%20%20%3A%2087dh6scs60qg2%0AIsResourcePackage%20%3A%20False%0AIsBundle%20%20%20%20%20%20%20%20%20%20%3A%20False%0AIsDevelopmentMode%20%3A%20False%0ANonRemovable%20%20%20%20%20%20%3A%20False%0AIsPartiallyStaged%20%3A%20False%0ASignatureKind%20%20%20%20%20%3A%20Developer%0AStatus%20%20%20%20%20%20%20%20%20%20%20%20%3A%20Ok%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3ESo%20from%20this%20I%20take%20it%20that%20I%20should%20use%20%22Julia-1.4.2_87dh6scs60qg2%22%20as%20the%20string%20that%20I%20pass%20to%26nbsp%3BAddOptionalPackageAsync%3F%20I'm%20doing%20that%20now%2C%20but%20I%20still%20get%20the%20same%20error%20message%20%22Access%20is%20denied%22.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20do%20think%20everything%20is%20in%20one%20related%20set%2C%20I'm%20creating%20all%20the%20packages%20with%20a%20PackagingLayout.xml%20file%20that%20looks%20like%20this%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%3CPACKAGINGLAYOUT%20xmlns%3D%22http%3A%2F%2Fschemas.microsoft.com%2Fappx%2Fmakeappx%2F2017%22%3E%0A%20%20%3C!--%20Main%20game%20--%3E%0A%20%20%3CPACKAGEFAMILY%20id%3D%22Julia%22%20flatbundle%3D%22true%22%20manifestpath%3D%22appxmanifest.xml%22%20resourcemanager%3D%22false%22%3E%0A%20%20%20%20%0A%20%20%20%20%3C!--%20x64%20code%20package--%3E%0A%20%20%20%20%3CPACKAGE%20id%3D%22Julia-x64%22%20processorarchitecture%3D%22x64%22%3E%0A%20%20%20%20%20%20%3CFILES%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Julia%5CJulia.exe%22%20sourcepath%3D%22C%3A%5CUsers%5Cdavid%5Csource%5Crepos%5CWinJulia%5CRelease%5CJulia.exe%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Images%5C*.png%22%20sourcepath%3D%22Images%5C*.png%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%3C%2FFILES%3E%0A%20%20%20%20%3C%2FPACKAGE%3E%0A%0A%20%20%20%20%0A%20%20%3C%2FPACKAGEFAMILY%3E%0A%0A%20%20%3CPACKAGEFAMILY%20id%3D%22Julia-1.4.2%22%20optional%3D%22true%22%20manifestpath%3D%22juliaversions%5Cjulia-1.4.2-appxmanifest.xml%22%20resourcemanager%3D%22false%22%3E%0A%20%20%20%20%3CPACKAGE%20id%3D%22Julia-1.4.2.x64%22%20processorarchitecture%3D%22x64%22%3E%0A%20%20%20%20%20%20%3CFILES%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Julia%5C**%22%20sourcepath%3D%22C%3A%5CUsers%5Cdavid%5Csource%5Crepos%5CWinJulia%5Coptionalpackages%5Cjulia-1.4.2%5CJulia%5C**%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Images%5C*.png%22%20sourcepath%3D%22Images%5C*.png%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%3C%2FFILES%3E%0A%20%20%20%20%3C%2FPACKAGE%3E%0A%20%20%3C%2FPACKAGEFAMILY%3E%0A%0A%20%20%3CPACKAGEFAMILY%20id%3D%22Julia-1.4.1%22%20optional%3D%22true%22%20manifestpath%3D%22juliaversions%5Cjulia-1.4.1-appxmanifest.xml%22%20resourcemanager%3D%22false%22%3E%0A%20%20%20%20%3CPACKAGE%20id%3D%22Julia-1.4.1.x64%22%20processorarchitecture%3D%22x64%22%3E%0A%20%20%20%20%20%20%3CFILES%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Julia%5C**%22%20sourcepath%3D%22C%3A%5CUsers%5Cdavid%5Csource%5Crepos%5CWinJulia%5Coptionalpackages%5Cjulia-1.4.1%5CJulia%5C**%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Images%5C*.png%22%20sourcepath%3D%22Images%5C*.png%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%3C%2FFILES%3E%0A%20%20%20%20%3C%2FPACKAGE%3E%0A%20%20%3C%2FPACKAGEFAMILY%3E%0A%0A%20%20%3CPACKAGEFAMILY%20id%3D%22Julia-1.4.0%22%20optional%3D%22true%22%20manifestpath%3D%22juliaversions%5Cjulia-1.4.0-appxmanifest.xml%22%20resourcemanager%3D%22false%22%3E%0A%20%20%20%20%3CPACKAGE%20id%3D%22Julia-1.4.0.x64%22%20processorarchitecture%3D%22x64%22%3E%0A%20%20%20%20%20%20%3CFILES%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Julia%5C**%22%20sourcepath%3D%22C%3A%5CUsers%5Cdavid%5Csource%5Crepos%5CWinJulia%5Coptionalpackages%5Cjulia-1.4.0%5CJulia%5C**%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%20%20%3CFILE%20destinationpath%3D%22Images%5C*.png%22%20sourcepath%3D%22Images%5C*.png%22%3E%3C%2FFILE%3E%0A%20%20%20%20%20%20%3C%2FFILES%3E%0A%20%20%20%20%3C%2FPACKAGE%3E%0A%20%20%3C%2FPACKAGEFAMILY%3E%0A%3C%2FPACKAGINGLAYOUT%3E%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EAnd%20I%20believe%20that%20should%20create%20all%20packages%20as%20being%20in%20one%20related%20set%2C%20right%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1457203%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1457203%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F693020%22%20target%3D%22_blank%22%3E%40davidanthoff%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAccess%20Denied%20means%20you're%20having%20permission%20issues%20calling%20the%20API.%20Our%20devs%20said%20the%20fastest%20way%20to%20root%20cause%20will%20be%20to%20get%20logs.%20Can%20you%20please%20make%20a%20Feedback%20Hub%20submission%20capturing%20the%20error%20in%20the%20Developer%20Platform%20%26gt%3B%20App%20Deployment%20category%3A%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22DeploymentFeedbackSettings.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F198195i48615C5990533564%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22DeploymentFeedbackSettings.png%22%20alt%3D%22DeploymentFeedbackSettings.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20capturing%20the%20issue%2C%20can%20you%20also%20attach%20the%20appxmanifest.xml%20files%20of%20your%20main%20app%20and%20optional%20packages%20with%20the%20submission.%20Please%20send%20me%20a%20link%20to%20the%20issue%20once%20you're%20done.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%2C%3C%2FP%3E%0A%3CP%3ETanaka%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1457613%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1457613%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F387730%22%20target%3D%22_blank%22%3E%40Tanaka_Jimha%3C%2FA%3E%26nbsp%3B%20Here%20is%20the%20link%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FAA8obl4%2C%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2FAA8obl4%2C%3C%2FA%3E%26nbsp%3Bhope%20that%20helps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20also%20preparing%20a%20GitHub%20repo%20with%20all%20the%20code%20that%20I%20use%20to%20create%20these%20msix%20packages%2C%20it%20is%20all%20open%20source%2C%20so%20no%20problem%20to%20share%20that.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1457653%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1457653%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F693020%22%20target%3D%22_blank%22%3E%40davidanthoff%3C%2FA%3E%26nbsp%3BActually%2C%20I%20just%20realized%20that%20it%20will%20take%20a%20little%20longer%20until%20I%20can%20publish%20that%20GitHub%20repo%3A%20right%20now%20I%20have%20a%20codesigning%20cert%20that%20includes%20my%20private%20address%2C%20and%20I%20don't%20want%20to%20use%20that%20on%20the%20public%20internet.%20I'm%20working%20with%20my%20issuer%20right%20now%20to%20remove%20the%20address%2C%20as%20soon%20as%20I%20have%20that%2C%20I'll%20post%20it.%20But%20the%20issue%20I%20submitted%20on%20the%20feedback%20hub%20should%20include%20the%20necessary%20files.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1464069%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1464069%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20submitting%20the%20files%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F693020%22%20target%3D%22_blank%22%3E%40davidanthoff%3C%2FA%3E.%20I've%20forwarded%20them%20to%20the%20dev%20team%20for%20investigation.%20sounds%20good%2C%20let%20me%20know%20when%20you%20have%20the%20GitHib%20repo%20available%20and%20I'll%20also%20have%20a%20look%20at%20that.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1478215%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1478215%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F387730%22%20target%3D%22_blank%22%3E%40Tanaka_Jimha%3C%2FA%3E%26nbsp%3BAlright%2C%20I've%20got%20the%20github%20repo%20up%20now%2C%20it%20is%20here%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdavidanthoff%2Fwinjulia%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fdavidanthoff%2Fwinjulia%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20won't%20be%20able%20to%20run%20the%20build%20steps%20because%20you%20also%20need%20various%20builds%20of%20Julia%20itself%2C%20and%20setting%20that%20up%20is%20complicated%2C%20but%20it%20should%20give%20you%20an%20idea%20of%20what%20scripts%20I'm%20using%20to%20build%20things.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20also%20hosting%20the%20packages%20that%20I've%20created%20online%20now%20at%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2Findex.html%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwinjulia.s3-us-west-1.amazonaws.com%2Findex.html%3C%2FA%3E%2C%20so%20you%20and%20the%20dev%20team%20should%20be%20able%20to%20run%20the%20installer%20etc.%20on%20your%20own%20system%20and%20collect%20logs.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20are%20some%20random%20comments%20that%20maybe%20are%20helpful%3A%3C%2FP%3E%3CUL%3E%3CLI%3EThe%20link%20%22Install%20Julia%22%20on%20that%20S3%20website%20that%20I%20posted%20links%20to%20the%20appinstaller%20file.%20It%20will%20install%20the%20%22Julia%22%20package%2C%20and%20one%20of%20the%20optional%20packages%2C%20namely%20Julia-1.4.1.%20There%20are%20two%20other%20optional%20packages%20(Julia-1.4.0%20and%20Julia-1.4.2)%2C%20and%20the%20website%20has%20links%20to%20all%20three%20optional%20packages.%3C%2FLI%3E%3CLI%3EInstalling%20any%20of%20the%20three%20optional%20packages%20via%20the%20weblink%20from%20that%20S3%20site%20works.%3C%2FLI%3E%3CLI%3EWhat%20I%20want%20to%20do%20is%20install%20optional%20packages%20from%20in-app%20code%2C%20though.%20The%20specific%20code%20that%20I'm%20using%20for%20that%20is%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fdavidanthoff%2Fwinjulia%2Fblob%2F4ac34b6d0f4a434ef1902ecf24c17a8a3da65e64%2Flauncher%2Fmain.cpp%23L97%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E%2C%20and%20that%20is%20also%20the%20part%20of%20the%20code%20that%20errors.%20If%20you%20install%20the%20main%20%22Julia%22%20app%20from%20the%20website%20that%20I%20linked%20to%20and%20run%20it%2C%20you%20will%20see%20an%20error%20message%2C%20and%20the%20code%20that%20I%20linked%20to%20in%20this%20item%20here%20is%20where%20that%20error%20occurs.%3C%2FLI%3E%3C%2FUL%3E%3CP%3ELet%20me%20know%20if%20this%20helps%20or%20if%20you%20need%20any%20more%20information!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1487713%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1487713%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F693020%22%20target%3D%22_blank%22%3E%40davidanthoff%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20for%20all%20the%20details%20you%20sent.%20Based%20on%20the%20logs%20from%20the%20feedback%20you%20filed%20it%20looks%20like%20the%20%22access%20denied%22%20error%20is%20happening%20when%20we%20try%20to%20access%20the%20AppInstaller%20file%20on%20S3%20to%20get%20information%20for%20downloading%20the%20optional%20package.%20I'll%20message%20you%20more%20details.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETanaka%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1487764%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20use%20AddOptionalPackageAsync%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1487764%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F387730%22%20target%3D%22_blank%22%3E%40Tanaka_Jimha%3C%2FA%3E%26nbsp%3BCool!%20Do%20you%20think%20there%20will%20be%20a%20fairly%20easy%20way%20for%20me%20to%20fix%20this%2C%20or%20is%20this%20a%20more%20complicated%20problem%3F%20I'm%20not%20tied%20to%20S3%20either%2C%20would%20be%20happy%20to%20use%20some%20other%20hosting%20as%20well.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I'm trying to build a MSIX solution for the [Julia](https://julialang.org/) language, but I'm stuck in that I can't get AddOptionalPackageAsync to work. In general, I'm using a PackagingLayout.xml that creates a bunch of packages and upload them all to a S3 bucket. I then also upload an appinstaller file.

 

Here is what works: I can install the main app from the appinstaller file, and it also successfully installs the optional packages that I specify as optional in the appinstaller file. What doesn't work is my attempt to install additional optional packages from code with a call to AddOptionalPackageAsync.

 

The code that I'm using to call AddOptionalPackageAsync looks like this:

 

auto packageToInstall = L"Julia-1.4.2";

auto res = catalog.AddOptionalPackageAsync(packageToInstall).get();

auto err = hresult_error(res.ExtendedError());

std::wcout << err.message().c_str() << std::endl;

 

This produces an output of "Access is denied.".

 

The content of the Julia.appinstaller is

 

<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
    xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"
    Version="1.0.0.0"
    Uri="https://winjulia.s3-us-west-1.amazonaws.com/Julia.appinstaller" >

    <MainBundle
        Name="Julia"
        Publisher="CN=Julialang"
        Version="1.0.0.0"
        Uri="https://winjulia.s3-us-west-1.amazonaws.com/Julia.appxbundle" />

    <OptionalPackages>
        <Bundle
            Name="Julia-1.4.1"
            Publisher="CN=Julialang"
            Version="1.0.0.0"
            Uri="https://winjulia.s3-us-west-1.amazonaws.com/Julia-1.4.1.appxbundle" />

    </OptionalPackages>

    <RelatedPackages>
        
        <Bundle
            Name="Julia-1.4.2"
            Publisher="CN=Julialang"
            Version="1.0.0.0"
            Uri="https://winjulia.s3-us-west-1.amazonaws.com/Julia-1.4.2.appxbundle" />

    </RelatedPackages>
    
    <UpdateSettings>
    <OnLaunch HoursBetweenUpdateChecks="0"/>   
  </UpdateSettings>

</AppInstaller>

 

The package `Julia-1.4.1` (which specified as an <OptionalPackages> child) gets successfully installed with the main app, and if I swap things and put `Julia-1.4.2` into the <OptionalPackages> parent and `Julia-1.4.1` into the <RelatedPackages> element, then `Julia-1.4.2` gets installed correctly (but then I can't get AddOptionalPackageAsync  to install Julia-1.4.1.

 

I guess I'm passing the wrong string to AddOptionalPackageAsync, maybe?

 

Also, is there an API that I can call from within my main package that would essentially give me the family package ID of all the packages that I have listed in the appinstaller either in the <OptionalPackages> or in the <RelatedPackages> element?

 

Oh, and actually, I'm not even sure that putting things into the <RelatedPackages> parent is the correct move :)

 

Any help is much appreciated!

9 Replies
Highlighted

Hi @davidanthoff,

 

Can you try add the second package under optional packages as well in your AppInstaller file something like this:

 

 <OptionalPackages>
        <Bundle
            Name="Julia-1.4.1"
            Publisher="CN=Julialang"
            Version="1.0.0.0"
            Uri="https://winjulia.s3-us-west-1.amazonaws.com/Julia-1.4.1.appxbundle" />
        <Bundle
            Name="Julia-1.4.2"
            Publisher="CN=Julialang"
            Version="1.0.0.0"
            Uri="https://winjulia.s3-us-west-1.amazonaws.com/Julia-1.4.2.appxbundle" />
 </OptionalPackages>

 

That should install both packages, or is that not your desired workflow?

 

As another install option from your code, consider using AddPackageByAppInstallerFileAsync to install packages defined in your AppInstaller file. You can find other AppInstaller file APIs here.

 

About using AddOptionalPackageAsync from code, can you try a few things:

  1. Add the packagemanagement capability to your app doing performing the install.
    <Package>
    ...
    
      <Capabilities>
        <rescap:Capability Name="packageManagement" />
      </Capabilities>
      
    ...
    </Package>​
  2. Use the packagefamilyname when calling AddOptionalPackageAsync - you can get the specific package's packagefamilyname by running Get-AppxPackage when it's installed on a machine. So you'd have to install it and run the command to get the correct value for future use. There's an explanation here  
  3. Make sure your packages are part of a related set.

 

Cheers,

Tanaka

Highlighted

@Tanaka_Jimha Thanks! I tried all your suggestions, but no luck so far. Here are some more details:

 

I don't want to install all the optional dependencies at the same time when the main app is installed, so I don't think I should add all of them to the <OptionalPackages> element in the appinstaller file, right? I only want one of them installed with the main app, so I add that optional package to the <OptionalPackages> element, and then all the other optional packages I want to be able to install via an in-app option, so I add all of those packages to the <RelatedPackages> element in the appinstaller file. You can see the details of how I do this in the code that I posted with the original message.

 

I think AddPackageByAppInstallerFileAsync for the same reason is also not the right tool to implement my in-app feature add thing, right? As far as I can tell, it doesn't provide an option to install a specific optional package of the app, right? Or did I miss an option there somewhere?

 

I did add <rescap:Capability Name="packageManagement" /> to my main app now, and it shows up in the UI when I install that, but it doesn't change the error message I get.

 

When I install all the optional packages on my system, and then run the following ps code:

> $x = Get-AppxPackage Julia*
> $x.Dependencies

I get this output:

Name              : Julia-1.4.1
Publisher         : CN=Julialang
Architecture      : X64
ResourceId        :
Version           : 1.0.0.0
PackageFullName   : Julia-1.4.1_1.0.0.0_x64__87dh6scs60qg2
InstallLocation   : C:\Program Files\WindowsApps\Julia-1.4.1_1.0.0.0_x64__87dh6scs60qg2
IsFramework       : False
PackageFamilyName : Julia-1.4.1_87dh6scs60qg2
PublisherId       : 87dh6scs60qg2
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Developer
Status            : Ok

Name              : Julia-1.4.2
Publisher         : CN=Julialang
Architecture      : X64
ResourceId        :
Version           : 1.0.0.0
PackageFullName   : Julia-1.4.2_1.0.0.0_x64__87dh6scs60qg2
InstallLocation   : C:\Program Files\WindowsApps\Julia-1.4.2_1.0.0.0_x64__87dh6scs60qg2
IsFramework       : False
PackageFamilyName : Julia-1.4.2_87dh6scs60qg2
PublisherId       : 87dh6scs60qg2
IsResourcePackage : False
IsBundle          : False
IsDevelopmentMode : False
NonRemovable      : False
IsPartiallyStaged : False
SignatureKind     : Developer
Status            : Ok

So from this I take it that I should use "Julia-1.4.2_87dh6scs60qg2" as the string that I pass to AddOptionalPackageAsync? I'm doing that now, but I still get the same error message "Access is denied".

 

I do think everything is in one related set, I'm creating all the packages with a PackagingLayout.xml file that looks like this:

<PackagingLayout xmlns="http://schemas.microsoft.com/appx/makeappx/2017">
  <!-- Main game -->
  <PackageFamily ID="Julia" FlatBundle="true" ManifestPath="appxmanifest.xml" ResourceManager="false">
    
    <!-- x64 code package-->
    <Package ID="Julia-x64" ProcessorArchitecture="x64">
      <Files>
        <File DestinationPath="Julia\Julia.exe" SourcePath="C:\Users\david\source\repos\WinJulia\Release\Julia.exe"/>
        <File DestinationPath="Images\*.png" SourcePath="Images\*.png"/>
      </Files>
    </Package>

    
  </PackageFamily>

  <PackageFamily ID="Julia-1.4.2" Optional="true" ManifestPath="juliaversions\julia-1.4.2-appxmanifest.xml" ResourceManager="false">
    <Package ID="Julia-1.4.2.x64" ProcessorArchitecture="x64">
      <Files>
        <File DestinationPath="Julia\**" SourcePath="C:\Users\david\source\repos\WinJulia\optionalpackages\julia-1.4.2\Julia\**"/>
        <File DestinationPath="Images\*.png" SourcePath="Images\*.png"/>
      </Files>
    </Package>
  </PackageFamily>

  <PackageFamily ID="Julia-1.4.1" Optional="true" ManifestPath="juliaversions\julia-1.4.1-appxmanifest.xml" ResourceManager="false">
    <Package ID="Julia-1.4.1.x64" ProcessorArchitecture="x64">
      <Files>
        <File DestinationPath="Julia\**" SourcePath="C:\Users\david\source\repos\WinJulia\optionalpackages\julia-1.4.1\Julia\**"/>
        <File DestinationPath="Images\*.png" SourcePath="Images\*.png"/>
      </Files>
    </Package>
  </PackageFamily>

  <PackageFamily ID="Julia-1.4.0" Optional="true" ManifestPath="juliaversions\julia-1.4.0-appxmanifest.xml" ResourceManager="false">
    <Package ID="Julia-1.4.0.x64" ProcessorArchitecture="x64">
      <Files>
        <File DestinationPath="Julia\**" SourcePath="C:\Users\david\source\repos\WinJulia\optionalpackages\julia-1.4.0\Julia\**"/>
        <File DestinationPath="Images\*.png" SourcePath="Images\*.png"/>
      </Files>
    </Package>
  </PackageFamily>
</PackagingLayout>

And I believe that should create all packages as being in one related set, right?

Highlighted

Hi @davidanthoff 

 

Access Denied means you're having permission issues calling the API. Our devs said the fastest way to root cause will be to get logs. Can you please make a Feedback Hub submission capturing the error in the Developer Platform > App Deployment category: 

 

DeploymentFeedbackSettings.png

 

After capturing the issue, can you also attach the appxmanifest.xml files of your main app and optional packages with the submission. Please send me a link to the issue once you're done.

 

Thanks,

Tanaka 

Highlighted

@Tanaka_Jimha  Here is the link https://aka.ms/AA8obl4, hope that helps.

 

I'm also preparing a GitHub repo with all the code that I use to create these msix packages, it is all open source, so no problem to share that.

Highlighted

@davidanthoff Actually, I just realized that it will take a little longer until I can publish that GitHub repo: right now I have a codesigning cert that includes my private address, and I don't want to use that on the public internet. I'm working with my issuer right now to remove the address, as soon as I have that, I'll post it. But the issue I submitted on the feedback hub should include the necessary files.

Highlighted

Thanks for submitting the files @davidanthoff. I've forwarded them to the dev team for investigation. sounds good, let me know when you have the GitHib repo available and I'll also have a look at that.

 

Highlighted

@Tanaka_Jimha Alright, I've got the github repo up now, it is here:

 

https://github.com/davidanthoff/winjulia

 

You won't be able to run the build steps because you also need various builds of Julia itself, and setting that up is complicated, but it should give you an idea of what scripts I'm using to build things.

 

I'm also hosting the packages that I've created online now at https://winjulia.s3-us-west-1.amazonaws.com/index.html, so you and the dev team should be able to run the installer etc. on your own system and collect logs.

 

Here are some random comments that maybe are helpful:

  • The link "Install Julia" on that S3 website that I posted links to the appinstaller file. It will install the "Julia" package, and one of the optional packages, namely Julia-1.4.1. There are two other optional packages (Julia-1.4.0 and Julia-1.4.2), and the website has links to all three optional packages.
  • Installing any of the three optional packages via the weblink from that S3 site works.
  • What I want to do is install optional packages from in-app code, though. The specific code that I'm using for that is here, and that is also the part of the code that errors. If you install the main "Julia" app from the website that I linked to and run it, you will see an error message, and the code that I linked to in this item here is where that error occurs.

Let me know if this helps or if you need any more information!

Highlighted

Hi @davidanthoff,

 

Thanks for all the details you sent. Based on the logs from the feedback you filed it looks like the "access denied" error is happening when we try to access the AppInstaller file on S3 to get information for downloading the optional package. I'll message you more details.

 

Tanaka

Highlighted

@Tanaka_Jimha Cool! Do you think there will be a fairly easy way for me to fix this, or is this a more complicated problem? I'm not tied to S3 either, would be happy to use some other hosting as well.