Control of temporary files execution

HI All I have been searching in the forum in order to see if someone else had the same situation.

We have deployed a patch version 1.1.714 that executes a file (lets say "a.exe"). This file create a batch command with some sqlcmd commands and sql scripts for modifiying the database. That is working nicely.

Now, we have generated a second patch version 1.1.753 and modified the file "a.exe". Again creating a batch file, but executing sqlcmd with different sql scripts with additional changes to the database.

That works fine in our testing server. However, we have on purpose reverse the application to version 1.1 and execute the WyUpdate.exe.

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?

If it is not a bug, then i believe that a way for solving that is executing an accumulative script in all the new patches in order to ensure that all changes will be applied.

Now, imagine that I am not executing scripts and instead the "a.exe" (v1.1.714) generates some records in the registry of windows. What would happen if the clients are upgrating from v1.1 to v1.1.999? Do I need to add the same "a.exe" on every patch?

Can someone advise what is the best approach for this as we would not like to execute the same files in every single patch.

RegardsJorge Enrique

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. 1.0
  2. 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:

  1. wyserver.wys
  2. yourapp.1.0.to.1.1.wyu
  3. 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:

  1. wyserver.wys
  2. yourapp.1.0.to.1.2.wyu
  3. yourapp.1.1.to.1.2.wyu
  4. 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?

Thanks Wyatt

That is very clear. I am going to use the version variable in order to know which scripts to execute as you recomend. Thanks a lot....

RegardsJorge Enrique