We have noticed that the file "a.exe" from v1.1.714 is not executed. Only the "a.exe" from v1.1.753 is executed.
That give us a problem as the final result is that the changes to the database from v1.1.714 are not applied. That is critical for those clients that have not previously upgraded to 1.1.714.
Is it the way how WyUpdate works????. Is it a bug?
It's not a bug, but you need to understand how wyBuild creates patches to understand why it's not a bug. Let's say you start off with 2 versions:
- 1.0
- 1.1
Let's say 1.1 executes a "update SQL 1.1.bat" batch file in the temporary folder. When you click build updates you'll generate 3 files:
- wyserver.wys
- yourapp.1.0.to.1.1.wyu
- yourapp.all.to.1.1.wyu
So when your customer updates your app the "yourapp.1.0.to.1.1.wyu" will be download, extracted, and installed and the "update SQL 1.1.bat" will be executed.
Now let's say you release a new version of your app: 1.2. Let's also say you want to execute a "update SQL 1.2.bat" batch file. You add the file, click execute, pass any parameters, etc. Then you build your updates. wyBuild will output 4 files:
- wyserver.wys
- yourapp.1.0.to.1.2.wyu
- yourapp.1.1.to.1.2.wyu
- yourapp.all.to.1.2.wyu
When a customer with 1.0 installed installs the update then the "yourapp.1.0.to.1.2.wyu" update will be downloaded, extracted, and installed and the "update SQL 1.2.bat" will be executed.
When a customer with 1.1 installed installs the update then the "yourapp.1.1.to.1.2.wyu" update will be downloaded, extracted, and installed and the "update SQL 1.2.bat" will be executed.
(Also, if a file fails to patch then "yourapp.all.to.1.2.wyu" will be installed and "yourapp.all.to.1.2.wyu" will be downloaded, extracted, and installed, and the "update SQL 1.2.bat" will be executed)
You 'll notice that no matter what version the customer has on the computer only "update SQL 1.2.bat" will be executed once you release version 1.2 of your app.
Why is this the case?
Because as of wyBuild 2.6.x, wyBuild only creates "direct patches". That is, the update downloaded and installed is a direct path from whatever version to the very latest version.
To solve your problem you need to include all SQL updates that will take place. Then you can optionally execute certain SQL updates based on what version the customer has installed. You can accomplish this by using the %versionto% and %versionfrom% variables when passing commandline arguments to the bat/exe you're executing.
Does that make sense?