Skip to content

Commit 1a5608a

Browse files
tweaks for ZIP
1 parent 23d9d15 commit 1a5608a

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

QMLComponents/utilities/dynamicruntimeinfo.cpp

+19-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ DynamicRuntimeInfo::DynamicRuntimeInfo()
4343
#elif linux
4444
_environment = RuntimeEnvironment::LINUX_LOCAL;
4545
#elif _WIN32
46-
parseStaticRuntimeInfoFile(fq(AppDirs::programDir().absoluteFilePath(tq(staticInfoFileName)))); //will set runtime env info
47-
parseDynamicRuntimeInfoFile(fq(AppDirs::appData(false) + "/" + tq(dynamicInfoFileName)));
46+
parseStaticRuntimeInfoFile(staticRuntimeInfoFilePath()); //will set runtime env info
47+
parseDynamicRuntimeInfoFile(dynamicRuntimeInfoFilePath());
4848
#else
4949
_environment = RuntimeEnvironment::UNKNOWN;
5050
#endif
@@ -108,6 +108,23 @@ bool DynamicRuntimeInfo::parseDynamicRuntimeInfoFile(const std::string &path)
108108

109109
}
110110

111+
std::string DynamicRuntimeInfo::staticRuntimeInfoFilePath()
112+
{
113+
return fq(AppDirs::programDir().absoluteFilePath(tq(staticInfoFileName)));
114+
}
115+
116+
std::string DynamicRuntimeInfo::dynamicRuntimeInfoFilePath()
117+
{
118+
switch (getRuntimeEnvironment()) {
119+
case ZIP:
120+
return fq(AppDirs::programDir().absoluteFilePath(tq(dynamicInfoFileName)));
121+
case MSIX:
122+
return fq(AppDirs::appData(false) + "/" + tq(dynamicInfoFileName));
123+
default:
124+
return "";
125+
}
126+
}
127+
111128
bool DynamicRuntimeInfo::writeDynamicRuntimeInfoFile()
112129
{
113130
std::string path = fq(AppDirs::appData(false) + "/" + tq(dynamicInfoFileName));

QMLComponents/utilities/dynamicruntimeinfo.h

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ class DynamicRuntimeInfo
5757
bool parseDynamicRuntimeInfoFile(const std::string& path);
5858

5959
private:
60+
std::string staticRuntimeInfoFilePath();
61+
std::string dynamicRuntimeInfoFilePath();
62+
6063
RuntimeEnvironment _environment;
6164
MicroArch _arch;
6265

0 commit comments

Comments
 (0)