From d7fb5f4bb56f3c6da73b9565480a538d9b647bce Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Sun, 17 Jun 2012 18:35:57 +0300 Subject: [PATCH] Minor changes --- SkinInstaller/DialogInstall.cpp | 13 +++++++++---- SkinInstaller/DialogPackage.cpp | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/SkinInstaller/DialogInstall.cpp b/SkinInstaller/DialogInstall.cpp index 1633c344..051fa842 100644 --- a/SkinInstaller/DialogInstall.cpp +++ b/SkinInstaller/DialogInstall.cpp @@ -489,8 +489,8 @@ bool CDialogInstall::ReadPackage() { m_PackageSkins.insert(item); } - else if (_wcsicmp(component, L"Themes") == 0 && - _wcsicmp(extension, L".thm") == 0 && + else if (_wcsicmp(component, m_PackageFormat == PackageFormat::Old ? L"Themes" : L"Layouts") == 0 && + _wcsicmp(extension, m_PackageFormat == PackageFormat::Old ? L".thm" : L".ini") == 0 && !IsIgnoredTheme(itemSz)) { m_PackageThemes.insert(item); @@ -773,10 +773,15 @@ bool CDialogInstall::InstallPackage() targetPath += path; error = !ExtractCurrentFile(targetPath); } - else if (_wcsicmp(component, L"Themes") == 0 && - _wcsicmp(extension, L".thm") == 0 && + else if (_wcsicmp(component, m_PackageFormat == PackageFormat::New ? L"Layouts" : L"Themes") == 0 && + _wcsicmp(extension, m_PackageFormat == PackageFormat::New ? L".ini" : L".thm") == 0 && m_PackageThemes.find(item) != m_PackageThemes.end()) { + if (m_PackageFormat == PackageFormat::New) + { + wcscpy_s(extension, 5, L".thm"); + } + targetPath = g_Data.settingsPath; targetPath += L"Themes\\"; targetPath += path; diff --git a/SkinInstaller/DialogPackage.cpp b/SkinInstaller/DialogPackage.cpp index 90ed0b91..894f4b11 100644 --- a/SkinInstaller/DialogPackage.cpp +++ b/SkinInstaller/DialogPackage.cpp @@ -282,8 +282,8 @@ bool CDialogPackage::CreatePackage() for (auto iter = m_ThemeFolders.cbegin(); iter != m_ThemeFolders.cend(); ++iter) { std::wstring realPath = (*iter).second + L"Rainmeter.thm"; - std::wstring zipPath = L"Themes\\" + (*iter).first; - zipPath += L"\\Rainmeter.thm"; + std::wstring zipPath = L"Layouts\\" + (*iter).first; + zipPath += L"\\Rainmeter.ini"; if (!AddFileToPackage(realPath.c_str(), zipPath.c_str())) { std::wstring error = L"Error adding theme '";