mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
The themes are now copied to the %APPDATA% on first run.
Few changes to the Enigma skin to make it work better in different resolutions.
This commit is contained in:
parent
b6954bcdd0
commit
3c0923f862
@ -290,7 +290,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="if not exist ..\testbench\x32\debug\skins (mkdir ..\testbench\x32\debug\skins)
echo "Copying the skins..."
xcopy /Q /S /Y ..\Install\Skins ..\testbench\x32\debug\skins
"
|
||||
CommandLine="if not exist ..\testbench\x32\debug\skins (mkdir ..\testbench\x32\debug\skins)
if not exist ..\testbench\x32\debug\themes (mkdir ..\testbench\x32\debug\themes)
echo "Copying the skins..."
xcopy /Q /S /Y ..\Install\Skins ..\testbench\x32\debug\skins
xcopy /Q /S /Y ..\Install\Themes ..\testbench\x32\debug\themes
xcopy /Q /S /Y ..\Install\Default.ini ..\testbench\x32\debug\"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
@ -476,7 +476,7 @@
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="if not exist ..\testbench\x32\release\skins (mkdir ..\testbench\x32\release\skins)
echo "Copying the skins..."
xcopy /Q /S /Y ..\Install\Skins ..\testbench\x32\release\skins
"
|
||||
CommandLine="if not exist ..\testbench\x32\release\skins (mkdir ..\testbench\x32\release\skins)
if not exist ..\testbench\x32\release\themes (mkdir ..\testbench\x32\release\themes)
echo "Copying the skins..."
xcopy /Q /S /Y ..\Install\Skins ..\testbench\x32\release\skins
xcopy /Q /S /Y ..\Install\Themes ..\testbench\x32\release\themes
xcopy /Q /S /Y ..\Install\Default.ini ..\testbench\x32release\"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
|
@ -750,24 +750,18 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
|
||||
// Copy the default skin to the Skins folder
|
||||
std::wstring strFrom(m_Path + L"Skins\\" + L"*.*");
|
||||
std::wstring strTo(m_SkinPath);
|
||||
CopyFiles(strFrom, strTo);
|
||||
|
||||
// The strings must end with double nul
|
||||
strFrom.append(L"0");
|
||||
strFrom[strFrom.size() - 1] = L'\0';
|
||||
strTo.append(L"0");
|
||||
strTo[strTo.size() - 1] = L'\0';
|
||||
// This shouldn't be copied
|
||||
std::wstring strNote = strTo + L"Read me before copying skins to here.txt";
|
||||
DeleteFile(strNote.c_str());
|
||||
|
||||
SHFILEOPSTRUCT fo = {0};
|
||||
fo.wFunc = FO_COPY;
|
||||
fo.pFrom = strFrom.c_str();
|
||||
fo.pTo = strTo.c_str();
|
||||
fo.fFlags = FOF_NO_UI;
|
||||
|
||||
int result = SHFileOperation(&fo);
|
||||
if (result != 0)
|
||||
{
|
||||
DebugLog(L"Unable to copy the default skin %i", result);
|
||||
}
|
||||
// Copy also the themes to the %APPDATA%
|
||||
strFrom = std::wstring(m_Path + L"Themes\\" + L"*.*");
|
||||
strTo = std::wstring(GetSettingsPath() + L"Themes");
|
||||
CreateDirectory(strTo.c_str(), NULL);
|
||||
strTo += L"\\";
|
||||
CopyFiles(strFrom, strTo);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -900,6 +894,34 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath)
|
||||
return Result; // Alles OK
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** CopyFiles
|
||||
**
|
||||
** Copies files and folders from one location to another.
|
||||
**
|
||||
*/
|
||||
void CRainmeter::CopyFiles(std::wstring strFrom, std::wstring strTo)
|
||||
{
|
||||
// The strings must end with double nul
|
||||
strFrom.append(L"0");
|
||||
strFrom[strFrom.size() - 1] = L'\0';
|
||||
strTo.append(L"0");
|
||||
strTo[strTo.size() - 1] = L'\0';
|
||||
|
||||
SHFILEOPSTRUCT fo = {0};
|
||||
fo.wFunc = FO_COPY;
|
||||
fo.pFrom = strFrom.c_str();
|
||||
fo.pTo = strTo.c_str();
|
||||
fo.fFlags = FOF_NO_UI;
|
||||
|
||||
int result = SHFileOperation(&fo);
|
||||
if (result != 0)
|
||||
{
|
||||
DebugLog(L"Unable to copy files from %s to %s (%i)", strFrom.c_str(), strTo.c_str(), result);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** CreateDefaultConfigFile
|
||||
**
|
||||
|
@ -175,6 +175,7 @@ private:
|
||||
HMENU CreateConfigMenu(std::vector<CONFIGMENU>& configMenuData);
|
||||
void CreateDefaultConfigFile(std::wstring strFile);
|
||||
void TestSettingsFile(bool bDefaultIniLocation);
|
||||
void CopyFiles(std::wstring strFrom, std::wstring strTo);
|
||||
|
||||
CTrayWindow* m_TrayWindow;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user