parent
b368b9c6d1
commit
92f0aa9593
@ -64,16 +64,6 @@ namespace hex::init {
|
|||||||
|
|
||||||
using enum fs::ImHexPath;
|
using enum fs::ImHexPath;
|
||||||
|
|
||||||
// Check if ImHex is installed in portable mode
|
|
||||||
{
|
|
||||||
if (const auto executablePath = fs::getExecutablePath(); executablePath.has_value()) {
|
|
||||||
const auto flagFile = executablePath->parent_path() / "PORTABLE";
|
|
||||||
|
|
||||||
if (fs::exists(flagFile) && fs::isRegularFile(flagFile))
|
|
||||||
ImHexApi::System::impl::setPortableVersion(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create all folders
|
// Create all folders
|
||||||
for (u32 path = 0; path < u32(fs::ImHexPath::END); path++) {
|
for (u32 path = 0; path < u32(fs::ImHexPath::END); path++) {
|
||||||
for (auto &folder : fs::getDefaultPaths(static_cast<fs::ImHexPath>(path), true)) {
|
for (auto &folder : fs::getDefaultPaths(static_cast<fs::ImHexPath>(path), true)) {
|
||||||
|
@ -16,6 +16,16 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
bool shouldRestart = false;
|
bool shouldRestart = false;
|
||||||
|
|
||||||
|
// Check if ImHex is installed in portable mode
|
||||||
|
{
|
||||||
|
if (const auto executablePath = fs::getExecutablePath(); executablePath.has_value()) {
|
||||||
|
const auto flagFile = executablePath->parent_path() / "PORTABLE";
|
||||||
|
|
||||||
|
if (fs::exists(flagFile) && fs::isRegularFile(flagFile))
|
||||||
|
ImHexApi::System::impl::setPortableVersion(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
EventManager::subscribe<RequestRestartImHex>([&]{ shouldRestart = true; });
|
EventManager::subscribe<RequestRestartImHex>([&]{ shouldRestart = true; });
|
||||||
shouldRestart = false;
|
shouldRestart = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user