diff options
| author | a1xd <[email protected]> | 2021-09-24 02:04:43 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-09-24 02:04:43 -0400 |
| commit | 2896b8a09ce42e965705c58593b8738adc454f7f (patch) | |
| tree | 71e4d0cff60b5a1ad11427d78e1f8c7b775e5690 /uninstaller | |
| parent | Merge pull request #107 from a1xd/1.5.0-fix (diff) | |
| parent | make note clearer (diff) | |
| download | rawaccel-dark-mode.tar.xz rawaccel-dark-mode.zip | |
v1.6
Diffstat (limited to 'uninstaller')
| -rw-r--r-- | uninstaller/uninstaller.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/uninstaller/uninstaller.cpp b/uninstaller/uninstaller.cpp index bd9c564..3434cb7 100644 --- a/uninstaller/uninstaller.cpp +++ b/uninstaller/uninstaller.cpp @@ -14,22 +14,22 @@ int main() { } }); - fs::path target = get_target_path(); + fs::path target = expand(DRIVER_ENV_PATH); fs::path tmp = make_temp_path(target); - if (fs::exists(target) || fs::exists(tmp)) { + if (fs::exists(target)) { reboot_required = true; - } - // schedule tmp to be deleted if rename target -> tmp is successful - if (MoveFileExW(target.c_str(), tmp.c_str(), MOVEFILE_REPLACE_EXISTING)) { - MoveFileExW(tmp.c_str(), NULL, MOVEFILE_DELAY_UNTIL_REBOOT); - } - else { // tmp is in use and delete is already scheduled - if (fs::exists(target)) fs::remove(target); + // schedule tmp to be deleted if rename target -> tmp is successful + if (MoveFileExW(target.c_str(), tmp.c_str(), MOVEFILE_REPLACE_EXISTING)) { + MoveFileExW(tmp.c_str(), NULL, MOVEFILE_DELAY_UNTIL_REBOOT); + } + else { // tmp is in use and delete is already scheduled + fs::remove(target); + } } - if (reboot_required) { + if (reboot_required || fs::exists(tmp)) { std::cout << "Removal complete, change will take effect after restart.\n"; } else { |