mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 19:08:26 -06:00
Windows: code refactoring
This commit is contained in:
@@ -2717,10 +2717,12 @@ namespace VeraCrypt
|
|||||||
}
|
}
|
||||||
if (GetSetupconfigLocation (szSetupconfigLocation, ARRAYSIZE (szSetupconfigLocation)))
|
if (GetSetupconfigLocation (szSetupconfigLocation, ARRAYSIZE (szSetupconfigLocation)))
|
||||||
{
|
{
|
||||||
|
if (bForInstall)
|
||||||
::CreateDirectoryW (szSetupconfigLocation, NULL);
|
::CreateDirectoryW (szSetupconfigLocation, NULL);
|
||||||
|
|
||||||
StringCchCatW (szSetupconfigLocation, ARRAYSIZE (szSetupconfigLocation), L"SetupConfig.ini");
|
StringCchCatW (szSetupconfigLocation, ARRAYSIZE (szSetupconfigLocation), L"SetupConfig.ini");
|
||||||
|
|
||||||
|
if (bForInstall || FileExists (szSetupconfigLocation))
|
||||||
WritePrivateProfileStringW (L"SetupConfig", L"ReflectDrivers", bForInstall? szInstallPath : NULL, szSetupconfigLocation);
|
WritePrivateProfileStringW (L"SetupConfig", L"ReflectDrivers", bForInstall? szInstallPath : NULL, szSetupconfigLocation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3837,20 +3839,13 @@ namespace VeraCrypt
|
|||||||
device.Write (bootLoaderBuf, sizeof (bootLoaderBuf));
|
device.Write (bootLoaderBuf, sizeof (bootLoaderBuf));
|
||||||
}
|
}
|
||||||
|
|
||||||
// starting from Windows 10 1607 (Build 14393), ReflectDrivers in Setupconfig.ini is supported
|
if (!IsAdmin() && IsUacSupported())
|
||||||
if (IsOSVersionAtLeast (WIN_10, 0) && CurrentOSBuildNumber >= 14393)
|
|
||||||
{
|
{
|
||||||
wchar_t szSetupconfigLocation [TC_MAX_PATH + 20];
|
Elevator::UpdateSetupConfigFile (false);
|
||||||
|
|
||||||
if (GetSetupconfigLocation (szSetupconfigLocation, ARRAYSIZE (szSetupconfigLocation)))
|
|
||||||
{
|
|
||||||
StringCchCatW (szSetupconfigLocation, ARRAYSIZE (szSetupconfigLocation), L"SetupConfig.ini");
|
|
||||||
|
|
||||||
if (FileExists (szSetupconfigLocation))
|
|
||||||
{
|
|
||||||
WritePrivateProfileStringW (L"SetupConfig", L"ReflectDrivers", NULL, szSetupconfigLocation);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UpdateSetupConfigFile (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user