cacls fails when the physical directory contains spaces

Topics: General Questions
Oct 29, 2010 at 4:08 PM

When deploying a virtual directory which has spaces in its physical path the cacls command fails. For example,

  <ItemGroup>
    <VDirList Include="*">
      <Vdir>TestApplication</Vdir>
      <AppPool>TestPool</AppPool>
      <Physdir>..\..\Program Files (x86)\Microsoft BizTalk Server 2010\HttpReceive64</Physdir>
    </VDirList>
  </ItemGroup>

It appears there is a bug in the DeployVDirs target in BizTalkDeploymentFramework.targets.

Here is a suggested fix

    <Exec Command="cacls &quot;%(VDirList.Physdir)&quot; /E /G aspnet:R" Condition="'$(IisMajorVersion)' == '5'" />
    <Exec Command="cacls &quot;%(VDirList.Physdir)&quot;\*.* /E /G aspnet:R" Condition="'$(IisMajorVersion)' == '5'" />
      
    <!-- Take the username value from install wizard if doing a formal install -->
    <Exec Command="cacls &quot;%(VDirList.Physdir)&quot; /E /G $(VDIR_UserName):R" Condition="('$(IisMajorVersion)' == '6' or '$(IisMajorVersion)' == '7') and '$(Configuration)' == 'Server'" />
    <Exec Command="cacls &quot;%(VDirList.Physdir)&quot;\*.* /E /G $(VDIR_UserName):R" Condition="('$(IisMajorVersion)' == '6' or '$(IisMajorVersion)' == '7') and '$(Configuration)' == 'Server'" />

    <Exec Command="cacls &quot;%(VDirList.Physdir)&quot; /E /G $(AppPoolAccount):R" Condition="('$(IisMajorVersion)' == '6' or '$(IisMajorVersion)' == '7') and '$(Configuration)' != 'Server'" />
    <Exec Command="cacls &quot;%(VDirList.Physdir)&quot;\*.* /E /G $(AppPoolAccount):R" Condition="('$(IisMajorVersion)' == '6' or '$(IisMajorVersion)' == '7') and '$(Configuration)' != 'Server'" />

Please note usage of  &qout;
--Vlad
 
Coordinator
Oct 29, 2010 at 4:50 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.