Wrapper Guide
Installation
- Download a binary for your system from the releases on GitHub (SC means self-contained, FD means framework-dependent so it needs dotnet installed) or build the code yourself
- Create a folder for the entire application and enter it
- Create a subfolder Live/ and place the program to be watched in there (this is where the current version is always kept)
- Create a subfolder Wrapper/ and place the Wrapper binary in there
- Create a file Wrapper.config according to the guide (see above, at least Target must be set)
- Execute the Wrapper binary in Wrapper/ (maybe create a service for it)
Configuration
This is done in Wrapper.config, each possible line consists of a key and a value like key=value
.
Target=MyProgram
sets the path of the target program relative to Live/ (required!).
Arguments=arg1 arg2
sets the launch arguments for the target program (default: none).
AutoRestart=true
automatically restarts the target when it exits (default: false). To temporary prevent this, you can use the command wrapper set AutoRestart=false
.
LogFile=Wrapper.log
sets the location of the log file to write to (default: no log file).
LogLimit=50000
limits the log file to 50000 characters (that's the default).
Timestamps=true
prepends UTC timestamps to each line of the log (default: false).
DisableCommands=true
disables wrapper commands called from the target (default: false).
CreateBackup=true
backs up the current version of the target to Backup/ each time it is updated (allows rollbacks).
Updating the target
Create a subfolder Update/ and place the new binary in there. Next time the watched program starts, the new version will be applied. A backup of the last version might be created if configured.
Reverting to the previous version
Note that this is only possible if CreateBackup=true
is configured.
If that's the case, just have the target output wrapper rollback
(command) in the console. Next time it starts, the previous version will be loaded.
Commands
These can be executed by the target program by outputting wrapper some-awesome-command
to the console.
wrapper set key=value
temporarily overrides the wrapper's configuration with the provided key and value until the wrapper exits or wrapper reload-config
is called.
wrapper reload-config
reloads the configuration from Wrapper.config.
wrapper log-clear
clears the log file.
wrapper log-backup
backs up the log file to [log file path].backup for safe viewing.
wrapper rollback
requests the wrapper to revert the target to its previous version when it is started again.