Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
533 views
in Technique[技术] by (71.8m points)

visual studio - Could not find required file 'setup.bin'

I'm unable to build a Setup Project in VS2010, for a Windows Service project. It fails with this error:

Could not find required file 'setup.bin' in 'C:MyProjectEngine'.

My environment is Windows 7 Professional x64 with Visual Studio 2010 Version 10.0.40219.1 SP1Rel

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

These are the existing files:

C:Program Files (x86)Microsoft SDKsWindowsv6.0ABootstrapperEnginesetup.bin

C:Program Files (x86)Microsoft SDKsWindowsv7.0ABootstrapperEnginesetup.bin

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.

How can this be fixed properly?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

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.

  1. HKLMSoftwareMicrosoftGenericBootstrapper11.0Path
  2. HKLMSoftwareWow6432NodeMicrosoftGenericBootstrapper11.0Path
  3. Environment.CurrentDirectory

I'm unsure why it says 11.0, as far as I can remember VS 2012 has not been installed on this machine before.

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"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...