Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Hardlinked Shim/Proxy Deletion #15

Open
mitsuhiko opened this issue May 20, 2023 · 1 comment
Open

Support Hardlinked Shim/Proxy Deletion #15

mitsuhiko opened this issue May 20, 2023 · 1 comment

Comments

@mitsuhiko
Copy link
Owner

mitsuhiko commented May 20, 2023

If one has an application that has hardlinked shims or proxies they also need to be delayed until restart. This is a problem that rustup also ran into. This would require more flexible APIs for both deletion and replacement and quite likely on windows it might require given the user some options about how to delete them.

Either the processes need to be terminated first, or the deletion has to be delayed somehow. Unfortunately MOVEFILE_DELAY_UNTIL_REBOOT requires elevated privileges.

Related rustup issues:

@mitsuhiko
Copy link
Owner Author

One way in which this might work is to have an API like this:

let mut replacer = Replacer::new();
replacer.self_delete()?;
replacer.delete_alias("path/to/hardlinked/file")?;

// or
replacer.self_replace("new-file")?;
replacer.self_replace_no_copy("path/to/hardlink/to/new-file");

Behind the scenes the first operation to the executor on windows could spawn the subprocess and then they use an anonymous pipe to communicate the files that should be deleted or replaced. A new API self_replace_no_copy would also need to be created so that hardlinks are not converted into copies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant