我想使用WIX为以下虚拟Web目录启用“目录浏览”。
<iis:WebVirtualDir Id="LogsVirDir" Alias="Logs" Directory="ESGLOGFILES" />
如何使用WIX完成此操作?
答案 0 :(得分:3)
使用web.config system.webserver属性(如:
)不是一个更简单的解决方案<directoryBrowse enabled="true"/>
答案 1 :(得分:2)
根据我的研究,Wix目前没有任何能力使用标准操作集启用Directory Browsing
。我发现这样做的一种方法是使用Wix自定义操作和IIS Appcmd.exe
的组合。请注意,如果该文件不存在,此命令将创建web.config
文件。
<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>
答案 2 :(得分:0)
我正在使用wix v3.8
尝试在功能中添加ConfigurableDirectory
ex:<Feature Id='TestName' Title='Test Web' ConfigurableDirectory='INSTALLDIR' Level='1'>
答案 3 :(得分:-1)
使用以下代码
<Control Id="Browse" Type="PushButton" X="304" Y="210" Width="56" Height="17" Text="!(loc.CustomizeDlgBrowse)">
<Publish Event="SelectionBrowse" Value="BrowseDlg">1</Publish>
</Control>
在你想要的变量中取这个值并使用它。