【发布时间】:2013-12-13 23:52:21
【问题描述】:
截至昨天,我的托管引导程序应用程序无法在某些机器上运行,并出现以下错误:
[07F4:13CC][2013-12-12T12:20:31]e000: Error 0x80040150: Failed to create the managed bootstrapper application.
[07F4:13CC][2013-12-12T12:20:31]e000: Error 0x80040150: Failed to create UX.
[07F4:13CC][2013-12-12T12:20:31]e000: Error 0x80040150: Failed to load UX.
[07F4:13CC][2013-12-12T12:20:31]e000: Error 0x80040150: Failed while running
...
...
[07F4:13CC][2013-12-12T12:20:31]e000: Error 0x80040150: Failed to run per-user mode.
显然,0x80040150 (2147746128) 是:REGDB_E_READREGDB: 无法从注册表中读取密钥
在事件日志中,我可以看到
Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards. No user action is required.
DETAIL -
7 user registry handles leaked from \Registry\User\S-1-5-21-4128267814-1525589554-1895505527-1113_Classes:
Process 4332 (\Device\HarddiskVolume4\Users\<username>\AppData\Roaming\<companyname>\<product>\<file>.exe) has opened key \REGISTRY\USER\S-1-5-21-4128267814-1525589554-1895505527-1113_CLASSES
Process 4332 (\Device\HarddiskVolume4\Users\<username>\AppData\Roaming\<companyname>\<product>\<file>.exe) has opened key \REGISTRY\USER\S-1-5-21-4128267814-1525589554-1895505527-1113_CLASSES
Process 6180 (\Device\HarddiskVolume4\Users\<username>\AppData\Roaming\<companyname>\<product>\<folder>\BurnBasedSetupKit.exe) has opened key \REGISTRY\USER\S-1-5-21-4128267814-1525589554-1895505527-1113_CLASSES
Process 6180 (\Device\HarddiskVolume4\Users\<username>\AppData\Roaming\<companyname>\<product>\<folder>\BurnBasedSetupKit.exe) has opened key \REGISTRY\USER\S-1-5-21-4128267814-1525589554-1895505527-1113_CLASSES
Process 3408 (\Device\HarddiskVolume4\Users\<username>\AppData\Roaming\<companyname>\<product>\<folder>\BurnBasedSetupKit.exe) has opened key \REGISTRY\USER\S-1-5-21-4128267814-1525589554-1895505527-1113_CLASSES
Process 3408 (\Device\HarddiskVolume4\Users\<username>\AppData\Roaming\<companyname>\<product>\<folder>\BurnBasedSetupKit.exe) has opened key \REGISTRY\USER\S-1-5-21-4128267814-1525589554-1895505527-1113_CLASSES
Process 4332 (\Device\HarddiskVolume4\Users\<username>\AppData\Roaming\<companyname>\<product>\<file>.exe) has opened key \REGISTRY\USER\S-1-5-21-4128267814-1525589554-1895505527-1113_CLASSES
值得一提的是,BurnBasedSetupKit.exe 是由使用 c# 代码的服务调用的:
Process proc = new Process();
proc.StartInfo.FileName = "BurnBasedSetupKit.exe";
proc.StartInfo.Arguments = string.Format("-s -l {0}", logFileName);
proc.StartInfo.Verb = "runas";
proc.StartInfo.CreateNoWindow = true;
proc.StartInfo.UseShellExecute = false;
proc.StartInfo.ErrorDialog = false;
proc.StartInfo.RedirectStandardOutput = true;
proc.Start();
proc.WaitForExit();
if (proc.ExitCode != 0)
{
throw new Exception(string.Format("Setup execution process exited with non-zero ExitCode: {0}", proc.ExitCode.ToString()));
}
该服务在本地管理员组中的用户下运行。 BurnBasedSetupKit.exe 很可能在机器运行但没有用户登录时被服务调用。[注意:当交互调用 BurnBasedSetupKit.exe 工具包时,一切正常。]
我尝试升级到最新的稳定版 WiX 工具集,但同样的问题仍然存在。这似乎只在某些机器上表现出来。我的自定义托管引导程序代码库没有任何变化,该代码库已经完美运行了几个月。
我已确认我与遇到类似错误的其他人没有相同的问题(here、here、here、here)。
如果有人能提供一些启示,将不胜感激。
更新
经过一些试验和错误,在启动设置工具包的调用开始之前重新启动启动设置工具包的服务时,从不同的进程空间开始,此问题不会发生。然而,它并不是完全确定的。
【问题讨论】:
标签: c# wix installation bootstrapper burn