找不到所需的文件“setup.bin" [英] Could not find required file 'setup.bin'
问题描述
我无法在 VS2010 中为 Windows 服务项目构建安装项目.它失败并出现此错误:
I'm unable to build a Setup Project in VS2010, for a Windows Service project. It fails with this error:
在C:MyProjectEngine"中找不到所需的文件setup.bin".
Could not find required file 'setup.bin' in 'C:MyProjectEngine'.
我的环境是 Windows 7 Professional x64 和 Visual Studio 2010 Version 10.0.40219.1 SP1Rel
我已经下载了用于 Windows 7 和 .NET Framework 4,修复,然后重新启动,然后安装除 Visual C++ 编译器之外未选中的组件,然后安装 KB2519277.
I've downloaded Microsoft Windows SDK for Windows 7 and .NET Framework 4, repaired, then rebooted, then installed the unchecked components except Visual C++ compiler, then installed KB2519277.
这些是现有的注册表项:
These are the existing registry entries:
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftGenericBootstrapper3.5
Path = c:Program Files (x86)Microsoft SDKsWindowsv6.0ABootstrapper
HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftGenericBootstrapper4.0
Path = c:Program Files (x86)Microsoft SDKsWindowsv7.0ABootstrapper
这些是现有文件:
C:Program Files (x86)Microsoft SDKsWindowsv6.0ABootstrapperEnginesetup.bin
C:Program Files (x86)Microsoft SDKsWindowsv7.0ABootstrapperEnginesetup.bin
现有的解决方法是将 Engine 目录复制到项目目录,但是每次创建新项目时都必须这样做.
An existing workaround is to copy the Engine directory to the project directory, however this has to be done every time you make a new project.
如何正确修复此问题?
推荐答案
使用 Process Monitor 我发现,就在尝试访问路径之前,一个 DLL 用于检索此路径.以下内容可能是合法的,但无论如何我还是想分享我的发现.
With Process Monitor I found that, right before trying to access the path, a DLL is used to retrieve this path. The following may be borderline legal, but I'd like to share my findings anyway.
DLL 位于 C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Build.Tasks.v4.0.dll
并且使用的类是 Microsoft.Build.Tasks.Deployment.Bootstrapper.BootstrapperBuilder
.使用您最喜欢的反汇编工具,您会发现最终尝试了 3 次检索路径.
The DLL is located at C:WindowsMicrosoft.NETFrameworkv4.0.30319Microsoft.Build.Tasks.v4.0.dll
and the class being used is Microsoft.Build.Tasks.Deployment.Bootstrapper.BootstrapperBuilder
. Using your favourite disassembly tool, you can find that ultimately three attempts are made at retrieving the path.
- HKLMSoftwareMicrosoftGenericBootstrapper11.0Path
- HKLMSoftwareWow6432NodeMicrosoftGenericBootstrapper11.0Path
- Environment.CurrentDirectory
我不知道为什么它说 11.0,据我所知,VS 2012 之前没有安装在这台机器上.
I'm unsure why it says 11.0, as far as I can remember VS 2012 has not been installed on this machine before.
因此,SDK 安装程序中存在错误或 DLL 中存在错误.无论哪种方式,创建 11.0 注册表项并添加值都可以解决此问题.注意:必须重新启动 Visual Studio,因为在尝试检索路径后,它会被缓存.
So there's a bug in the SDK installer or there's a bug in the DLL. Either way, creating the 11.0 registry key and adding the value resolves this issue. Note: Visual Studio must be restarted, because after attempting to retrieve the path, it is cached.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREMicrosoftGenericBootstrapper11.0]
"Path"="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftGenericBootstrapper11.0]
"Path"="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\"
这篇关于找不到所需的文件“setup.bin"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!