Description
Describe the Bug:
When using a FOMOD installer, modifying the value of a previously set flag can result in unexpected behaviour:
- If a flag is set to "On" and a step after it has an option that modifies its value, the flag can be set to "Off" even if the selected option does not affect the flag.
- If an option changes the value of a flag used in a condition to determine the visibility of a previous step, that step may be erroneously be hidden or displayed when using the button to move back a step.
To Reproduce:
See attached file for a FOMOD installer that demonstrates this issue.
The installer has four steps:
- Step 1 sets the 'Test' flag to 'On.'
- Step 2 requires 'Test' == 'On' for it to be displayed.
- Step 3 has options to change the value of the 'Test' flag, showing the different results.
- Step 4 requires 'Test' == 'On' for it to be displayed.
-
Use Vortex to install the demo FOMOD. Moving through the steps, you should see step 1, 2, and 3 displayed.
-
Step 3 has three options:
A. Set 'Test' flag to 'Off'
B. Don't Change Flag State
C. Set 'Test' to 'On' -
If Option A is chosen, the back button (bottom left) will change to lead back to Step 1, and the forward button (bottom right) will finish the install, correctly skipping Step 4.
-
Click the back button to return to Step 1. The forward button will now lead to Step 3 instead of Step 2.
-
Move back to Step 3 and select Option B instead. Despite not setting or changing any flags, the back button will lead to Step 1, and the forward button will still finish the install instead of displaying Step 4 (Note: This remains true even if you restart the install and skip selecting Option A, or select Option C and then change to Option B).
-
Change the selection in Step 3 to Option C. Step 2 and 4 will be displayed as expected.
Expected Behavior:
- The back button should always lead to the step the user saw previously. Steps the user has seen should not be hidden when moving backward if the value of the flag controlling their visibility changes. If a step was not displayed when going forward through the install the first time, changing the value of the flag controlling its visibility should not let it become visible when moving backward.
- If a selected option makes no changes to a previously set flag, the value of that flag should not change.
- If a step has options that do make changes to the value of a previously set flag, those changes should be reverted when moving in reverse.
Platform:
- OS: Windows 10 Home, Version 22H2, OS Build 19045.4651, x64
- Vortex Version: 1.11.7
Additional Context:
From my testing, it appears that if a step has any option that modifies the value of a previously set flag, then selecting options that do not change that flag will result in it being set to "Off" (even if they set a different flag).
For example, if Option A is omitted from Step 3 in the demo file, selecting Option B will still result in 'Test' being set to 'Off' in Step 3. If both Option A and Option C are omitted, then Option B will have no effect on the 'Test' flag and behave as expected.
The order of the options in Step 3 does not appear to have any affect on the incorrect flag values. If Option C is put first in the list, Option B will still set the 'Test' flag to 'Off.' Changing the names of the options so they have a different alphabetical order also has no effect.
Please let me know if I can provide any more information, or if anything is unclear. If you'd like assistance with testing possible fixes I'm happy to help with that as well!