mirror of
https://github.com/minio/minio.git
synced 2024-12-29 08:33:21 -05:00
eb7c690ea9
This PR allows 'minio update' to not only shows update banner but also allows for in-place upgrades. Updates are done safely by validating the downloaded sha256 of the binary. Fixes #4781
20 lines
348 B
Go
20 lines
348 B
Go
package update
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
func hideFile(path string) error {
|
|
kernel32 := syscall.NewLazyDLL("kernel32.dll")
|
|
setFileAttributes := kernel32.NewProc("SetFileAttributesW")
|
|
|
|
r1, _, err := setFileAttributes.Call(uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(path))), 2)
|
|
|
|
if r1 == 0 {
|
|
return err
|
|
} else {
|
|
return nil
|
|
}
|
|
}
|