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.

Elevation level

The term "elevation level" refers to UAC (User Account Control) on Windows Vista, Windows 7, Windows 8, and above. An "elevated" process is one that is equivalent to an unrestricted admin.

By default wyUpdate starts all exectuables as the same elevation as wyUpdate. That is, if wyUpdate is running as "elevated", then executables with the elevation type of "Same as wyUpdate" will be started as elevated. You can set the elevation level to any of the following values:

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\). Note: the %basedir% variable has the trailing backslash.

%versionto% and %versionfrom% variables

You can also use the %versionto% and %versionfrom% variables commandline arguments to the program you're executing. This allows you to make version-specific updates to your app.

%wu-temp% variable

The %wu-temp% variable allows you to reference the temporary directory used by wyUpdate during the update process. It's where the files you put in the "Temporary folder" in wyBuild are sitting. Note: the %wu-temp% variable has the trailing backslash.

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".