I've written some tests to debug the MSI Installer in wine, in which I have tested various SQL statements against the America's Army installer database and iterated through the queries. Here are the results.
It appears that in my attachment, where.txt, which is a standard where sql statement, SELECT * FROM `Media` WHERE `LastSequence` > 1 that it returns the SQL statement correctly.
Then in orderby.txt i query SELECT * FROM `Media` ORDER BY `LastSequence` and it returns the results as expected.
Then in compoundsql.txt I query SELECT * FROM `Media` WHERE `LastSequence` > 1 ORDER BY `LastSequence`, which is just as the statement appears in InstallFiles().
In this query it ignores the WHERE CLAUSE and uses what is to the far right , the ORDER BY LastSequence statement, which first grabs the LastSequence of 0.
In conclusion, the actual problem in InstallFiles() is the inability to handle the compound SQL statement with a WHERE and an ORDER BY together.
Unfortunately I don't understand wine's SQL underpinnings enough to where I can implement a solution. I've looked it over and it appears somewhat cryptic, so I will need some help.