2013-12-13 32 views
1

我的管理引导器应用为昨天无法在某些机器上运行,并出现以下错误:维克斯烧伤管理引导程序加载失败 - Errror 0x80040150

[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由SERVIC调用e使用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)。

如果有人能够说出一些亮点,我们将不胜感激。

UPDATE

一些试验和错误后,当启动安装套件中的服务是安装包的调用之前重新开始踢,从一个不同的进程空间的出现,则不会出现此问题。然而它不是确定性的。

回答

0

我已将其缩小为两件事情的组合,不一定相关:(a)离开用户注册表配置单元的孤立句柄的服务和(b)Windows用户配置文件服务主动地杀死任何用户注册表配置单元句柄该服务已经开放供引导程序使用。

重新启动服务似乎可以缓解这个问题,我相信通过在启动引导程序之前清除掉任何孤立的注册表句柄。另一种解决方案可能是通过P/Invoke使用本机C++调用来创建进程,并让子进程继承句柄(.NET调用似乎不允许用户明确指定句柄的继承)。这应该防止用户配置文件服务将注册表句柄检测为孤立,并允许引导程序根据需要使用用户配置文件的资源。此外,我还最终在调用安装工具包之前加载服务标识的用户配置文件。这些步骤的组合解决了这个问题。

相关问题