Age*_*dum 2 installation ms-access docker
我想在 Docker 容器上安装 Access Runtime,但这样做失败了。以下是重现错误的基本命令。
首先使用新的 Windows 容器启动交互式 shell:
docker container run -it mcr.microsoft.com/windows:1809-amd64 cmd.exe
Run Code Online (Sandbox Code Playgroud)
接下来运行以下脚本来重现:
cd /d C:\
curl https://download.microsoft.com/download/D/B/D/DBD20EF9-A945-4768-AEB0-617BCEA2214A/accessruntime_4288-1001_x64_en-us.exe -o accessruntime_4288-1001_x64_en-us.exe
accessruntime_4288-1001_x64_en-us.exe /quiet /extract:C:\AccessRuntime
echo ^<Configuration Product="AccessRT"^> > accessruntime_4288-1001_x64_en-us.config
echo ^<Display Level="None" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" /^> >> accessruntime_4288-1001_x64_en-us.config
echo ^<Logging Type="standard" Path="C:\Windows\Temp\" Template="Microsoft_Access_2016_Runtime_Setup(*).log" /^> >> accessruntime_4288-1001_x64_en-us.config
echo ^<COMPANYNAME Value="Company Name" /^> >> accessruntime_4288-1001_x64_en-us.config
echo ^<Setting Id="SETUP_REBOOT" Value="Never" /^> >> accessruntime_4288-1001_x64_en-us.config
echo ^</Configuration^> >> accessruntime_4288-1001_x64_en-us.config
del C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup*.log
cmd /C C:\AccessRuntime\setup.exe /config C:\accessruntime_4288-1001_x64_en-us.config
echo Access Runtime Setup exited with code: %errorlevel%, See below for logs:
findstr /spin CAInstallLicenses C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup*.log
Run Code Online (Sandbox Code Playgroud)
为了可读性,这是脚本作为输入生成的配置:
<Configuration Product="AccessRT">
<Display Level="None" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
<Logging Type="standard" Path="C:\Windows\Temp\" Template="Microsoft_Access_2016_Runtime_Setup(*).log" />
<COMPANYNAME Value="Company Name" />
<Setting Id="SETUP_REBOOT" Value="Never" />
</Configuration>
Run Code Online (Sandbox Code Playgroud)
这是输出:
Access Runtime Setup exited with code: 1603, See below for logs:
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:9975:2020/02/24 08:49:01:598::[1176] MSI(ACTIONSTART): 'Action 8:49:01: PrepareCAInstallLicenses. '
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:9976:2020/02/24 08:49:01:598::[1176] MSI(INFO): 'Action start 8:49:01: PrepareCAInstallLicenses.'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:9977:2020/02/24 08:49:01:614::[1176] MSI(INFO): 'PrepareCAInstallLicenses: OMSICA : Initializing CustomAction PrepareCAInstallLicens
es'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:9978:2020/02/24 08:49:01:630::[1176] MSI(INFO): 'PrepareCAInstallLicenses: PHN license not supplied for ACID: 9D9FAF9E-D345-4B49-AFC
E-68CB0A539C7C'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:9979:2020/02/24 08:49:01:630::[1176] MSI(INFO): 'PrepareCAInstallLicenses: RAC-Private license not supplied for ACID: 9D9FAF9E-D345-
4B49-AFCE-68CB0A539C7C'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:9980:2020/02/24 08:49:01:630::[1176] MSI(INFO): 'PrepareCAInstallLicenses: RAC-Public license not supplied for ACID: 9D9FAF9E-D345-4
B49-AFCE-68CB0A539C7C'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:9981:2020/02/24 08:49:01:645::[1176] MSI(INFO): 'Action ended 8:49:01: PrepareCAInstallLicenses. Return value 1.'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10205:2020/02/24 08:49:09:708::[1176] MSI(ACTIONSTART): 'Action 8:49:09: CAInstallLicenses. '
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10206:2020/02/24 08:49:09:708::[1176] MSI(INFO): 'Action start 8:49:09: CAInstallLicenses.'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10207:2020/02/24 08:49:09:723::[1176] MSI(INFO): 'Action ended 8:49:09: CAInstallLicenses. Return value 1.'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10275:2020/02/24 08:49:32:270::[1176] MSI(ACTIONSTART): 'Action 8:49:32: CAInstallLicenses. '
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10276:2020/02/24 08:49:32:286::[1176] MSI(INFO): 'CAInstallLicenses: OMSICA : Initializing CustomAction CAInstallLicenses'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10277:2020/02/24 08:49:32:302::[1176] MSI(INFO): 'CAInstallLicenses: Populating the Token Store'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10278:2020/02/24 08:49:32:302::[1176] MSI(INFO): 'CAInstallLicenses: Installing license: sl.ISSUANCE.CLIENT_ROOT'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10279:2020/02/24 08:49:32:302::[1176] MSI(INFO): 'CAInstallLicenses: Error: Failed to open Token Store HResult: 0xc0020036. '
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:10280:2020/02/24 08:49:32:302::[1176] MSI(INFO): 'CustomAction CAInstallLicenses returned actual error code 1603 (note this may not b
e 100% accurate if translation happened inside sandbox)'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:11247:2020/02/24 08:50:08:161::[1176] MSI(INFO): 'Property(S): CAInstallLicenses = **********'
C:\Windows\Temp\Microsoft_Access_2016_Runtime_Setup(2020022408475199C).log:11405:2020/02/24 08:50:08:208::[1176] MSI(INFO): 'Property(S): MsiHiddenProperties = CAInstallLicenses;CAInstallPidKey;DigitalProduct
ID;DPID;PIDKEY;VerifyProdReg'
Run Code Online (Sandbox Code Playgroud)
搜索此错误让我相信它与 Windows 或 Office 激活有关。但既然这是一个 Docker 容器,我该如何解决这个问题呢?
经过许多小时的反复试验和互联网搜索,我可以很高兴地说,我成功地将 Access Runtime 安装在 Docker 容器上。对此线程的回应使我朝着正确的方向前进。
太阳、月亮和星星都必须对齐才能使其发挥作用,所以我希望这个答案能在未来对某人有所帮助。
首先,作为记录,我使用的是来自 mcr.microsoft.com/windows:1809-amd64 的基本映像,它可以部署到 Azure。不幸的是,servercore 映像不是一个选项,因为 Access 数据库引擎(我有一个单独的依赖项)在 servercore 上不起作用。
其次,在安装期间,您必须使用USER ContainerAdministrator。
第三,在运行 setup.exe 之前,您必须设置此注册表项:
reg.exe add HKLM\System\CurrentControlSet\Services\sppsvc /v Start /t REG_DWORD /d 2 /f
Run Code Online (Sandbox Code Playgroud)
我不完全知道这是做什么的,但与激活有关。它使操作系统处于足以安装 Access Runtime 的状态。这是我在那个线程上得到的一块。
默认情况下,值为 4,这会将值设置为 2。安装后,我没有将其恢复为 4,也没有对其进行测试。
另一个重要的一点是,设置此注册表设置必须在启动 setup.exe的RUN之前并独立于RUN语句中。这是因为设置后需要重新启动。这意味着不能从 shell 单独手动测试,必须使用 Dockerfile 来端到端测试。
第四,在启动 setup.exe 时,您必须以非常特定的方式启动它:
RUN cmd.exe /C setup.exe /config temp.log
Run Code Online (Sandbox Code Playgroud)
这里重要的是额外的 cmd.exe /C。原因是 setup.exe 会启动一个新的 shell 并在您没有 cmd.exe /C 时立即返回。这意味着操作会立即返回给 Docker 并进入一个奇怪的状态。我花了一段时间才弄明白。cmd.exe /C 允许它充分等待。事实上,我使用 PowerShell 只是为了更加确定:
$access_runtime_setup_process = Start-Process -FilePath 'cmd.exe' -ArgumentList \"/C $access_runtime_temp_directory\setup.exe /config $access_runtime_config_file\" -NoNewWindow -Wait -PassThru; `
if ($access_runtime_setup_process.ExitCode -ne 0) { `
Write-Host \"PROCESS FAILED: $access_runtime_temp_directory\setup.exe (Exit Code: $($access_runtime_setup_process.ExitCode))\"; `
exit 1; `
}
Run Code Online (Sandbox Code Playgroud)
最后,我在 Access Runtime 之后安装了 Access Database Engine。我没有反过来测试,它可能也有效。
安装Access数据库引擎后,我做了一个USER ContainerUser来恢复用户。
我不需要安装 VC Runtime 或 .NET Framework,我唯一需要安装的是运行时和数据库引擎。
如果其他人最终不得不经历在 Docker 容器中使用诸如 Access 之类的遗留软件的痛苦,我希望这对您有所帮助!
| 归档时间: |
|
| 查看次数: |
1058 次 |
| 最近记录: |