Skip to content

Commit

Permalink
8273040: Turning off JpAllowDowngrades (or Upgrades)
Browse files Browse the repository at this point in the history
Reviewed-by: asemenyuk
Backport-of: 22a7191f700c6966c59dcd12476f01452243542b
  • Loading branch information
GoeLin committed Jul 18, 2022
1 parent d755049 commit 4bab0eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
Expand Up @@ -106,8 +106,9 @@
* value generated by jpackage every time {@link #execute} method is called if
* --win-upgrade-uuid command line option is not specified. Otherwise this
* variable is set to the value of --win-upgrade-uuid command line option
* <li>JpAllowDowngrades. Set to "yes" if --win-upgrade-uuid command line option
* was specified. Undefined otherwise
* <li>JpAllowUpgrades. Set to "yes", but all that matters is it is defined.
* <li>JpAllowDowngrades. Defined for application installers, and undefined for
* Java runtime installers.
* <li>JpConfigDir. Absolute path to the directory with generated WiX source
* files.
* <li>JpIsSystemWide. Set to "yes" if --win-per-user-install command line
Expand Down Expand Up @@ -450,7 +451,9 @@ private Map<String, String> prepareMainProjectFile(
upgradeCode));

data.put("JpAllowUpgrades", "yes");
data.put("JpAllowDowngrades", "yes");
if (!StandardBundlerParam.isRuntimeInstaller(params)) {
data.put("JpAllowDowngrades", "yes");
}

data.put("JpAppName", APP_NAME.fetchFrom(params));
data.put("JpAppDescription", DESCRIPTION.fetchFrom(params));
Expand Down
Expand Up @@ -12,6 +12,8 @@
<?define JpInstallerVersion=200 ?>
<?define JpCompressedMsi=yes ?>

<?include $(var.JpConfigDir)/overrides.wxi ?>

<?ifdef JpAllowUpgrades ?>
<?define JpUpgradeVersionOnlyDetectUpgrade="no"?>
<?else?>
Expand All @@ -23,8 +25,6 @@
<?define JpUpgradeVersionOnlyDetectDowngrade="yes"?>
<?endif?>

<?include $(var.JpConfigDir)/overrides.wxi ?>

<Product
Id="$(var.JpProductCode)"
Name="$(var.JpAppName)"
Expand Down
Expand Up @@ -18,15 +18,14 @@ Value of `Language` attribute of `Product` WiX element. Default value is 1033.
- JpInstallerVersion
Value of `InstallerVersion` attribute of `Package` WiX element. Default value is 200.
- JpCompressedMsi
Value of `Compressed` attribute of `Package` WiX element. Default value is `yes`.
- JpAllowDowngrades
Should be defined to enable downgrades and undefined to disable downgrades.
Default value is `yes`.
By default it is defined for applications and undefined for Runtime installer.
Use <?define JpAllowUpgrades = "foo" ?> to enable or <?undef JpAllowUpgrades?>
to disable (the value doesn't mater).
- JpAllowUpgrades
Should be defined to enable upgrades and undefined to disable upgrades.
Default value is `yes`.
By default it is defined, use <?undef JpAllowUpgrades?> to disable.
-->
<Include/>

1 comment on commit 4bab0eb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.