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:\MyProject\Engine'.
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_MACHINE\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper\3.5
Path = c:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper\4.0
Path = c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\
These are the existing files:
C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Engine\setup.bin
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Engine\setup.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?
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:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.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.
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_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\11.0]
"Path"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bootstrapper\\"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\GenericBootstrapper\11.0]
"Path"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v7.0A\\Bootstrapper\\"
Before going down the rabbit hole, verify that you need the bootstrapper. If you do not, then you can turn it off by doing one of the following. This will also resolve the error.
The GUI way:
Properties
Publish
Tab on the leftPrerequisites...
buttonCreate setup program to install prerequisite components
This answer came from this post.
The manually edit csproj
file way:
<BootstrapperEnabled>false</BootstrapperEnabled>
to the bottom of the first <PropertyGroup>
elementThis solution worked for me (VS 2013): http://www.codewrecks.com/blog/index.php/2014/05/31/error-msb3147-could-not-find-required-file-setup-bin-in/
Change the PATH of the msbuild.exe to: C:\Program Files (x86)\MsBuild\12.0\Bin\msbuild.EXE
I had the same problem with a TFS build.
You can resolve the problem by setting the visual studio version in the MSBuild arguments of the definition build:
/property:VisualStudioVersion=12.0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With