WiX:InstallUISequence和InstallExecuteSequence之间丢失的属性值

时间:2009-08-26 13:33:40

标签: wix installer windows-installer

我的WiX安装程序遇到了问题。

我有一个自定义对话框,其中包含链接到属性的编辑控件。在运行时,如果我更改编辑控件中的值,我会从日志中看到该属性已使用该新值正确更新。但似乎当InstallUISequence结束时,该属性被重置为其默认值,这很烦人,因为我无法在InstallExecuteSequence的自定义操作部分中使用用户sumded值。

以下是我使用的WXS脚本的摘录:

<UI>
    <Dialog Id="select_list" Width="370" Height="270" Title="Select license and list files">
        <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="UIBannerBmp" />
        <Control Id="BannerLine" Type="Line" X="0" Y="45" Width="370" Height="0" />
        <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
        <Control Type="Edit" Id="list" Width="211" Height="15" X="128" Y="128" Property="pListFile" />
        <Control Type="Text" Id="static_list" Width="78" Height="17" X="41" Y="154" Text="list file" />
        <Control Type="PushButton" Id="next" Width="50" Height="17" X="232" Y="244" Text="Next &gt;">
            <Publish Event="EndDialog" Value="Return">1</Publish>
        </Control>
        <Control Type="PushButton" Id="cancel" Width="50" Height="17" X="296" Y="244" Text="Cancel">
            <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
        </Control>
        <Control Type="Text" Id="desc" Width="348" Height="16" X="8" Y="90"
                 Text="Please set the path of the the list file" />
    </Dialog>

    <InstallUISequence>
        <Show Dialog="select_list" After="WelcomeEulaDlg">NOT installed</Show>
    </InstallUISequence>
</UI>

<CustomAction Id="InstallService"
              ExeCommand="[bin]prog.exe -f install.cl '[pListFile]'"
              Execute="immediate"
              Return="check"
              Directory="bin" />

<InstallExecuteSequence>
    <Custom Action="InstallService" After="InstallFinalize">REMOVE=""</Custom>
</InstallExecuteSequence>

<CustomActionRef Id="InstallService" />
<Property Id="pListFile" Value="c:\" />

我不能在正确的轨道上交换两个序列之间的信息。

有办法吗?

1 个答案:

答案 0 :(得分:15)

您需要将属性“安全”标记为从客户端(InstallUISequence)传递到服务器端(InstallExecuteSequence)。要做到这一点,你需要使属性“公开”(所有大写)和安全。像这样:

<Property Id="PLISTFILE" Secure="yes"/>

除非您希望默认情况下在UI中显示某些内容,否则您无需为其指定值。

相关问题