Windows-Containers icon indicating copy to clipboard operation
Windows-Containers copied to clipboard

regsvr32 fails when registering DAO350.DLL

Open gaelxcowi opened this issue 5 months ago • 6 comments

As stated, I am unable to register the DAO350.DLL using the regsvr32 tool with the exit code 5.

An exmaple on how I am trying to register it:

$process = Start-Process "regsvr32" -ArgumentList "/s "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\DAO350.DLL"" -PassThru -Wait; $process.ExitCode and as mentioned I am getting the exit code 5.

Container images that I have tried to run with:

mcr.microsoft.com/windows:ltsc2019
mcr.microsoft.com/windows/server:ltsc2020

I have tried a few things:

Removing the UAC using the following:

Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorAdmin -Value 0

Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name ConsentPromptBehaviorUser -Value 0

Set-ItemProperty -Path REGISTRY::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -Name EnableLUA -Value 0

Running in isolation using:

--isolation=hyperv

Running using different account, specifically:

--user "NT Authority\System"

Taking ownership to ContainerAdministrator of the registry nodes and subnodes, as suggested in this blog:

https://rnd-solutions.net/2017/05/09/resolve-dao350-dll-registration-issue/

Checking the dependency using dependency walker.

Not sure what I can try more :/ One weird thing, is that I can see that the registry key entry is added once I run the command to:

HKEY_CLASSES_ROOT\TypeLib{00025E01-0000-0000-C000-000000000046}\4.0

with the correct values, etc. but the process still returns an exit code 5.

When trying to run Add-Type of the said .DLL I have the following errors, so maybe some missing dependencies?

Add-Type : c:\Users\Administrator\AppData\Local\Temp\q1ro04mp\q1ro04mp.0.cs(1) : Unexpected character '' c:\Users\Administrator\AppData\Local\Temp\q1ro04mp\q1ro04mp.0.cs(1) : >>> C:\Program Files (x86)\Common Files\microsoft shared\DAO\DAO350.DLL At line:1 char:1

Another approach:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\> whoami
nt authority\system

# Install Microsoft Data Access Objects - from here https://archive.org/details/microsoft-data-access-objects-dao-3.5
PS C:\> $process = Start-Process ".\DAO\SETUP.EXE" -Wait -PassThru; $process.ExitCode
0

# Confirm that Dao2535.tlb is present
PS C:\> cd 'C:\Program Files (x86)\Common Files\microsoft shared\DAO\'; ls
    Directory: C:\Program Files (x86)\Common Files\microsoft shared\DAO
Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        12/5/1996  12:00 AM          73184 Dao2535.tlb
-a----        12/2/1996   6:44 PM         582144 dao350.dll
-a----        9/15/2018   9:29 AM         610304 dao360.dll

# Start CMD
PS C:\Program Files (x86)\Common Files\microsoft shared\DAO> cmd
Microsoft Windows [Version 10.0.17763.5329]
(c) 2018 Microsoft Corporation. All rights reserved.

# Run regsvr in the local folder
C:\Program Files (x86)\Common Files\microsoft shared\DAO>start /wait regsvr32 /s dao350.dll

# Error level
C:\Program Files (x86)\Common Files\microsoft shared\DAO>echo %errorlevel%
5

gaelxcowi avatar Jan 27 '24 16:01 gaelxcowi