Executing a file from Temporary Folder in Multiple Versions

Hi again.

I am facing the following problem and i cannot find a way to resolve it. I have the version 1.0.0.2 where a file from the temporary folder is executed after the installation. This file executes sql scripts to update the database. Now i have build the version 1.0.0.3 and i have include the same files in temporary folder with the execution command to cover the situation with the clients that have a version previous of the 1.0.0.2 and they will try to update the software now. They must also update the database. I tried this with a client version 1.0.0.1 and works perfectly. I tried the update with a client version 1.0.0.2 (which means that the update has already run by updating from previous version to 1.0.0.2) and i was expecting that the updater will not execute the command from temporary folder but i was wrong. The updater execute again the command, which returns an error message, and the updater rollback to the previous version.

Any suggestions?

Best regardsThomas

Hey Thomas,

If I understand you correctly, you want to update a database that was changed in version 1.0.0.2, from your new update 1.0.0.3. The script or exe you're executing in the temporary folder will run no matter the version you're updating from. This means you need to add some logic to your script. You can do this a few different ways, but by far the best solution to your problem is to version your database schemas. That is, store the schema version in a table, then modify your update script to bail out if the schema version is the latest (e.g. "... WHERE schema_version = '1.0.0.2' ..." ).

I thought so that the script must do the job. I was hoping that the updater will follow the same procedure as it does while updating the files but as you said I thought that the temporary execute files no matter version i am updating from.

I will try to change the script in order to update the database.

Thanks,

Thomas