As noted by Aaron Stebner, there is now a registry key you can search for to detect if the Visual C++ 2010 redistributable package is installed a machine, when installing your application.
There are 3 different (but very similar) registry keys for each of the 3 platform packages. Each key has a DWORD value called “Installed” with a value of 1.
Here’s an example of using this in WiX, detecting the presence of the x86 version of the redistributable:
<?xml version="1.0" encoding="utf-8"?>
<!-- Visual C++ 2010 x86 -->
<RegistrySearch Id="HasVCPP2010Search" Root="HKLM" Key="SOFTWAREMicrosoftVisualStudio10.0VCVCRedistx86" Name="Installed" Type="raw" />
<Condition Message="This application requires Microsoft Visual C++ 2010 Redistributable Package (x86).">Installed OR (HASVCPP2010)</Condition>
When someone runs your installer and they don’t have this package installed, they will get something like this message box when the installer initializes:
It’s a good idea to have a setup bootstrapper that automatically installs this package if it’s missing, but this WiX snippet is a good safe-guard for if someone directly runs your MSI.
- Determine the name of the custom action you want to debug
- Ensure you have the source code and debug symbols for your custom action
- Set the MsiBreak environment variable (user or system) to the name of the custom action. For example:
Setx MsiBreak MyCustomActionName
- Run your installer
- At the point where your custom action is about to run, you should get this message box prompt:
- Now you can use Visual Studio or another debugger such as WinDBG to attach to the specified process.
- Click OK on the message box
- This should break into your debugger. This is a good time to set your breakpoints in your custom action code.
- When ready, run/continue the debug session.
- Your custom action should run and your breakpoint(s) will be hit.
Debugging Custom Actions @ msdn.microsoft.com
Visual Studio 2010 and Team Foundation Server 2010 have been out for a while. But what if you still have Team Foundation Server 2008 but want to build Visual Studio 2010 solutions on it?
You can do so by updating the Team Foundation Build Service configuration to use the latest version of MSBuild that comes with the .NET Framework 4.0.
- Open up %Program Files%Microsoft Visual Studio 9.0Common7IDEPrivateAssembliestfsbuildservice.exe.config in a text editor
- Find the MSBuildPath property, which will likely be empty, and enter the path to the .NET Framework 4.0 folder (C:WINDOWSMicrosoft.NETFrameworkv4.0.30319):
- Save the file
- Restart the Visual Studio Team Foundation Build service