dawenxi-tech / 2fa

A 2FA desktop application.
MIT License
2 stars 1 forks source link

version identification #32

Closed gedw99 closed 9 months ago

gedw99 commented 9 months ago

We need to identify the version installed, so that updates are possible later. Its just good practice anyway to do this.

With a golang app it would be:

go build -ldflags="-X 'github.com/dawenxi-tech/2fa/commands.Version=$(git describe --tags)'" -o "2fa-$(git describe --tags)-windows-amd64.exe"

For gio, I think its possible too but need to work it out and do it in the Makefile.

This will setup the basis for releases and updates to Desktop versions.

gedw99 commented 9 months ago

@heramerom

I have committed the Version info to main.go and done the Makefile adjustments so that Version is a first class thing in the app and Make and CI.

make env-print shows it like here: https://github.com/dawenxi-tech/2fa/actions/runs/7130483149/job/19416944730#step:5:72

Builds of windows and Mac and Linux us it as an LDFlag.

In the main.go, you could add a bit of gui to allow the user to see what version they are on.
Where to put it I am not sure, but I suspect for now just something somewhere on the main screen will do for now. Maybe at the very bottom. It will also allow us to verify the version info is working.


Later we will make it Prompt the User to do an Upgrade when a new release happens in GitHub actions.

A good example of a nice clean upgrade cycle of a GUI that has a Systray is the the Cloudflare WARP app. You can install it on any Desktop and it will prompt you to Upgrade.

https://1.1.1.1 is where you can download it from.

gedw99 commented 9 months ago

screen shot showing how their gui can open a window from the systray to see things like version, logs , etc if we want to also do something like that later.

Logs would be really useful actually.

Screenshot 2023-12-07 at 16 03 29
gedw99 commented 9 months ago

am closing this as its done.

will make a new issue for showing the version in the GUI.