mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 22:41:18 +12:00
Add support for non portable mode (#356)
This commit is contained in:
parent
2b9edced81
commit
d6ba61cf64
38 changed files with 233 additions and 163 deletions
|
@ -65,7 +65,7 @@ bool DownloadGraphicPacksWindow::curlDownloadFile(const char *url, curlDownloadF
|
|||
bool checkGraphicPackDownloadedVersion(const char* nameVersion, bool& hasVersionFile)
|
||||
{
|
||||
hasVersionFile = false;
|
||||
const auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
const auto path = ActiveSettings::GetUserDataPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
std::unique_ptr<FileStream> file(FileStream::openFile2(path));
|
||||
|
||||
std::string versionInFile;
|
||||
|
@ -78,7 +78,7 @@ bool checkGraphicPackDownloadedVersion(const char* nameVersion, bool& hasVersion
|
|||
|
||||
void createGraphicPackDownloadedVersionFile(const char* nameVersion)
|
||||
{
|
||||
const auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
const auto path = ActiveSettings::GetUserDataPath("graphicPacks/downloadedGraphicPacks/version.txt");
|
||||
std::unique_ptr<FileStream> file(FileStream::createFile2(path));
|
||||
if (file)
|
||||
file->writeString(nameVersion);
|
||||
|
@ -90,7 +90,7 @@ void createGraphicPackDownloadedVersionFile(const char* nameVersion)
|
|||
|
||||
void deleteDownloadedGraphicPacks()
|
||||
{
|
||||
const auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks");
|
||||
const auto path = ActiveSettings::GetUserDataPath("graphicPacks/downloadedGraphicPacks");
|
||||
std::error_code er;
|
||||
if (!fs::exists(path, er))
|
||||
return;
|
||||
|
@ -238,7 +238,7 @@ void DownloadGraphicPacksWindow::UpdateThread()
|
|||
return;
|
||||
}
|
||||
|
||||
auto path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks");
|
||||
auto path = ActiveSettings::GetUserDataPath("graphicPacks/downloadedGraphicPacks");
|
||||
std::error_code er;
|
||||
//fs::remove_all(path, er); -> Don't delete the whole folder and recreate it immediately afterwards because sometimes it just fails
|
||||
deleteDownloadedGraphicPacks();
|
||||
|
@ -258,7 +258,7 @@ void DownloadGraphicPacksWindow::UpdateThread()
|
|||
std::strstr(sb.name, "..\\") != nullptr)
|
||||
continue; // bad path
|
||||
|
||||
path = ActiveSettings::GetPath("graphicPacks/downloadedGraphicPacks/{}", sb.name);
|
||||
path = ActiveSettings::GetUserDataPath("graphicPacks/downloadedGraphicPacks/{}", sb.name);
|
||||
|
||||
size_t sbNameLen = strlen(sb.name);
|
||||
if(sbNameLen == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue