Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add upgrade command to support self upgrade (#239) #239

Merged
merged 14 commits into from
Apr 26, 2024
Merged

feat: add upgrade command to support self upgrade (#239) #239

merged 14 commits into from
Apr 26, 2024

Conversation

yanecc
Copy link
Contributor

@yanecc yanecc commented Apr 24, 2024

I have implemented the Windows part based on @ankit-pn's work at #38 and resolved the conflicts, it is now able to work as expected, namely upgrade to the latest version 0.4.1.

ankit-pn and others added 7 commits January 29, 2024 20:19
commit 830d706
Author: ankit-pn <miankitsingh@gmail.com>
Date:   Wed Jan 31 09:21:13 2024 +0530

    fix: fomat the file and used internal decompressor

commit fd0eb8b
Author: ankit-pn <miankitsingh@gmail.com>
Date:   Tue Jan 30 16:27:05 2024 +0530

    feat: add self -upgrade feature.

commit f478217
Author: ankit-pn <miankitsingh@gmail.com>
Date:   Mon Jan 29 20:19:27 2024 +0530

    fix: mac arm64 installation
This reverts commit 5b9fada, reversing
changes made to e47ca05.
@jan-bar
Copy link
Contributor

jan-bar commented Apr 24, 2024

Is it possible to introduce some third-party libraries or refer to the implementation of third-party libraries to complete this function?

https://github.com/inconshreveable/go-update
https://github.com/minio/selfupdate
https://github.com/sanbornm/go-selfupdate

This go version management tool supports self-update, and everything works fine when I use it under window.
https://github.com/voidint/g/blob/master/cli/self_update.go#L19

@aooohan
Copy link
Member

aooohan commented Apr 25, 2024

Is it possible to introduce some third-party libraries or refer to the implementation of third-party libraries to complete this function?

I don't like to introduce too many third party packages.

@jan-bar
Copy link
Contributor

jan-bar commented Apr 25, 2024

I don't like to introduce too many third party packages.

can refer to related implementations
just wanted to get some inspiration from these libraries

@aooohan
Copy link
Member

aooohan commented Apr 25, 2024

There is an issue. We need to ask for administrator privileges when upgrading for vfox installed by setup, which is currently not handled by this change.

I've fixed the issue, but I don't have write access to your repository, so I can't commit at the moment.

@yanecc
Copy link
Contributor Author

yanecc commented Apr 25, 2024

There is an issue. We need to ask for administrator privileges when upgrading for vfox installed by setup, which is currently not handled by this change.

I've fixed the issue, but I don't have write access to your repository, so I can't commit at the moment.

I have invited you as collaborator. Here is my repo.

Copy link
Member

@aooohan aooohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it on Windows.

@yanecc
Copy link
Contributor Author

yanecc commented Apr 25, 2024

Is it possible to introduce some third-party libraries or refer to the implementation of third-party libraries to complete this function?

https://github.com/inconshreveable/go-update https://github.com/minio/selfupdate https://github.com/sanbornm/go-selfupdate

This go version management tool supports self-update, and everything works fine when I use it under window. https://github.com/voidint/g/blob/master/cli/self_update.go#L19

I have diligently read about the libraries related to self-update, and the tool you mentioned just relies on one of them (voidint/go-update).
For self-update on Windows, there are roughly two types.
The most common is to hide the old executable.

sanbornm/go-selfupdate
voidint/go-update
minio/selfupdate
inconshreveable/go-update
555f/selfupdate
starudream/go-lib

(The above is completely the same.)
Another way is to insert a randomness in the name to mitigate it.

artpar/rclone

I would prefer the current handling method, which actually removes the old executable with the cmd tool of Windows itself.

cmd/commands/upgrade.go Outdated Show resolved Hide resolved
cmd/commands/upgrade.go Outdated Show resolved Hide resolved
@yanecc yanecc requested a review from Chance-fyi April 26, 2024 07:17
@yanecc yanecc requested review from Chance-fyi and aooohan April 26, 2024 07:44
cmd/commands/upgrade.go Outdated Show resolved Hide resolved
@aooohan aooohan merged commit 659d8d7 into version-fox:main Apr 26, 2024
@aooohan aooohan changed the title Support self upgrade feat: add upgrade command to support self upgrade (#239) Apr 26, 2024
This was referenced Apr 26, 2024
@aooohan
Copy link
Member

aooohan commented Apr 26, 2024

@yanecc Hi, are you interested in joining VersionFox?

@yanecc
Copy link
Contributor Author

yanecc commented Apr 26, 2024

@yanecc Hi, are you interested in joining VersionFox?

Sure, It's my pleasure 😎

@aooohan
Copy link
Member

aooohan commented Apr 26, 2024

@yanecc Hi, are you interested in joining VersionFox?

Sure, It's my pleasure 😎

I have invited you, please check your email and join the Discord. ; )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants