WiX - Permissions for ASP.NET Temp Folder

I am trying to set the permissions on the ASP.NET temp files folder like this:

<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 have included the netfx and util extensions. When I compile I get the following error:

error LGHT0094: unresolved symbol reference "Directory: NETFRAMEWORK20INSTALLROOTDIR"

What am I missing here?

Update: Don't know much about WiX, I tried this. It compiles and links. Not sure if this 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>

      

+2


source to share


1 answer


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

The solution is to use "NETFRAMEWORK20INSTALLROOTDIR" as the / @ Id directory. This only makes sense after you understand that directories can be treated like "Properties". Not necessarily intuitive, but what Windows Installer does nonetheless. So, I just changed my 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 this indicates that you are in the right direction. Note, I would use a shorter Directory / @ Name than my example above.;)

+1


source







All Articles