Ahmad
Ahmad

Reputation: 24947

How do I enable Directory Browsing for an virtual web directory using wix?

I want to enable "Directory Browsing" for the for the following virtual web directory using WIX.

<iis:WebVirtualDir Id="LogsVirDir" Alias="Logs"  Directory="ESGLOGFILES" />

How do I accomplish this using WIX? IIS Directory Browsing Option

Directory Browsing Enabled

Upvotes: 3

Views: 3671

Answers (4)

nghia.tran
nghia.tran

Reputation: 81

Im using wix v3.8

try adding ConfigurableDirectory in your Feature

ex: <Feature Id='TestName' Title='Test Web' ConfigurableDirectory='INSTALLDIR' Level='1'>

Upvotes: 0

rusty
rusty

Reputation: 499

Wouldn't a simpler solution be to use the web.config system.webserver property like :

<directoryBrowse enabled="true"/>

Upvotes: 4

Ahmad
Ahmad

Reputation: 24947

Based on my research Wix currently does not have any capability to enable Directory Browsing using the standard set of actions. The one way I have found to do this is using a combination of Wix Custom Actions and IIS's Appcmd.exe. Note this command will create a web.config file if one does not exist.

<CustomAction Id="EnableDirectoryBrowsing"
              Execute="deferred"
              ExeCommand='[WindowsFolder]system32\inetsrv\APPCMD.EXE set config "ESG Website/logs" /section:directoryBrowse /enabled:true'
              Directory="TARGETDIR"
              Return="check"
              Impersonate="no"/>


<InstallExecuteSequence>
  <Custom Action="EnableDirectoryBrowsing" Before="InstallFinalize">Not Installed</Custom>
</InstallExecuteSequence>

Upvotes: 2

Sunil Agarwal
Sunil Agarwal

Reputation: 4277

Use the following code

<Control Id="Browse" Type="PushButton" X="304" Y="210" Width="56" Height="17" Text="!(loc.CustomizeDlgBrowse)">
          <Publish Event="SelectionBrowse" Value="BrowseDlg">1</Publish>
</Control>

Take the value of this in the variable you want and use it.

Upvotes: -1

Related Questions