GandaG / pyfomod

A high-level fomod library written in Python.
https://pyfomod.rtfd.io/
Apache License 2.0
7 stars 6 forks source link

Cannot install mods due to default value mismatch for flag conditions that have never been set #11

Open leontristain opened 4 years ago

leontristain commented 4 years ago

Hi GandaG!,

I believe I found a bug that prevents the installation of some mods due to different expectations on default value matches.

Please see the latest version of The Men of Winter for Skyrim SE, the first of two main files, labeled "The Men of Winter SSE", version V5.3, uploaded date 08 May 2020 8:58PM. (nexus file id 138832, size 128788 in kb).

In its ModuleConfig.xml, there are options that would set the flag MiraakOption to "On". These are not required options and the user does not have to choose them. These are the only places in the xml that attempt to set this flag to anything.

The final page of the installer is implemented with the last two <installStep>s, each conditionalized on MiraakOption being either "On" or "". If the user did not choose the optional option that results in MiraakOption being "On", the xml seems to expect that MiraakOption == "" would resolve to True.

With the current pyfomod, a flag that has never been explicitly set via an option would simply be missing in the .flags() list, and a missing flag will cause a flag condition to resolve to False even when compared to "". This means if the user never chose the MiraakOption = "On" option, the final page (which contains a lot of default files) will simply be skipped, resulting in an empty install.

In contrast, the latest release of MO2 will install this correctly. I don't know what's the true correct behavior for fomods, but I feel like anything MO2 supports that pyfomod differ would not be desirable.

Thanks, leontristain