Skip to content

Commit

Permalink
Prevent installing per-machine over per-user (#25210)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansjfw committed Apr 5, 2023
1 parent bfe99a0 commit 944e410
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion installer/PowerToysSetup/PowerToys.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
<Variable Name="DetectedPowerToysUserVersion" Type="version" Value="0.0.0.0"/>

<util:ProductSearch Id="SearchInstalledPowerToysVersion" Variable="DetectedPowerToysVersion" UpgradeCode="42B84BF7-5FBF-473B-9C8B-049DC16F7708" Result="version" />
<util:ProductSearch Id="SearchInstalledPowerToysUserVersion" Variable="DetectedPowerToysUserVersion" UpgradeCode="D8B559DB-4C98-487A-A33F-50A8EEE42726" Result="version" />

<?if $(var.PerUser) = "true" ?>
<util:ProductSearch Id="SearchInstalledPowerToysUserVersion" Variable="DetectedPowerToysUserVersion" UpgradeCode="D8B559DB-4C98-487A-A33F-50A8EEE42726" Result="version" />
<bal:Condition Message="PowerToys is already installed on this system for all users. We recommend first uninstalling that version before installing this one." >MinimumVersion &gt;= DetectedPowerToysVersion</bal:Condition>
<bal:Condition Message="The same or later version of PowerToys is already installed." >TargetPowerToysVersion &gt;= DetectedPowerToysUserVersion OR WixBundleInstalled</bal:Condition>
<?else?>
<bal:Condition Message="PowerToys is already installed on this system for current user. We recommend first uninstalling that version before installing this one." >MinimumVersion &gt;= DetectedPowerToysUserVersion</bal:Condition>
<bal:Condition Message="A later version of PowerToys is already installed." >TargetPowerToysVersion &gt;= DetectedPowerToysVersion OR WixBundleInstalled</bal:Condition>
<?endif?>

Expand Down

0 comments on commit 944e410

Please sign in to comment.