You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
self-update: automatically delete saved binary on next Windows startup #5109
The self-update command on Windows will save current running binary as rclone.old.exe. @albertony proposed in #5080 (comment) to transparently command Windows to remove saved binary upon next reboot.
How do you think rclone should be changed to solve that?
As explained in #5080 (comment), the relevant Windows API function is exposed as MoveFileEx with flag MOVEFILE_DELAY_UNTIL_REBOOT, so no direct registry access necessary - if it is easy to call the API from go or there is a library wrapping that function.
Existing code in lib/file/preallocate_windows.go, uses both syscall package and golang.org/x/sys/windows to access Windows API functionality. Looks like required function MoveFileEx and constant MOVEFILE_DELAY_UNTIL_REBOOT are both exposed in x/sys/windows. Syscall and x/sys are overlapping, but syscall is....
Deprecated: this package is locked down. Callers should use the corresponding package in the golang.org/x/sys repository instead.
Activity
albertony commentedon Mar 11, 2021
Existing code in
lib/file/preallocate_windows.go, uses bothsyscallpackage andgolang.org/x/sys/windowsto access Windows API functionality. Looks like required functionMoveFileExand constantMOVEFILE_DELAY_UNTIL_REBOOTare both exposed in x/sys/windows. Syscall and x/sys are overlapping, but syscall is....(https://golang.org/pkg/syscall/)
Edit: Use of
MoveFileExwithMOVEFILE_DELAY_UNTIL_REBOOTrequires admin privileges:(https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexa)