简体   繁体   中英

Error during compatibility shim database installation on Windows 10

I have an issue trying to install a compatibility shim database (.sdb file) on Windows 10 inside my installer for an old VB6 application. How this would be installed normally on a command line would simply be

sdbinst.exe CompatibilityFix.sdb

If you do this, the SDB installs itself perfectly.

However, in my installer (a C# application), it calls it like this

        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);
            }
        }

Where the fileName and argument is passed in via a parameter.

The problem is that I get this error only during the installer. Can't install SDB file because it doesn't support any bitness that this operating system supports.

I used the 32 bit version of Compatibility Administrator because the VB6 application is 32 bit. I'm running on 64 bit Windows 10 1809 build 17763.292. I've used the System32 and SysWOW64 versions of sdbinst.exe and I get the same error.

Edit: Some more details. I'm using the Compatibility Administrator located in the ADK for 1809 to generate the new .sdbs. This matches the Windows version that I use for dev and on the target platform. The old .sdbs work perfectly when called directly and when called via ProcessStartInfo. Perhaps this is a bug in the 1809 Compatibility Administator?

I'm not sure what's going on. Any suggestions or alternatives would be greatly appreciated.

The cause of this was that I wasn't marking the .sdb file as an embedded resource in VS. So when the installer later iterated through the resources it couldn't find the file and threw up that bizarre error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM