开发者

Using a WiX property from a browse dialog

I'm developing a setup project using WiX, and I have the following problem. I get a directory path from the user using the Browse dialog, and I need to put this path in web.config. The problem is that in web.config that puts the value in "WWWMain" and not the path chosen by the user.

This is my code:

Product.wxs

<Property Id="IISLOGDIRECTORY" Value="WWWMain" />

Dialog.wxs

<Control Id="IISLogDirectoryEdit" Type="PathEdit" X="45" Y="100" Width="220" Height="18" Disabled="yes" Property="IISLOGDIRECTORY" Indirect="yes" />

Installation.wxs

<util:XmlFile Id="ModifyIISLogDirectory"
           Action="setValue"
           Permanent="y开发者_StackOverflow中文版es"
           ElementPath="/configuration/appSettings/add[\[]@key='isslogdirectory'[\]]/@value"
           File="[INSTALLLOCATION]Web\Web.config"
           Value="[IISLOGDIRECTORY]"/>


Declare the variable in Dialog.wxs itself but after the control

Example

<Control Id="DiffBackUpEdit" Type="PathEdit" X="120"  Y="157" Width="160" Height="18" Property="IISLOGDIRECTORY">
</Control>
<Control Id="Browse12" Type="PushButton" X="290" Y="157" Width="56" Height="17" Text="Browse">
    <Publish Property="_BrowseProperty" Value="DIFFDBBACKUPLOC" Order="1">1</Publish>
    <Publish Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
</Control>

Then at bottom in same page after add

<Property Id="IISLOGDIRECTORY" Value="C:\Database\MDM"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜