bright, fresh software
Downloads  |  Buy

Executing files in your update

Executing files as part of your update is simple. You can execute *.exe, *.bat, *.cmd, and *.msi files either before or after you've installed your update.

How to execute a file

Simply drag the executable file into wyBuild and click the "Execute file after updating has finished" checkbox.

Executing files before your update

When you add files to the temporary folder in wyBuild you will have the ability to execute files either before the update has started and/or after the update has completed:

Executing files in wyBuild

This gives you the ability to run custom scripts and executables, and then wyUpdate removes the files after the update has completed.

Rolling back update on non-zero return codes

If you have "Wait for execution to finish before continuing" and the file you're executing returns a non-zero exit code, then wyUpdate will rollback the update. If you don't want this, simply uncheck the "Rollback update on non-zero return codes" checkbox. You can also specify a comma separated list of return codes that won't cause the update to rollback.

%basedir% Variable

The %basedir% variable can be used as a commandline argument to the program you're executing. This allows you reference the correct location of your program's folder without hardcoding the location.

If you take a look at the screenshot above, you'll see the following commandline argument being passed to the *.bat file:

--folder="%basedir%\Important Stuff"

wyUpdate will automatically replace %basedir% with the location of the your program folder (e.g. C:\Program Files\Your Program).

Order of execution

By default wyUpdate executes files in the order they are listed in wyBuild. If you want to change the execution order then simply rename the file inside wyBuild:

Executing changing execution order

Updating databases (Microsoft SQL Server, MySQL, etc.)

You can use this "executing files" functionality to update your databases:

  1. Create your *.sql file that contains the SQL statements you'll be using to update the databases.
  2. Create a *.bat file that will call the commandline tool for your database. For example:
  3. Add the *.sql and *.bat files to the "Temporary folder" in wyBuild.
  4. Select the *.bat file and click "Execute file", select "After updating has finished", and check "Wait for execution to finish before continuing".