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:
		| @@ -290,7 +290,7 @@ | |||||||
| 			/> | 			/> | ||||||
| 			<Tool | 			<Tool | ||||||
| 				Name="VCPostBuildEventTool" | 				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> | ||||||
| 		<Configuration | 		<Configuration | ||||||
| @@ -476,7 +476,7 @@ | |||||||
| 			/> | 			/> | ||||||
| 			<Tool | 			<Tool | ||||||
| 				Name="VCPostBuildEventTool" | 				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> | ||||||
| 		<Configuration | 		<Configuration | ||||||
|   | |||||||
| @@ -750,24 +750,18 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath) | |||||||
| 				// Copy the default skin to the Skins folder | 				// Copy the default skin to the Skins folder | ||||||
| 				std::wstring strFrom(m_Path + L"Skins\\" + L"*.*"); | 				std::wstring strFrom(m_Path + L"Skins\\" + L"*.*"); | ||||||
| 				std::wstring strTo(m_SkinPath); | 				std::wstring strTo(m_SkinPath); | ||||||
|  | 				CopyFiles(strFrom, strTo); | ||||||
|  |  | ||||||
| 				// The strings must end with double nul | 				// This shouldn't be copied | ||||||
| 				strFrom.append(L"0"); | 				std::wstring strNote = strTo + L"Read me before copying skins to here.txt"; | ||||||
| 				strFrom[strFrom.size() - 1] = L'\0'; | 				DeleteFile(strNote.c_str()); | ||||||
| 				strTo.append(L"0"); |  | ||||||
| 				strTo[strTo.size() - 1] = L'\0'; |  | ||||||
|  |  | ||||||
| 				SHFILEOPSTRUCT fo = {0}; | 				// Copy also the themes to the %APPDATA% | ||||||
| 				fo.wFunc = FO_COPY; | 				strFrom = std::wstring(m_Path + L"Themes\\" + L"*.*"); | ||||||
| 				fo.pFrom = strFrom.c_str(); | 				strTo = std::wstring(GetSettingsPath() + L"Themes"); | ||||||
| 				fo.pTo = strTo.c_str(); | 				CreateDirectory(strTo.c_str(), NULL); | ||||||
| 				fo.fFlags = FOF_NO_UI; | 				strTo += L"\\"; | ||||||
|  | 				CopyFiles(strFrom, strTo); | ||||||
| 				int result = SHFileOperation(&fo); |  | ||||||
| 				if (result != 0) |  | ||||||
| 				{ |  | ||||||
| 					DebugLog(L"Unable to copy the default skin %i", result); |  | ||||||
| 				} |  | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 		else | 		else | ||||||
| @@ -900,6 +894,34 @@ int CRainmeter::Initialize(HWND Parent, HINSTANCE Instance, LPCSTR szPath) | |||||||
| 	return Result;	// Alles OK | 	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 | ** CreateDefaultConfigFile | ||||||
| ** | ** | ||||||
|   | |||||||
| @@ -175,6 +175,7 @@ private: | |||||||
| 	HMENU CreateConfigMenu(std::vector<CONFIGMENU>& configMenuData); | 	HMENU CreateConfigMenu(std::vector<CONFIGMENU>& configMenuData); | ||||||
| 	void CreateDefaultConfigFile(std::wstring strFile); | 	void CreateDefaultConfigFile(std::wstring strFile); | ||||||
| 	void TestSettingsFile(bool bDefaultIniLocation); | 	void TestSettingsFile(bool bDefaultIniLocation); | ||||||
|  | 	void CopyFiles(std::wstring strFrom, std::wstring strTo); | ||||||
|  |  | ||||||
| 	CTrayWindow* m_TrayWindow; | 	CTrayWindow* m_TrayWindow; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kimmo Pekkola
					Kimmo Pekkola