tags:

views:

472

answers:

1

I'm trying to set the permissions of the temp ASP.NET files folder as follows:

<PropertyRef Id="NETFRAMEWORK20INSTALLROOTDIR"/>
<DirectoryRef Id="NETFRAMEWORK20INSTALLROOTDIR">
  <Directory Id="TempASPNETFolder" Name="Temporary ASP.NET Files">
    <Component Id="PermissionsTempAspnet" Guid="{C107EC7F-FC97-41b6-B418-EA4532949362}">
      <CreateFolder>
        <util:PermissionEx GenericAll="yes" User="[WIX_ACCOUNT_NETWORKSERVICE]" />
      </CreateFolder>
    </Component>
  </Directory>
</DirectoryRef>

I've included the netfx and util extensions. When I compile I get the following error:

error LGHT0094: Unresolved reference to symbol 'Directory:NETFRAMEWORK20INSTALLROOTDIR'

What am I missing here?

Update: Not know much about WiX, I tried this. It compiles and links. Not sure it actually works.

<DirectoryRef Id="TARGETDIR">
  <Directory Id="NetFramework20InstallDir" Name="[NETFRAMEWORK20INSTALLROOTDIR]">
    <Directory Id="TempASPNETFolder" Name="Temporary ASP.NET Files">
      <Component Id="PermissionsTempAspnet" Guid="{C107EC7F-FC97-41b6-B418-EA4532949362}">
        <CreateFolder>
          <util:PermissionEx GenericAll="yes" User="[WIX_ACCOUNT_NETWORKSERVICE]" />
        </CreateFolder>
      </Component>
    </Directory>
  </Directory>
</DirectoryRef>
A: 

Your second solution will create a directory named "[NETWORKFRAMEWORK20INSTALLROOTDIR]" on the largest drive on you machine. I don't think that is what you want. :)

The solution is to use "NETFRAMEWORK20INSTALLROOTDIR" as the Directory/@Id. This makes sense only after you realize that Directories can be treated like Properties. Not necessarily intuitive but that's what the Windows Installer does nonetheless. So, I'd just change your first example to something like:

<PropertyRef Id="NETFRAMEWORK20INSTALLROOTDIR"/>
<DirectoryRef Id="TARGETDIR">
  <Directory Id="NETFRAMEWORK20INSTALLROOTDIR" Name="This will be ignored because the DirectorySearch used by the PropertyRef above will overwrite it.">
    <Directory Id="TempASPNETFolder" Name="Temporary ASP.NET Files">

Hopefully, that points you in the right direction. Note, I would use a shorter Directory/@Name than my example above. ;)

Rob Mensching
Thanks for pointing the way and explaining the directories can be treated like properties concept.
Mike Ward