Installer running in container during docker build fails with error 1719

Expected behavior

Correctly install a MSI setup during docker build
In the Dokerfile I have

# escape=`
FROM microsoft/windowsservercore:1803
SHELL [ "powershell", "-Command"]
ADD "http://download.backup4all.com/download/setup/b4asetup.msi" c:/msi/
RUN Start-Process msiexec.exe -ArgumentList '-i', 'c:\msi\b4asetup.msi', '/quiet', '/norestart' -NoNewWindow

Actual behavior

The install fails with with error 1719.
Error 1719. The Windows Installer Service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance.

Information

docker info
Containers: 1
 Running: 0
 Paused: 0
 Stopped: 1
Images: 435
Server Version: 17.06.2-ee-13
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)
Operating System: Windows Server Standard
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 7.689GiB
Name: DOCKERCORE
ID: HVX2:N6BQ:ZOLP:MSOR:OXIN:BK5T:QW6D:AGZH:VW5H:WWJO:2DVK:5V3X
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
docker version
Client:
 Version:       17.06.2-ee-13
 API version:   1.30
 Go version:    go1.8.7
 Git commit:    ac44d73
 Built: Mon Jun  4 16:46:59 2018
 OS/Arch:       windows/amd64

Server:
 Engine:
  Version:      17.06.2-ee-13
  API version:  1.30 (minimum version 1.24)
  Go version:   go1.8.7
  Git commit:   ac44d73
  Built:        Mon Jun  4 16:58:47 2018
  OS/Arch:      windows/amd64
  Experimental: false

The same Dockerfile works on Windows 10 but fails on Windows Server 1803.
This happens all the time.

Steps to reproduce the behavior

  1. Using the Dockerfile listed above run docker build
  2. An error might or might not be displayed during Step 3/5
    T h e W i n d o w s I n s t a l l e r S e r v i c e c o u l d n o t b e a c c e s s e d . T h i s c a n o c c u r i f t h e W i n d o w s I n s t a l l e r i s n o t c o r r e c t l y i n s t a l l e d . C o n t a c t y o u r s u p p o r t p e r s o n n e l f o r a s s i s t a n c e .
  3. Start a container and verify that the dir "C:\Program Files (x86)" command lists only
common files
internet explorer
Microsoft.NET
WindowsPowerShell

Build on Windows 10 1803 without any issue.

PS C:\Users\greggu\repos\dow-playground\demo19> .\build.ps1
Sending build context to Docker daemon 3.072kB
Step 1/4 : FROM microsoft/windowsservercore:1803
—> 7e2287b03e2e
Step 2/4 : SHELL [ “powershell”, “-Command”]
—> Running in 6a3ce71ef328
Removing intermediate container 6a3ce71ef328
—> 4fc1204ed704
Step 3/4 : ADD “http://download.backup4all.com/download/setup/b4asetup.msi” c:/msi/
Downloading [==================================================>] 128.5MB/128.5MB
—> 368f7872776f
Step 4/4 : RUN Start-Process msiexec.exe -ArgumentList ‘-i’, ‘c:\msi\b4asetup.msi’, ‘/quiet’, ‘/norestart’ -NoNewWindow
—> Running in 1ae7119b3a18
Removing intermediate container 1ae7119b3a18
—> 89dc09300c85
Successfully built 89dc09300c85
Successfully tagged greggu/demo19:1.0.0

It fails only if running on Windows Server 1803.

It works fine for me inside Windows Server 1803. So it’s not architectural but rather then environmenal issue

PS C:\Users\Administrator\Documents\docker> docker build .
Sending build context to Docker daemon  2.048kB
Step 1/4 : FROM microsoft/windowsservercore:1803
1803: Pulling from microsoft/windowsservercore
d9e8b01179bf: Pull complete
acacb1f3f7c2: Pull complete
Digest: sha256:06349a37774c52fd65cf87485ab7455e1745ea1f752da52bf4c1b1f44b242fb7
Status: Downloaded newer image for microsoft/windowsservercore:1803
 ---> d03ee2083c4d
Step 2/4 : SHELL powershell -Command
 ---> Running in 138bc9ffc9cb
 ---> 768ac59a050c
Removing intermediate container 138bc9ffc9cb
Step 3/4 : ADD "http://download.backup4all.com/download/setup/b4asetup.msi" c:/msi/
Downloading [==================================================>]  128.5MB/128.5MB
 ---> 93890a90b535
Removing intermediate container 23d9ef6a29f2
Step 4/4 : RUN Start-Process msiexec.exe -ArgumentList '-i', 'c:\msi\b4asetup.msi', '/quiet', '/norestart' -NoNewWindow
 ---> Running in a5235d880b2b
 ---> 982df09cb0eb
Removing intermediate container a5235d880b2b
Successfully built 982df09cb0eb
PS C:\Users\Administrator\Documents\docker> docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 4
Server Version: 17.06.2-ee-13
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)
Operating System: Windows Server Standard
OSType: windows
Architecture: x86_64
CPUs: 2
Total Memory: 1.027GiB
Name: WIN-CBHHDJNUFLH
ID: A77Q:HH3J:V5LW:DFLZ:VF6A:L4VG:3DQ7:CRMR:SGBO:4LFD:G3JY:NKYL
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Thanks for the replies.
I will try on a clean Windows Server 1803 installation.

@crvx Did you manage to resolve this issue?

I am having the same problem now on Windows Server 2019 host.
The following Dockerfile builds successfully on Windows 10 Pro 1903, but fails on Windows Server 2019 Standard 1809.

FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019

ADD https://www.visualsvn.com/files/VisualSVN-Server-4.2.2-x64.msi /VisualSVN-Server-4.2.2-x64.msi

RUN msiexec.exe /i VisualSVN-Server-4.2.2-x64.msi /qn /norestart /L*V "VisualSVN-Server-4.2.2-x64.log"

CMD powershell

Looking at the log, I get the following error:

Error 1719. The Windows Installer Service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance.

Other thing worth mentioning is that on Win 10 Pro, Docker Desktop (CE) is installed

Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:23:10 2020
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.8
API version: 1.40 (minimum version 1.24)
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:37:20 2020
OS/Arch: windows/amd64
Experimental: false

but on Win Server 2019 Docker Enterprise Edition (EE) is installed.

Client: Docker Engine - Enterprise
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 2ee0c57608
Built: 11/13/2019 08:00:16
OS/Arch: windows/amd64
Experimental: false
Server: Docker Engine - Enterprise
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.24)
Go version: go1.12.12
Git commit: 2ee0c57608
Built: 11/13/2019 07:58:51
OS/Arch: windows/amd64
Experimental: false

One more detail: Windows Server 2019 is running on VM.

Regards

I have had similar issues where msi installs have failed and the error messages imply that the Windows Installer is not installed correctly. My issue turned out to be that the item being installed was a service, and the service was dependent on the Visual C++ runtime. The C++ runtime had not been installed in the image prior to running the msi. As a result, the msi could install the service, but could not start the service, and the msi rolled everything back. Once I got the C++ runtime installed prior to the msi, it started working.

Ideally, the msi itself should check if the required runtime is present and install it if it isn’t. Hope this helps.

Hi @awb12768, thanks for the reply.

That would indicate that the problem is in the base image, which is evidently not the case since it is working on other host OS.

After many hours of head smashing and trial and error, I discovered that changing this:

RUN msiexec.exe /i VisualSVN-Server-4.2.2-x64.msi /qn /norestart /L*V "VisualSVN-Server-4.2.2-x64.log"

to this:

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Start-Process 'VisualSVN-Server-4.2.2-x64.msi' '/qn /norestart /L*V "VisualSVN-Server-4.2.2-x64.log"' -PassThru | Wait-Process;

is working fine on both host OS-es (Win 10 Pro and Win Server 2019).

In never ending quest to find the correct installer invoking method, I got the idea from this SO thread:

So basically, if I start my msi installer in pshell (or is it the wait command?) everything works fine, if I use msiexec it doesn’t work but only on Win Server host.

I still don’t know why is this happening and I am happy to hear someone with more expertise explaining it, since I just started using Docker and I am in shock on how something so trivial such as running the installer turned out to be such a pain in the a**.

Hope this helps someone :slight_smile:

Cheers

I am still getting the msi 1719 error.

Content from my msi log:
Error 1719. Windows Installer service co
uld not be accessed. Contact your support personnel to verify that it is properly registered and enabled

My docker file:

# escape=`
FROM mcr.microsoft.com/windows/servercore:ltsc2019

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]


WORKDIR c:\shareddata
COPY data c:\shareddata


RUN [Net.ServicePointManager]::SecurityProtocol = 'Tls12, Tls11, Tls' 

RUN ls
RUN Start-Process 'vcredist_x64.exe' '/q /norestart' -PassThru | Wait-Process;
RUN Start-Process 'VC_redist.x64.exe' '/q /norestart' -PassThru | Wait-Process;
RUN Start-Process 'rktools.msi' '/qn /norestart /L*V "rktools.msi.log"' -PassThru | Wait-Process;

RUN get-process

SHELL ["cmd", "/S", "/C"]

That saved my day, thank you! Changing msi.exec to Start-Process fixed the issue.

Fixed my issue, too. Start-Process [msi file] works, whereas msiexec.exe did not.

Noting worked for me, I then share what actually worked if it can help someone in the future, NOT setting defaul shell to powershell with:

SHELL ["powershell", ...]

since there are commands failing in powershell but working find with CMD, that is the default one, including the my MSI install, and when I want to run a powershell command I run:

RUN powershell -Command "..."

Anyway, back to the topic, in order to install my MSI I simply call it from RUN as I would call it from command prompt:

RUN C:\msodbcsql.msi /qn /norestart /log MsOdbcSqlDriverSetup.log IACCEPTMSODBCSQLLICENSETERMS=YES