在 Windows 10 上安装兼容性垫片数据库时出错

Error during compatibility shim database installation on Windows 10

我在尝试在旧 VB6 应用程序的安装程序中的 Windows 10 上安装兼容性垫片数据库(.sdb 文件)时遇到问题。如何在命令行上正常安装它只是

sdbinst.exe CompatibilityFix.sdb

如果您这样做,SDB 会完美地自行安装。

但是,在我的安装程序(C# 应用程序)中,它是这样调用的

        using (var p = new Process())
        {
            p.StartInfo = new ProcessStartInfo
            {
                WorkingDirectory = SetupSupportDir,
                FileName = fileName,
                Arguments = argument,
                CreateNoWindow = true,
                UseShellExecute = false,
                RedirectStandardOutput = true,
                RedirectStandardError = true
            };
            p.OutputDataReceived += ProcessOutputDataReceived;
            p.ErrorDataReceived += ProcessErrorDataReceived;
            p.Start();
            p.BeginOutputReadLine();
            p.BeginErrorReadLine();
            p.WaitForExit();

            if (0 != p.ExitCode)
            {
                TryAction(() => Trace.WriteLine(string.Format(CultureInfo.CurrentCulture, "FAILED: {0} - ExitCode: {1}", this.setupStatus, p.ExitCode)));
                throw new InvalidOperationException("FAIL: " + this.setupStatus);
            }
        }

其中fileNameargument是通过参数传入的。

问题是我只在安装过程中遇到这个错误。 Can't install SDB file because it doesn't support any bitness that this operating system supports.

我使用了 32 位版本的兼容性管理器,因为 VB6 应用程序是 32 位的。我 运行 64 位 Windows 10 1809 build 17763.292。我使用了 sdbinst.exe 的 System32 和 SysWOW64 版本,但我得到了同样的错误。

编辑:更多细节。我正在使用位于 ADK for 1809 中的兼容性管理器来生成新的 .sdb。这与我在开发和目标平台上使用的 Windows 版本相匹配。当直接调用和通过 ProcessStartInfo 调用时,旧的 .sdbs 工作得很好。也许这是 1809 兼容性管理器中的错误?

我不确定发生了什么。任何建议或替代方案将不胜感激。

原因是我没有将 .sdb 文件标记为 VS 中的嵌入式资源。因此,当安装程序稍后遍历资源时,找不到文件并抛出那个奇怪的错误。