locked
Problems referencing build output from installer project RRS feed

  • Question

  • Here's what I'm trying to do: I have two solutions - one for my main application and its associated projects and another for my database (VS .dbproj) and its associated projects. What I'd like to do is include the output from the database project (a .dbschema and some SQL scripts) in my WiX installer (which exists in the main application solution.) This involves having TFS build the DB solution immediately before the main application solution. I've got that part working properly, but I'm having trouble referencing the output of the DB solution from my installer.

    I'm using relative paths to reference the DB project output in my WiX installer (e.g. <?define DBProjectOutputDir = "..\..\MyDatabaseSolution\MyDatabaseProject\sql\"?>) which works fine locally, but fails when building via TFS build. This is because TFS Build apparently changes the output dir of each project to one common location. Instead of the path to my database project being "..\..\MyDatabaseSolution\MyDatabaseProject\sql\" like it is when building locally, it gets set to something like "..\..\..\Binaries\Release\". How can I get around this and have a consistent output location to reference from my installer project?
    Friday, May 7, 2010 1:47 PM

Answers

All replies

  • Hi, You are correct in that the problem occurs because TFS override the OutDir property of each project when building them.

    You didn't mention which version of TFS you are running so:

    TFS 2008:
    You can stop Team Build from overriding the OutDir property by adding a <CustomizableOutDir> property tou your build script (TFSBuild.proj) and set it to true. More info here:
    http://blogs.msdn.com/aaronhallberg/archive/2007/06/07/preserving-output-directory-structures-in-orcas-team-build.aspx

    TFS 2010:
    It is a little bit more awkward in TFS 2010, there is no real corresponding property here, but Jim Lamb has a post on how you can accomplish the same thing here:
    http://blogs.msdn.com/jimlamb/archive/2010/04/13/customizableoutdir-in-tfs-2010.aspx

    Note that in both cases you must make sure that the binaries gets copied to the Binaries folder in order for MSTest to find them and for the copying to drop location work

    Hope that helps
    /Jakob

     


    Blog: http://geekswithblogs.net/jakob Twitter: http://twitter.com/osirisjakob
    Saturday, May 8, 2010 12:08 PM
  • Sorry, I forgot to mention I'm using TFS 2005. I managed a workaround by making a special case for the build server in my WiX project:

    <?if $(env.ComputerName) = "MYBUILDSERVER"?>
     <?define DBProjectOutputDir = "$(var.TargetDir)"?>
    <?else?>
     <?define DBProjectOutputDir = "..\..\MyDatabaseSolution\MyDatabaseProject\sql\"?>
    <?endif?>

    This way, if project is being compiled in TFS Build, the output directory of my database project is the same as the installer output directory; otherwise, it is the normal relative path. Is there a better solution using TFS 2005? We're upgrading to 2010 but not for a few more months.

    Monday, May 10, 2010 2:17 PM
  • Hi pmdarrow,

    Please refer to the following link:

    http://msdn.microsoft.com/en-us/library/5tdasz7h(VS.80).aspx

    Hope it helps! If you have any concern, please feel free to let me know!

    Best Regards,

    Cathy Kong

    Wednesday, May 12, 2010 7:09 AM
    Moderator