2010-08-27 8 views
5

Ich habe ein Fenster mit 3 Radiobuttons wie folgt aus (entfernt alle nicht interessant Requisiten):Set-Eigenschaftswert von Benutzerauswahl in 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> 

auf „weiter“ Ich möchte einige propertys Einst auf das, was der Install der Benutzer hat ausgewählt.

wie dieses ..

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; 
} 

Wie funktioniert das in Wix?

Antwort

7

Ich laufe vor einer Woche in so etwas. Ich erinnere mich nicht an die Syntax richtig, aber es sieht ungefähr so ​​aus. Für meinen Geschmack ist es nicht sehr sauber, aber es sollte die Arbeit machen.

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

habe ich nicht die Zeit, um es zu testen, aber ich denke, es ist die Art und Weise für die am wenigsten zu gehen. Ich hoffe es wird dir helfen.

Prost.

+0

Danke, arbeite wie ein Charme – Qwark