how to use .vsprops file to override VC++ Directories in MS Visual Studio

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span style="font-family:Arial, Liberation Sans, DejaVu Sans, sans-serif;font-size:14px;border-collapse:collapse;line-height:18px
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial Id like to override the directories used by Visual Studio (devenv.exe) for the compiler and library paths. I know how to do this interactively via Tools->Options->VC++ Directories, but Id like to automate this.
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial <a style="font-size:14px;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;color:#4a6b82;text-decoration:none;cursor:pointer;margin:0px;border:0px initial initial" rel=nofollow href="http://msdn.microsoft.com/en-us/library/t9az1d21(VS.80).aspx http://msdn.microsoft.com/en-us/library/t9az1d21(VS.80).aspx has a tantalizing note on this: "If you want to set up directory search paths (for your projects) that can be shared by other users or that can be applied across multiple computers, Visual C++ provides an alternative to using this dialog, through project property sheets. For more information, see Property Sheets (C++)."
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial If you follow the link to Property Sheets documentation, theres a bunch of information on the mechanism but none on the actual properties you need to set.
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial I found the information populated by the VC++ Directories dialog, in %LocalAppData%MicrosoftVisualStudio8.0VCComponents.dat (for VS 2005, and 9.0 for VS 2008); it seems to set various properties under VCVC_OBJECTS_PLATFORM_INFOwin32Directories and ...x64Directories.
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial Has anyone done this before and know what the mapping is from the property names used in VCComponents.dat to the names to use in a .vsprops file?
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial Id like this to work in VS2005, VS2008 and VS2010, ideally.
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial I dont have VS2010 installed, but apparently Microsoft has completely done away with the VC++ Directories dialog under View Options, made it per project, and so now you get an interactive UI for editing these directories in Project Properties instead of View Options; this also means that theres a UI for it in the properties manager; then if you want to make changes per-machine instead of per-project like it used to be, you just set a property sheet up the way you want, and make all your projects inherit from it. This sounds like a big improvement over the old way. And a direct way to do what I want to do. But only in VS2010.
<p style="margin-bottom:1em;vertical-align:baseline;background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;clear:both;border:0px initial initial VS2005 and VS2008 dont have the UI to do set these properties in a project or property sheet, though; Im happy to do it by hand but I dont know what its supposed to look like!


View the full article
 
Back
Top