【发布时间】:2019-09-03 16:40:06
【问题描述】:
我在尝试在旧 VB6 应用程序的安装程序中的 Windows 10 上安装兼容性 shim 数据库(.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);
}
}
fileName 和 argument 是通过参数传入的。
问题是我只在安装过程中收到此错误。 Can't install SDB file because it doesn't support any bitness that this operating system supports.
我使用的是 32 位版本的 Compatibility Administrator,因为 VB6 应用程序是 32 位的。我在 64 位 Windows 10 1809 build 17763.292 上运行。我使用了 sdbinst.exe 的 System32 和 SysWOW64 版本,我得到了同样的错误。
编辑:更多细节。我正在使用位于 ADK for 1809 中的兼容性管理器来生成新的 .sdbs。这与我用于开发和目标平台的 Windows 版本相匹配。旧的 .sdbs 在直接调用和通过 ProcessStartInfo 调用时都能正常工作。也许这是 1809 兼容性管理员中的错误?
我不确定发生了什么。任何建议或替代方案将不胜感激。
【问题讨论】:
标签: c# windows vb6 windows-10 shim