0

I have ArtifactsDirectory folder, that contains subfolders called 5.1.0.1, 5.1.0.2, ... , 5.1.0.N.

Each 5.1.0.X folder contains outputs(dlls, exe files) of another build.

Now I want to create a build definition for Installer that will grab the latest build output (5.1.0.N) and include it to my installation package.

For this purpose I need to identify which of 5.1.0.X folders is the latest.

The best approach will be to find "latest" by folder's creation date, but I'm sure that 5.1.0.i-1 was created before 5.1.0.i, so I will be happy just to define "latest" by its number - I mean ordering by folder name: 5.1.0.1 is the oldest, 5.1.0.N is the latest.

So, how can I get this in MSBuild? Which MSBuild tasks can help me?

AndreyS
  • 365
  • 7
  • 18

1 Answers1

0

You can build a custom task that will pick up the folder using c# code here is a similar answer: MsBuild- Delete files from a directory based on time modified / name

Community
  • 1
  • 1
Alexandr Mihalciuc
  • 2,537
  • 15
  • 12
  • thank you for your reply. I looked at this example, but what is $(MSBuildToolsPath)? I haven't found it in a List of MsBuild Reserved properties: http://msdn.microsoft.com/en-us/library/ms164309%28v=vs.100%29.aspx I also cannot locate Microsoft.Build.Tasks.v4.0.dll on my local box where I have .NET 4.0 and Visual Studio 2010 installed. – AndreyS Jan 23 '14 at 13:55
  • You link has it: MSBuildToolsPath -- the key location defined in the current MSBuild "toolset". For example for the "v4.0" toolset, it points to the .NET 4.0 install folder, where microsoft.common.targets is. See note about MSBuildBinPath below. – granadaCoder Jan 23 '14 at 14:24