The following is a self-updating program written in Go that showcases how to use Keygen for licensing and how to implement auto-update functionality within a command line program using Keygen Dist.
First up, install dependencies with dep
:
dep ensure
To compile for your operating system, simply run the following from the root of the project directory:
go build
To compile for all platforms using gox
, run the following:
gox -output "dist/v1.x.x/{{.OS}}-{{.Arch}}/{{.Dir}}"
You can download pre-built binaries for 64bit operating systems. The pre-built binaries are of v1.0.0, so you will still be able to test auto-update functionality.
Below is a list of license keys you can use to test program functionality.
Key | Validity |
---|---|
val-key |
Valid |
sus-key |
Suspended |
exp-key |
Expired |
Enter a valid license key and when available, press ctrl+u
to install the
update from v1.0.0 to v1.0.1. It will download the update, and then replace
the current executable with the updated one. You can then rerun the program
to use the newly updated version.
Reach out at support@keygen.sh if you have any questions or concerns!