How do I make sure FindRelatedProducts starts after the user interface has been shown using WiX?

I have an MSI installer, and I specify the installation of each computer in the installer user interface. A previous version was also installed for each machine.

However, FindRelatedProducts reports that the current installation is for each user.

MSI (c) (A4:F0) [13:33:20:490]: FindRelatedProducts: **current install is per-user**. Related install for product '<<my guid>>' is per-machine. Skipping...

From the log, I see that the property ALLUSERSis only created after FindRelatedProducts starts (check the timestamp):

MSI (c) (A4:A8) [13:33:25:032]: PROPERTY CHANGE: Adding ALLUSERS property. Its value is '2'.

ALLUSERS properties Publishedfrom the user interface based on what the user selected:

      <Publish Property="ALLUSERS" Value="2"><![CDATA[FolderForm_AllUsers="ALL" AND VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1]]></Publish>
      <Publish Property="ALLUSERS" Value="{}"><![CDATA[FolderForm_AllUsers="ME" AND VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1]]></Publish>


    <Control Id="AllUsersRadioGroup" Type="RadioButtonGroup" X="20" Y="175" Width="342" Height="42" Property="FolderForm_AllUsers" Text ="empty">      
      <RadioButtonGroup Property="FolderForm_AllUsers">
        <RadioButton Value="ALL" X="0" Y="0" Width="342" Height="17" Text="$(loc.InstallForAll)" />
        <RadioButton Value="ME" X="0" Y="18" Width="342" Height="17" Text="$(loc.InstallForMe)" />
      </RadioButtonGroup>

      <Condition Action="show"><![CDATA[VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1]]></Condition>
      <Condition Action="hide"><![CDATA[NOT (VersionNT>=400 AND Privileged=1 AND FolderForm_AllUsersVisible=1)]]></Condition>
    </Control>

As a result, the new version is installed along with the existing one (two entries exist in the "Add or Remove Programs").

<InstallUISequence>
  <Custom Action="VSDCA_FolderForm_AllUsers" After="IsolateComponents"><![CDATA[Installed="" AND NOT RESUME AND ALLUSERS=1]]></Custom>
  <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
</InstallUISequence>


<InstallExecuteSequence>
  <!-- Only schedule this custom action for the 32-bit MSI.  -->
  <?if $(var.DependenciesPlatform)=x86 ?>
  <Custom Action="CA_Err32BitMsiOn64BitOS" After="LaunchConditions">
    <![CDATA[MsiAMD64 OR Intel64]]>
  </Custom>
  <?endif ?>

  <!-- Prevent downgrading -->
  <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>

  <RemoveExistingProducts Before="InstallInitialize" />

  <Custom Action="LaunchApp" After="InstallFinalize" />

  <InstallInitialize></InstallInitialize>
  <RemoveShortcuts></RemoveShortcuts>
  <InstallFiles></InstallFiles>
  <CreateShortcuts></CreateShortcuts>
  <InstallFinalize></InstallFinalize>

  <ScheduleReboot After="InstallFinalize"/>
</InstallExecuteSequence>

, , FindRelatedProducts, -, ( , , , , ALLUSERS propety ).

, FindRelatedProducts , ALLUSERS , ?

+4
1

, , , FindRelatedProducts , :

<Publish Event="DoAction" Value="FindRelatedProducts">1</Publish>

https://www.mail-archive.com/wix-users@lists.sourceforge.net/msg22960.html

, suppress - InstallUISequence.

+3

Source: https://habr.com/ru/post/1534816/


All Articles