Skip to content

Commit c726ea4

Browse files
committed
Implement APPIMAGELAUNCHER_DISABLE directly in binfmt-interpreter
Optimizes launch times a fair bit when using binfmt integration.
1 parent aa3dba9 commit c726ea4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/binfmt-bypass/interpreter_main.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,28 @@ int main(int argc, char** argv) {
2727
const std::string appImagePath = argv[1];
2828
std::vector<char*> args(&argv[2], &argv[argc]);
2929

30+
// optimistic approach
31+
bool useAppImageLauncher = true;
32+
3033
if (!executableExists(APPIMAGELAUNCHER_PATH)) {
3134
log_message(
3235
"AppImageLauncher not found at %s, launching AppImage directly: %s\n",
3336
APPIMAGELAUNCHER_PATH,
3437
appImagePath.c_str()
3538
);
39+
useAppImageLauncher = false;
40+
}
41+
42+
if (getenv("APPIMAGELAUNCHER_DISABLE") != nullptr) {
43+
log_message(
44+
"APPIMAGELAUNCHER_DISABLE set, launching AppImage directly: %s\n",
45+
APPIMAGELAUNCHER_PATH,
46+
appImagePath.c_str()
47+
);
48+
useAppImageLauncher = false;
49+
}
50+
51+
if (!useAppImageLauncher) {
3652
return bypassBinfmtAndRunAppImage(argv[1], args);
3753
}
3854

0 commit comments

Comments
 (0)