mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Fix self-update on windows (#712)
Fixed #702 * Add new dep windows v0.44.0 for windows only * Add regression test for #702 * Impl `win::replace_file` * Use `ReplaceFileW` on windows if `fs::rename` in `fs::atomic_install` fails * Improve logging and err messages * Add more regression tests * Make `BinFile::install_link` atomic: Do not remove file if dst exists * Fallback to `ReplaceFileW` in `fs::atomic_symlink_file` * Refactor: Extract new fn `fs::persist` * Use `fs::persist` instead of `TempFile::persist` in `fs::atomic_install`, which fallbacks to `ReplaceFileW` on windows Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> Co-authored-by: Félix Saparelli <felix@passcod.name>
This commit is contained in:
parent
a60ae7ef6c
commit
ab4da7f059
6 changed files with 153 additions and 38 deletions
|
@ -39,6 +39,9 @@ tracing = "0.1.37"
|
|||
url = { version = "2.3.1", features = ["serde"] }
|
||||
xz2 = "0.1.7"
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
windows = { version = "0.44.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] }
|
||||
|
||||
[features]
|
||||
default = ["static", "rustls"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue