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.
Simply drag the executable file into wyBuild and click the "Execute file after updating has finished" checkbox.
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:
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:
This gives you the ability to run custom scripts and executables, and then wyUpdate removes the files after the update has completed.
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 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:
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.
You can also use the
%versionfrom% variables commandline arguments to the program you're executing. This allows you to make version-specific updates to your app.
%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.
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:
You can use this "executing files" functionality to update your databases: