mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 23:11:14 +01:00
Updater: Delete the file we check for write rights with on Windows.
This commit is contained in:
parent
f0fb8c22b0
commit
5ebb894685
@ -38,13 +38,15 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE* test_fh =
|
const auto test_fh = ::CreateFileW(
|
||||||
_wfopen((std::filesystem::path(*path).parent_path() / "Updater.log").c_str(), L"w");
|
(std::filesystem::path(*path).parent_path() / "directory_writable_check.tmp").c_str(),
|
||||||
|
GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS,
|
||||||
|
FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE, nullptr);
|
||||||
|
|
||||||
if (test_fh == nullptr)
|
if (test_fh == INVALID_HANDLE_VALUE)
|
||||||
need_admin = true;
|
need_admin = true;
|
||||||
else
|
else
|
||||||
fclose(test_fh);
|
CloseHandle(test_fh);
|
||||||
|
|
||||||
if (need_admin)
|
if (need_admin)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user