mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
SkinInstaller: Remove "UseD2D" in installed themes
This commit is contained in:
parent
6248f07634
commit
9085f2ae20
@ -808,8 +808,7 @@ bool DialogInstall::InstallPackage()
|
||||
error = !ExtractCurrentFile(targetPath);
|
||||
if (!error)
|
||||
{
|
||||
// Clear the [Rainmeter] section.
|
||||
WritePrivateProfileSection(L"Rainmeter", L"", targetPath.c_str());
|
||||
CleanLayoutFile(targetPath.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1043,6 +1042,25 @@ void DialogInstall::LaunchRainmeter()
|
||||
}
|
||||
}
|
||||
|
||||
void DialogInstall::CleanLayoutFile(const WCHAR* file)
|
||||
{
|
||||
// Clear the [Rainmeter] section.
|
||||
WritePrivateProfileSection(L"Rainmeter", L"", file);
|
||||
|
||||
// Remove the UseD2D key from all sections.
|
||||
WCHAR buffer[4096];
|
||||
if (GetPrivateProfileSectionNames(buffer, _countof(buffer), file) > 0)
|
||||
{
|
||||
const WCHAR* section = buffer;
|
||||
size_t sectionLength = 0;
|
||||
while ((sectionLength = wcslen(section)) > 0)
|
||||
{
|
||||
WritePrivateProfileString(section, L"UseD2D", nullptr, file);
|
||||
section += sectionLength + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Helper for the IsIgnore... functions.
|
||||
bool IsIgnoredName(const WCHAR* name, const WCHAR* names[], int namesCount)
|
||||
{
|
||||
|
@ -88,6 +88,8 @@ private:
|
||||
void LaunchRainmeter();
|
||||
void KeepVariables();
|
||||
|
||||
static void CleanLayoutFile(const WCHAR* file);
|
||||
|
||||
static bool IsIgnoredSkin(const WCHAR* name);
|
||||
static bool IsIgnoredLayout(const WCHAR* name);
|
||||
static bool IsIgnoredAddon(const WCHAR* name);
|
||||
|
Loading…
Reference in New Issue
Block a user