Why is WiXSetup.targets trying to delete my entire C drive?

Topics: Server Deployment
Mar 6, 2015 at 3:04 PM
Edited Mar 11, 2015 at 11:07 AM

We have been using BTDF for ages, and recently I have been looking at moving the build process to TFS 2010 workflow build. This seemed to be working (MSIs being generated), but on actually running the MSI I am finding that it is attempting to delete everything on my C drive!

Clearly there is a path wrong somewhere, but I am struggling to figure it out. I believe it is occurring during the Delete task in WiXSetup.targets as that's what the log suggests. I have included a snippet of the log below, where it changes from populating the \redist folder to commencing mass deletion:
Copying file from "..\NHS.CoreFramework.Validation.dll" to "obj\Server\redist\NHS.CoreFramework.Validation.dll".
 Copying file from "..\NHS.CoreFramework.ExtensionMethods.dll" to "obj\Server\redist\NHS.CoreFramework.ExtensionMethods.dll".
 Copying file from "..\NHS.CoreFramework.WcfServiceProxies.dll" to "obj\Server\redist\NHS.CoreFramework.WcfServiceProxies.dll".
Target Installer:
 Deleting file "\bootmgr".
 C:\Program Files (x86)\NHS.CoreFramework.DataServiceComponents\1.0\Deployment\Framework\BizTalkDeploymentFramework.WiXSetup.targets(187,5): error MSB3061: Unable to delete file "\bootmgr". Access to the path 'C:\bootmgr' is denied.
 Deleting file "\BOOTSECT.BAK".
 C:\Program Files (x86)\NHS.CoreFramework.DataServiceComponents\1.0\Deployment\Framework\BizTalkDeploymentFramework.WiXSetup.targets(187,5): error MSB3061: Unable to delete file "\BOOTSECT.BAK". Access to the path 'C:\BOOTSECT.BAK' is denied.
 Deleting file "\pagefile.sys".
And this is line 187 from the WiXSetup.targets file:
<Delete Files="@(OutputsToClean)" ContinueOnError="false" Condition="'@(OutputsToClean)' != ''" />
OutputsToClean is created here:
<CreateItem Include="$(OutputPath)\**\*.*">
    <Output TaskParameter="Include" ItemName="OutputsToClean" />
Where does the installer get the $(OutputPath) value from? That seems to be the path on which it bases the delete statement, so I'm guessing the wrong value is somehow being passed in.


Mar 6, 2015 at 7:39 PM
Hi Chris,

First of all, sorry to hear that you've run into this issue. It does occur when the OutDir property is undefined. Here's a past discussion that touched on this.

Have you recently changed your BTDF version? Are you scripting the deployment? When the deploy script runs after installing the MSI, it calls the Deploy target. If no target is specified through a script, it will instead call the Installer target (in v5.0 final release and up). It seems like that's what is happening to you. The delete step that is occurring was removed in the final release of v5.0, so it seems like you still have pre-release code somewhere.

Remember too that you need to have the same BTDF on the build server and dev machines.

Mar 9, 2015 at 10:55 AM
Edited Mar 9, 2015 at 11:56 AM
Hi Tom,

Thanks so much for your quick reply.

I have now gone through all of our dev machines and our build server and it looks like they are all running v5.0 RC2.

If you're interested, here is a bit of background on the changes I have been making that have exposed this issue.

We haven't changed BTDF versions recently, but I have been messing around with the team build process and must have somehow ended up with an undefined OutDir property.

Previously, we had TFS 2008 and were running all our MSIs in one single build using msbuild batching. I was explicitly building the MSIs in a target like this:
<Exec Command='msbuild /p:Configuration=Debug /t:Installer "E:\Dev\Main\IntegrationEngine\%(BizTalkSolution.Namespace).Deployment\%(BizTalkSolution.Namespace).Deployment.btdfproj"' />
Then we upgraded to TFS 2010, and used the upgrade XAML template, so I didn't change anything. This was working fine.

I then decided to start using the workflow builds in 2010, and changed all our btdfproj files' DefaultTargets to Installer as per the BTDF documentation, and must have done something wrong as this is when I started getting the blank OutDir issue.

Anyway, I am now upgrading one machine to the final release of v5.0 and will make sure the new MSIs are correct. I will then roll out the final release to all our dev boxes and the build server.

Thanks again,

Mar 9, 2015 at 3:15 PM
Hi Tom,

Just reporting back to let you know that I have upgraded one development machine to v5.0 RTW. The MSIs generated by that machine are now behaving as expected.

I'm now going to get everyone in the team to upgrade and will also do the same for the build server.


Mar 11, 2015 at 5:35 AM
OK, good to hear. I highly recommend upgrading to v5.5 as there are a lot of great improvements in it. One nice feature in v5.5 is the ability to check the core BTDF files into TFS and reference them from a relative path within the TFS structure, which eliminates the need to install on the build server.