Building dni using VS2010 on a 64-bit machine

Sep 25, 2010 at 12:34 PM

I've been trying to build dotNetInstaller on a 64-bit machine using Visual Studio 2010, but have run into some issues I don't know how to solve.

I've updated the various Windows version numbers from 0x0400 to 0x0500 since VS2010 doesn't support Win95/98, but now I'm getting a few errors when trying to build it:

5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(168): error C2332: 'struct' : missing tag name
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(168): error C3306: 'detail::<unnamed-tag>': unnamed class template is not allowed
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(168): error C2143: syntax error : missing ';' before 'static_assert'
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(168): error C2059: syntax error : ';'
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(171): error C2332: 'struct' : missing tag name
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(171): error C2143: syntax error : missing ';' before 'static_assert'
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(171): error C2913: explicit specialization; 'detail::<unnamed-tag>' is not a specialization of a class template
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(171): error C2059: syntax error : '<'
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(172): error C2143: syntax error : missing ';' before '{'
5>c:\users\bruce\documents\dotnetinstaller\thirdparty\smartptr\smart_any_fwd.h(172): error C2447: '{' : missing function header (old-style formal list?)

I'm also getting a BadImageFormatException when trying to run InstallerConfig.exe as part of the build script, to rewrite the samples. I guess it's because of a mixture of AnyCPU and x86 projects - i.e. 64-bit binaries can't load 32-bit libraries?

Further on I'm also seeing errors about White, which I know is the project from but where do all the White assemblies need to be copied to?

Sep 25, 2010 at 3:39 PM

On BadImageFormatException: you're correct. There's a target CPU mix in the configuration, everything needs to be targeting "Any CPU" and not x86 or x64. Looks like rev. 54788 introduced a new "Any CPU" configuration in the solution file which created some mess to build on a 64-bit platform. I've corrected that in the last two commits and tested on my 64-bit setup. Thanks for pointing this out, it actually produces an unusable 64-bit build.

The C++ standard committee added static_assert (see this), which breaks the define in shared_any.h. I global replaced static_assert by static_assert_macro to fix this problem in the thirdparty/SmartPtr library. This is a harmless change, so I committed it @ rev. 55488.

Project White is used for UI test automation. It's actually in ThirdParty/White. What's missing is not White, it's UIAutomationClient and UIAutomationTypes (you can see it in References). These don't seem to exist in the .NET Framework 2.0 client profile in Visual Studio 2010. Changing InstallerEditorUnitTests project's target .NET Framework to 3.5 Client Profile fixes the problem.

Then I tried converting to Visual Studio 2010, ran in the same problems as you. So here's what remains to be done manually:

  1. The InstallerMsi project won't convert - there's no Wix 3.0 for Visual Studio 2010. Nothing we can do about it right now short of upgrading Wix.
  2. Re-define WINVER = 0x0500 and _WIN32_WINNT as 0x500.
  3. Change InstallerEditorUnitTests project's target .NET Framework to 3.5 Client Profile.

This goes a long way, but it still doesn't link the C++ executables. You get two linker issues in CPPUNIT and TinyXML.

 I think both need to be upgraded or rebuilt for it to work. You can try to look into that next.


Sep 25, 2010 at 4:08 PM

The linker error goes away if you replace tinyxmld_STL.lib with a new copy built from the latest code from sourceforge.

Thanks for working on this, it's great to be able to build it using VS2010!

Oct 11, 2010 at 10:31 AM

I'll second that!