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)
{
bool loadTheme = (wcsncmp(lpCmdLine, L"/LOADTHEME ", 11) == 0);
bool loadTheme = (_wcsnicmp(lpCmdLine, L"/LoadTheme ", 11) == 0);
if (wcscmp(lpCmdLine, L"/BACKUP") != 0 && !loadTheme)
{
// Temporary solution until Rainstaller rewrite
@ -169,8 +169,8 @@ void LoadTheme(const WCHAR* name)
theme += name;
std::wstring wallpaper = theme + L"\\RainThemes.bmp";
theme += L"\\Rainmeter.thm";
CopyFiles(theme, g_Data.iniFile);
if (CopyFiles(theme, g_Data.iniFile))
{
PreserveSetting(backup, L"SkinPath");
PreserveSetting(backup, L"ConfigEditor");
PreserveSetting(backup, L"LogViewer");
@ -189,6 +189,7 @@ void LoadTheme(const WCHAR* name)
{
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)wallpaper.c_str(), SPIF_UPDATEINIFILE);
}
}
}
void PreserveSetting(const std::wstring& from, LPCTSTR key, bool replace)