1

I've got two features. The main feature and a second optional feature (managed with a property set by a UI dialog).

If I execute the installation and disable the installation of optional feature, the product will install without the optional feature. (It's OK)

If I'll execute the .msi again and choose to install the optional feature - it will not install.

The only way to do this is that I uninstall the product and reinstall it again with this optional feature selected.

I've also tried with the two option REINSTALL=ALL and INSTALLMODE=AMUS but nothing was change.

This is my WiX code:

<Feature Id="ProductFeature" Title="MAIN" Level="1">
  <ComponentGroupRef Id="MAIN_GROUP" />
</Feature>

<Feature Id="OptionalFeature" Title="OPTIONAL" Level="1">
  <Condition Level="3000"><![CDATA[CHECKBOX_UI <> "1"]]></Condition>
  <ComponentGroupRef Id="OPTIONAL_GROUP" />
</Feature>

Is there a way to add features on the second installation time, with the same version of installer?

I would like to modify the installed product during the second run of the Installer.

This is the code of the initial custom dialog where I used CTM_NEWF_Cbx checkbox as a conditional property to manage the Component conditional installation.

<Dialog Id="C_TypeInstallationDlg" Width="370" Height="270" Title="Bla bla bla">
  <Control Type="Bitmap" Id="CTM_Bmp" Width="140" Height="235" X="0" Y="0" Text="WizardBackgroundBmp" />
  <Control Type="Line" Id="CTM_Line" Width="370" Height="1" X="0" Y="235" />
  <Control Type="PushButton" Id="CTM_ExitBtn" Width="56" Height="17" X="306" Y="246" Text="Cancel">
    <Publish Event="EndDialog" Value="Exit" />
  </Control>
  <Control Type="Text" Id="CTM_WelcomeLbl" Width="200" Height="17" X="150" Y="15" Text="Bla bla bla" />
  <Control Type="Text" Id="CTM_CompanyDescriptionLbl" Width="197" Height="41" X="162" Y="135" Text="Bla bla bla" />
  <Control Type="Text" Id="CTM_DialogTitleLbl" Width="126" Height="23" X="9" Y="15" Text="Bla bla bla" Transparent="yes" />
  <Control Type="Text" Id="CTM_ProductDescriptionLbl" Width="197" Height="44" X="162" Y="66" Text="Bla bla bla" />
  <Control Type="Text" Id="CTM_InstallerDescriptionLbl" Width="124" Height="64" X="9" Y="36" Text="Bla bla bla" Transparent="yes" />
  <Control Type="RadioButtonGroup" Property="TYPEMACHINE_PROP" Id="CTM_TypeMachineRbtn" Width="213" Height="120" X="153" Y="48">
    <RadioButtonGroup Property="TYPEMACHINE_PROP">
      <RadioButton Text="Bla bla bla" Height="17" Value="1" Width="200" X="0" Y="0" />
      <RadioButton Text="Bla bla bla" Height="17" Value="2" Width="200" X="0" Y="68" />
    </RadioButtonGroup>
  </Control>
  <Control Type="PushButton" Id="CTM_NextBtn" Width="56" Height="17" X="237" Y="246" Text="Avanti &gt;" Default="yes">
    <Publish Order="1" Event="DoAction" Value="CA_GetNextDlg">1</Publish>
    <Publish Order="2" Event="NewDialog" Value="[NEXT_DIALOG]">1</Publish>
    <Publish Order="3" Value="[NEXT_DIALOG]" Property="CURRENT_DIALOG">1</Publish>
  </Control>
  <Control Type="PushButton" Id="CTM_BackBtn" Width="56" Height="17" X="179" Y="246" Text="&lt; Back" Disabled="yes"></Control>
  <Control Type="CheckBox" Id="CTM_NEWF_Cbx" Width="212" Height="17" X="153" Y="183" Text="!!!!- THIS IS THE NEW FEATURE -!!!!!" CheckBoxValue="1" Property="INSTALL_NEW_FEATURE" />
  <Control Type="Text" Id="CTM_NEWF_DetailsLbl" Width="196" Height="21" X="162" Y="205" Text="Bla bla bla" />
</Dialog>

Thank you :)

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • 1
    Are you doing a major upgrade or just running a modify on the installed product during this second run? This is a big difference. Can you also post your dialog code - for the custom dialog you must have created to set the CHECKBOX_UI property? – Stein Åsmul Jun 16 '18 at 02:01
  • I would like to modify the installed product during the second run of the Installer. I've just added the source code on main question. Thank you :) – Stefano Orlandi Jun 18 '18 at 09:07
  • This is what the WixUI_FeatureTree and related dialogs are for. – PhilDW Jun 18 '18 at 19:53
  • Can I ask what is going on in the custom action `CA_GetNextDlg`? – Stein Åsmul Jun 21 '18 at 21:24
  • It's a function that I've used to get the name of the next dialog where to go after the User've clicked the NEXT buttons. I've used this function in all UI Dialogs. I've used this technique to achieve the dynamical and conditional navigation of the wizard. – Stefano Orlandi Jun 22 '18 at 06:18
  • Did you ever find a solution for this? I'm running into this situation where Wix wants to uninstall everything instead of modify. – jallen Mar 06 '20 at 14:42

0 Answers0