Create a test to verify jpackage adds OS-version condition in msi/exe installers and that this condition works.
OS-version condition was implemented inJDK-8150442.
msi/exe installer will block if the version of Windows where it executes is older than some value.
The test can use a custom OS-version condition that always fails, blocking the installer with this condition. Something like:
---
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<Condition Message="Not supported on this version of Windows">0</Condition>
<ComponentGroup Id="FragmentOsCondition"/>
</Fragment>
</Wix>
---
It is a variant of "os-condition.wxf" file at [1]
To implement this test, it is necessary to alter the PackageTest helper class to allow failed installations. Currently, if an installer fails, the test fails. However, the suggested test scenario should be the opposite - if the installer fails, the test passes.
[1] https://github.com/openjdk/jdk/blob/c2fc94782669ae1645014ee3bfeba957dbff4669/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/os-condition.wxf
OS-version condition was implemented in
msi/exe installer will block if the version of Windows where it executes is older than some value.
The test can use a custom OS-version condition that always fails, blocking the installer with this condition. Something like:
---
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<Condition Message="Not supported on this version of Windows">0</Condition>
<ComponentGroup Id="FragmentOsCondition"/>
</Fragment>
</Wix>
---
It is a variant of "os-condition.wxf" file at [1]
To implement this test, it is necessary to alter the PackageTest helper class to allow failed installations. Currently, if an installer fails, the test fails. However, the suggested test scenario should be the opposite - if the installer fails, the test passes.
[1] https://github.com/openjdk/jdk/blob/c2fc94782669ae1645014ee3bfeba957dbff4669/src/jdk.jpackage/windows/classes/jdk/jpackage/internal/resources/os-condition.wxf
- duplicates
-
JDK-8350014 Add a test for JDK-8150442
-
- Closed
-
- relates to
-
JDK-8150442 Enforce Supported Platforms in Packager for MSI bundles
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/3e86b3a8
-
Review(master) openjdk/jdk/23825