Docker Community Forums

Share and learn in the Docker community.

Install MSI/EXE Windows Container

Hello all,

I would like to install a msi file into my Docker container. The application has some dependencies, so I downloaded from Docker Hub an Image with ASP and .NET Framework.
I would like to install into that container some files, I prepared a Dockerfile with the following content:

FROM  mcr.microsoft.com/dotnet/framework/aspnet
WORKDIR /app
COPY . /app
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

RUN Start-Process 'C:\\app\mySetup.msi' '/qn' -PassThru | Wait-Process;

Nothing occurs, my application is not installed. Also happens with another dependencies.
Even I try to execute them in the container (because I copied it as you see in Dockerfile) but nothing occurs.

Someone could help me?

Thank you very much.

Best regards

I have installed both msi and exe based installers. I typically do run them by invoking a script from the Docker file.
MSI:
& msiexec /i meSetup.msi /quiet /norestart ADDLOCAL=ALL

EXE:
$exe = “.\MySetup.exe”
$parameters = '/q /norestart ’
Start-Process $exe $parameters -Wait

Note I have an additional space at the end of my $parameters, which was somehow necessary.

it´s not working… when I make the “docker build”, it got stucked in the process, and can´t install.
could you please show me your Dockerfile??
Thank you very much

I my case I am sure that the installer supports silent / unattended installations and won’t require user input.

# escape=`

SHELL [“powershell”, “-Command”, “$ErrorActionPreference = ‘Stop’; $ProgressPreference = ‘SilentlyContinue’;”]
RUN Start-Process “./WindowsHosting.exe” ‘/install /quiet /norestart’ -Wait; `
Remove-Item -Force WindowsHosting.exe

oh, thanks. So maybe the problem cames from installer…

Some installers have custom properties that can provide required input. Typically in a PROPERTY=VALUE type format.

I will check thank you very much.
Anyway, I downloaded them from internet, and there´s no specification about that input. I guess because it works only with GUI

Hi,
you may try parameters with "/LV install.log" to see what goes wrong while setup runs.
RUN Start-Process -Wait -FilePath S:\Setup.exe -ArgumentList @(’/qn’, '/L
V’, ‘c:\install.log’)
If it’s an MSI-File try to call
RUN Start-Process -Wait -FilePath msiexec.exe -ArgumentList @(’/i’,‘Setup.msi’,’/qn’, ‘/L*V’, ‘c:\install.log’)
To display Logfile:
RUN Get-Content -Path c:\install.log

Regards.

1 Like

Hi. I typically use this format:
RUN Start-Process -FilePath ./vcredist_x86_2010.exe -ArgumentList "’/q’ , ‘/l* “./vcredist_x86_2010.log”’ " -PassThru | Wait-Process

Couple of this that I would check (from past experience / pain)

  • Does the MSI actually install quietly?
  • Does the MSI install on Windows server core?

Experience gained from COTS app:
Vendor had never tested silent install !
Application had a service that depended on a windows 3D DLL, that was not part of WS core build !!

The problem is that my installers need human interaction to get installed, so I don´t know what can I do for install them. They are built for GUI.

Yep, sounds familiar. I’ve used old technology in this situation, by repackaging the installation into a genuine silent MSI. Also gives you the ability to view dependencies, what is actually being done, etc.

https://www.advancedinstaller.com/user-guide/repackager.html . Not saying this is the best option, but it’s worked for me…

That only works with MSI files right? I also need for .exe files… I think im gonna give up :smiley:

No. Works for anything. What is does is takes a snapshot of your PC, then you do the installs, changes, whatever, you then tell the repackager to take another snapshot , and it then packages the differences in the before and after snapshots into an msi, which you can then edit, etc, and make it fully silent…

:slight_smile: