Using a WiX property from a browse dialog

别等时光非礼了梦想. 提交于 2020-01-25 19:02:27

问题


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="yes"
           ElementPath="/configuration/appSettings/add[\[]@key='isslogdirectory'[\]]/@value"
           File="[INSTALLLOCATION]Web\Web.config"
           Value="[IISLOGDIRECTORY]"/>

回答1:


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"/>


来源:https://stackoverflow.com/questions/7118579/using-a-wix-property-from-a-browse-dialog

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!