Skip to main content

cleanup_old_binary

Function cleanup_old_binary 

Source
pub fn cleanup_old_binary()
Expand description

Clean up leftover .old binary from a previous self-update.

On Windows, the running exe cannot be deleted or overwritten, so during self-update we rename it to .old. This function removes that stale file on the next startup. It is safe to call on all platforms — on non-Windows it is a no-op.