Skip to content

Commit 4aad553

Browse files
committed
Fix minimumUpdateVersion for MSI for multiple instance setups with large count of possible instances.
1 parent b7103b0 commit 4aad553

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/com/inet/gradle/setup/msi/WxsFileBuilder.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ private void addMinimumVersionCheck( String upgradeCode, int instance ) {
253253
Element customAction = getOrCreateChildByKeyValue( product, "CustomAction", "Id", "UpgrateFromVersionNotSupported_" + instance );
254254
addAttributeIfNotExists( customAction, "Error", message );
255255

256-
Element action = addCustomActionToSequence( "UpgrateFromVersionNotSupported_" + instance, false, "FindRelatedProducts", true, null );
256+
// we use "LaunchConditions" because there are more free unique sequence numbers
257+
Element action = addCustomActionToSequence( "UpgrateFromVersionNotSupported_" + instance, false, "LaunchConditions", true, null );
257258
action.setTextContent( "UNSUPPORTED_UPGRADE_VERSION_FOUND_" + instance );
258259
}
259260
}
@@ -1430,7 +1431,12 @@ private void addMultiInstanceTransforms() throws IOException {
14301431
addAttributeIfNotExists( upgradeVersion, "Minimum", "0.0.0.0" );
14311432
addAttributeIfNotExists( upgradeVersion, "MigrateFeatures", "yes" );
14321433

1433-
addMinimumVersionCheck( guid, i );
1434+
if( i < 100 ) {
1435+
// There are only a limit actions possible after "LaunchConditions" that we limit this feature to 100.
1436+
// If there are more then the error is: "error LGHT0179 : The InstallUISequence table contains an action 'UpgrateFromVersionNotSupported_3' which cannot have a unique sequence number because it is scheduled before or after action 'LaunchConditions'. There is not enough room before or after this action to assign a unique sequence number. Please schedule one of the actions differently so that it will be in a position with more sequence numbers available. Please note that sequence numbers must be an integer in the range 1 - 32767 (inclusive).
1437+
// https://github.com/wixtoolset/wix3/blob/develop/src/tools/wix/Data/actions.xml
1438+
addMinimumVersionCheck( guid, i );
1439+
}
14341440
}
14351441
Element executeSequence = getOrCreateChild( product, "InstallExecuteSequence" );
14361442
Element removeExistingProducts = getOrCreateChild( executeSequence, "RemoveExistingProducts" );

0 commit comments

Comments
 (0)