2010-08-27 20 views
5

Tôi có một cửa sổ với 3 radiobuttons như thế này (loại bỏ tất cả các đạo cụ không thú vị):Đặt giá trị tài sản từ người dùng lựa chọn trong wix

<Control Id="Back" Type="PushButton" Text="!(loc.WixUIBack)"> 
    <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish> 
</Control> 
<Control Id="Cancel" Type="PushButton" Text="!(loc.WixUICancel)"> 
    <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> 
</Control> 
<Control Id="Next" Type="PushButton" Text="!(loc.WixUINext)"> 
    <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
</Control> 
<Control Id="InstallTypeSelection" Type="RadioButtonGroup" Property="INSTALL_TYPE"> 
    <RadioButtonGroup Property="INSTALL_TYPE"> 
     <RadioButton Value="0" Text="InstallType A" /> 
     <RadioButton Value="1" Text="InstallType B" /> 
     <RadioButton Value="2"Text="InstallType C" /> 
    </RadioButtonGroup> 

On "bên cạnh" Tôi muốn Sett một số propertys dựa trên những gì các Installtype người dùng đã chọn.

như thế này ..

if(INSTALL_TYPE == 0) 
{ 
    REG_VALUE_AUTO_LOGIN = 0; 
    REG_VALUE_TIMEOUT = 300; 
} 
if(INSTALL_TYPE == 1) 
{ 
    REG_VALUE_AUTO_LOGIN = 1; 
    REG_VALUE_TIMEOUT = 600; 
} 

làm việc như thế này trong wix?

Trả lời

7

Tôi chạy vào một cái gì đó như thế này một tuần trước. Tôi không nhớ cú pháp chính xác, nhưng nó trông giống như thế này. Đối với khẩu vị của tôi, nó không phải là rất sạch sẽ, nhưng nó nên làm công việc.

<Control Id="Next" Type="PushButton" Text="!(loc.WixUINext)"> 
    <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
    <!-- INSTALL_TYPE == 0 --> 
    <Publish Property="REG_VALUE_AUTO_LOGIN" Value="1">INSTALL_TYPE = "0"</Publish> 
    <Publish Property="REG_VALUE_TIMEOUT" Value="300">INSTALL_TYPE = "0"</Publish> 

    <!-- INSTALL_TYPE == 1 --> 
    <Publish Property="REG_VALUE_AUTO_LOGIN" Value="1">INSTALL_TYPE = "1"</Publish> 
    <Publish Property="REG_VALUE_TIMEOUT" Value="600">INSTALL_TYPE = "1"</Publish> 

    <! -- FINALLY, CALL NEXT DIALOG : added by Chris Painter --> 
    <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 

</Control> 

Tôi không có thời gian để thử nghiệm, nhưng tôi nghĩ đó là cách để đi ít nhất. Tôi hy vọng nó sẽ giúp bạn.

Chúc mừng.

+0

Cảm ơn, hãy làm việc như một sự quyến rũ – Qwark

Các vấn đề liên quan