go-update icon indicating copy to clipboard operation
go-update copied to clipboard

Restart process after update

Open seguidor777 opened this issue 7 years ago • 3 comments

Hello, is this functionallity already present? I just looked into the code and found that it only replaces the current file, but does not kill that and start the new file. Do I need to make my own implementation to control the execution?

Regards Jorge Luna

seguidor777 avatar Oct 11 '18 21:10 seguidor777

i want so

jiguangsdf avatar Jan 16 '19 18:01 jiguangsdf

Naive approach:

if err = update.Apply(bin, update.Options{}); err != nil {
    panic(err)
}
if err = syscall.Exec(binPath, os.Args, os.Environ()); err != nil {
    panic(err)
}

Edit: This should work -- I just didn't have first arg path set correctly when I first posted this.

tjk avatar Feb 07 '20 17:02 tjk

@tjk panic: not supported by windows

giter avatar Jul 22 '20 13:07 giter