Reset installer when the original manager launched
This commit is contained in:
parent
72d320d819
commit
71dbc9450e
|
|
@ -292,7 +292,7 @@ namespace edxp {
|
||||||
fs::perms::others_exec);
|
fs::perms::others_exec);
|
||||||
path_chown(prefs_path, uid, 0);
|
path_chown(prefs_path, uid, 0);
|
||||||
}
|
}
|
||||||
if (pkg_name == installer_pkg_name_) {
|
if (pkg_name == installer_pkg_name_ || pkg_name == kPrimaryInstallerPkgName) {
|
||||||
auto conf_path = GetConfigPath();
|
auto conf_path = GetConfigPath();
|
||||||
if (!path_exists<true>(conf_path)) {
|
if (!path_exists<true>(conf_path)) {
|
||||||
fs::create_directories(conf_path);
|
fs::create_directories(conf_path);
|
||||||
|
|
@ -309,6 +309,17 @@ namespace edxp {
|
||||||
if (const auto &[r_uid, r_gid] = path_own(log_path); r_uid != uid) {
|
if (const auto &[r_uid, r_gid] = path_own(log_path); r_uid != uid) {
|
||||||
path_chown(log_path, uid, 0, true);
|
path_chown(log_path, uid, 0, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pkg_name == kPrimaryInstallerPkgName) {
|
||||||
|
try {
|
||||||
|
auto installer_pkg_name_path = GetConfigPath("installer");
|
||||||
|
if (path_exists<true>(installer_pkg_name_path)) {
|
||||||
|
fs::remove(installer_pkg_name_path);
|
||||||
|
}
|
||||||
|
} catch (const fs::filesystem_error &e) {
|
||||||
|
LOGE("%s", e.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (const fs::filesystem_error &e) {
|
} catch (const fs::filesystem_error &e) {
|
||||||
LOGE("%s", e.what());
|
LOGE("%s", e.what());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue