Minor changes.

This commit is contained in:
Birunthan Mohanathas 2011-11-27 16:37:39 +00:00
parent abb1831092
commit 2e22c542cc

View File

@ -29,7 +29,7 @@ GLOBALDATA g_Data;
*/ */
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow)
{ {
bool loadTheme = (wcsncmp(lpCmdLine, L"/LOADTHEME ", 11) == 0); bool loadTheme = (_wcsnicmp(lpCmdLine, L"/LoadTheme ", 11) == 0);
if (wcscmp(lpCmdLine, L"/BACKUP") != 0 && !loadTheme) if (wcscmp(lpCmdLine, L"/BACKUP") != 0 && !loadTheme)
{ {
// Temporary solution until Rainstaller rewrite // Temporary solution until Rainstaller rewrite
@ -169,8 +169,8 @@ void LoadTheme(const WCHAR* name)
theme += name; theme += name;
std::wstring wallpaper = theme + L"\\RainThemes.bmp"; std::wstring wallpaper = theme + L"\\RainThemes.bmp";
theme += L"\\Rainmeter.thm"; theme += L"\\Rainmeter.thm";
CopyFiles(theme, g_Data.iniFile); if (CopyFiles(theme, g_Data.iniFile))
{
PreserveSetting(backup, L"SkinPath"); PreserveSetting(backup, L"SkinPath");
PreserveSetting(backup, L"ConfigEditor"); PreserveSetting(backup, L"ConfigEditor");
PreserveSetting(backup, L"LogViewer"); PreserveSetting(backup, L"LogViewer");
@ -190,6 +190,7 @@ void LoadTheme(const WCHAR* name)
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)wallpaper.c_str(), SPIF_UPDATEINIFILE); SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)wallpaper.c_str(), SPIF_UPDATEINIFILE);
} }
} }
}
void PreserveSetting(const std::wstring& from, LPCTSTR key, bool replace) void PreserveSetting(const std::wstring& from, LPCTSTR key, bool replace)
{ {