jrbe228
Posts: 2
Joined: Wed Nov 23, 2022 12:52 am

MSIX in Docker

Wed Nov 23, 2022 1:09 am

Does anyone know how to install an MSIX package into a Docker container?

Currently my Dockerfile does the following:
- Install certificate to "Trusted Root Certification Authorities", which is specified by "Cert:\LocalMachine\Root" in the PowerShell command.
- Copy MSIX package from network drive.
- Install MSIX as an app. (Fails)
- Remove local copy of MSIX package.

Dockerfile:
RUN powershell $pwd = ConvertTo-SecureString -String 'CeRtPaSsWoRd' -AsPlainText -Force; Import-PfxCertificate -Password $pwd -FilePath "R:/app-stream-cert.pfx" -CertStoreLocation Cert:\LocalMachine\Root \
&& copy "R:/mcre-22-r2-x64.msix" "C:/" \
&& powershell Add-AppPackage -path "C:/mcre-22-r2-x64.msix" \
&& del "C:/mcre-22-r2-x64.msix"

However I have this error:

Add-AppPackage : Deployment failed with HRESULT: 0x80073D19, An error occurred
because a user was logged off.
error 0x80073D0A: Failed to install package
AnsysInc.mcre-22-r2_22.2.0.0_x64__13gfg92hgbc9g because the firewall service
is not running. Ensure that the firewall service is enabled and started.
NOTE: For additional information, look for [ActivityId]
b9bbd738-fed5-0000-fec9-bdb9d5fed801 in the Event Log or use the command line
Get-AppPackageLog -ActivityID b9bbd738-fed5-0000-fec9-bdb9d5fed801
At line:1 char:1
+ Add-AppPackage -path C:/mcre-22-r2-x64.msix
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (C:\mcre-22-r2-x64.msix:String) [A
dd-AppxPackage], Exception
+ FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageMa
nager.Commands.AddAppxPackageCommand


I've tried enabling firewall service in the container and on the host machine using "powershell Start-Service -Name mpssvc". I'm able to enable firewall on the host, but not in the container. I'm also posting on StackOverflow for better reach: https://stackoverflow.com/questions/745 ... -container

Catalin
Posts: 6541
Joined: Wed Jun 13, 2018 7:49 am

Re: MSIX in Docker

Wed Nov 23, 2022 3:39 pm

Hello and welcome to our forums,

Well, most likely, we have a limitation right there.

Basically, the Add-AppxPackage, as per the documentation, will add a signed app package to a user account.

With that in mind, we can draw the conclusion that this might not work for machines where the user is logged of, such as docker images in our case - thus the error encountered when you run the cmdlet.

Please note that this has nothing to do with Advanced Installer.

I have done some research, but unfortunately I was not able to find much about this specific issue (other than other users having similar problem - but no solutions so far), so I'm afraid I can't really further assist on this topic.

If you have other questions, please let me know and I will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

jrbe228
Posts: 2
Joined: Wed Nov 23, 2022 12:52 am

Re: MSIX in Docker

Sat Nov 26, 2022 3:51 am

Hi Catalin,
I agree about the limitation - it appears related to containers and not an issue with Advanced Installer.

For my case, the current solution is to use Advanced Installer 18.4 to generate an MSI / EXE instead of MSIX. Then I can install the MSI / EXE to the container instead.

Catalin
Posts: 6541
Joined: Wed Jun 13, 2018 7:49 am

Re: MSIX in Docker

Mon Nov 28, 2022 2:14 pm

Thank you for your followup on this!

Glad you managed to find a workaround for this.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”