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

ipfs-update should update itself #59

Open
jbenet opened this issue Mar 12, 2017 · 7 comments
Open

ipfs-update should update itself #59

jbenet opened this issue Mar 12, 2017 · 7 comments
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue

Comments

@jbenet
Copy link
Member

jbenet commented Mar 12, 2017

ipfs-update should update itself, too. it's annoying to have to go download it.

@techtonik
Copy link

And ipfs update should update it too.

@victorb
Copy link
Member

victorb commented Jul 7, 2017

And ipfs update should update it too.

The ipfs update command in go-ipfs simply calls ipfs-update if you have it installed, so as long as ipfs-update itself can update, ipfs update will seamlessly work.

@Kubuxu
Copy link
Member

Kubuxu commented Jul 7, 2017

This is a bit problematic on Windows as you can't replace the binary your are currently running.

What you have to do is have two binaries (ipfs-update.exe, ipfs-upate.new.exe) and during self update:

  1. download update as ipfs-update.new.exe
  2. run it and make it replace ipfs-update.exe with itself (but it can't remove itself as it is running.
  3. run ipfs-update.exe with some flag for it to remove ipfs-update.new.exe.

@victorb
Copy link
Member

victorb commented Jul 7, 2017

@Kubuxu there is a library for doing self-updates in golang that I've had success with using in the past, https://github.com/inconshreveable/go-update

We could use that (and maybe even be able to provide the self-updates via IPFS)

@techtonik
Copy link

This is a bit problematic on Windows as you can't replace the binary your are currently running.

On Windows you can rename that binary and write new one with the old name while the process is still running. After process exits, the old renamed binary can be safely deleted.

@techtonik
Copy link

So the algorithm:

  1. download update to ipfs.new.ex_
  2. check update is ok
  3. rename itself to ipfs.old.exe
  4. rename ipfs.new.ex_ to ipfs.exe
  5. run new process with some update --finish flag and exit
  6. new process tries to clean ipfs.old.exe three times with 3 sec intervals

@hsanjuan hsanjuan added exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue labels Jan 27, 2020
@godcong
Copy link
Contributor

godcong commented Sep 23, 2020

When we run ipfs update, if ipfs-update does not exist.
Maybe we should download ipfs to the specified directory instead of just prompting that it is not installed then let the user find ipfs-update, download it again, and run ipfs update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important help wanted Seeking public contribution on this issue
Projects
None yet
Development

No branches or pull requests

6 participants