From 78156f34166c110fcad47aef166684b8e25ac4fa Mon Sep 17 00:00:00 2001 From: a1xd <68629610+a1xd@users.noreply.github.com> Date: Wed, 22 Jul 2020 19:34:13 -0400 Subject: Add project files. --- uninstaller/uninstaller.cpp | 29 +++++++++++++ uninstaller/uninstaller.vcxproj | 91 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 uninstaller/uninstaller.cpp create mode 100644 uninstaller/uninstaller.vcxproj (limited to 'uninstaller') diff --git a/uninstaller/uninstaller.cpp b/uninstaller/uninstaller.cpp new file mode 100644 index 0000000..4d02715 --- /dev/null +++ b/uninstaller/uninstaller.cpp @@ -0,0 +1,29 @@ +#include + +#include + +int main() { + try { + modify_upper_filters([](std::vector& filters) { + std::erase(filters, DRIVER_NAME); + }); + + fs::path target = get_target_path(); + fs::path tmp = make_temp_path(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 + if (fs::exists(target)) fs::remove(target); + } + std::cout << "Removal complete, change will take effect after restart.\n"; + } + catch (std::exception e) { + std::cerr << "Error: " << e.what() << '\n'; + } + + std::cout << "Press any key to close this window . . .\n"; + _getwch(); +} diff --git a/uninstaller/uninstaller.vcxproj b/uninstaller/uninstaller.vcxproj new file mode 100644 index 0000000..95a9dc8 --- /dev/null +++ b/uninstaller/uninstaller.vcxproj @@ -0,0 +1,91 @@ + + + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {a4097ff6-a6f0-44e8-b8d0-538d0fb75936} + uninstaller + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + true + + + false + + + + Level4 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpplatest + + + Console + true + RequireAdministrator + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + stdcpplatest + + + Console + true + true + true + RequireAdministrator + + + + + + + + + \ No newline at end of file -- cgit v1.2.3