diff --git a/IDE/src/BuildContext.bf b/IDE/src/BuildContext.bf index 31f7a5a0..ee7788cd 100644 --- a/IDE/src/BuildContext.bf +++ b/IDE/src/BuildContext.bf @@ -695,23 +695,32 @@ namespace IDE return false; } - String compilerExePath = scope String(); + // Set for auto-install without prompting + gApp.mSettings.mEmscriptenPendingInstall = false; + + String wasmPath = Path.GetAbsolutePath("../wasm", gApp.mInstallDir, .. scope .()); + if (!Directory.Exists(wasmPath)) + Path.GetAbsolutePath("../../wasm", gApp.mInstallDir, wasmPath..Clear()); + IDEUtils.FixFilePath(wasmPath); + if (gApp.mSettings.mEmscriptenPath.IsEmpty) { - // Set for auto-install without prompting gApp.mSettings.mEmscriptenPendingInstall = true; + } + else if (!File.Exists(scope $"{wasmPath}/EmsdkDep1_Done.txt")) + { + gApp.mSettings.mEmscriptenPendingInstall = true; + } + String compilerExePath = scope String(); + if (gApp.mSettings.mEmscriptenPendingInstall) + { #if CLI gApp.Fail("Emscripten path not configured. Check Wasm configuration in File\\Preferences\\Settings."); return false; #else if (gApp.mSettings.mEmscriptenPendingInstall) { - String wasmPath = Path.GetAbsolutePath("../wasm", gApp.mInstallDir, .. scope .()); - if (!Directory.Exists(wasmPath)) - Path.GetAbsolutePath("../../wasm", gApp.mInstallDir, wasmPath..Clear()); - IDEUtils.FixFilePath(wasmPath); - var runCmd = gApp.QueueRun(scope $"{wasmPath}/fetch_wasm.bat", "", wasmPath, .UTF8); runCmd.mOnlyIfNotFailed = true; diff --git a/bin/WasmLaunch.exe b/bin/WasmLaunch.exe index 8d2cc00b..13d5220a 100644 Binary files a/bin/WasmLaunch.exe and b/bin/WasmLaunch.exe differ diff --git a/wasm/fetch_wasm.bat b/wasm/fetch_wasm.bat index 457c5fe3..0ce8cf14 100644 --- a/wasm/fetch_wasm.bat +++ b/wasm/fetch_wasm.bat @@ -1,13 +1,13 @@ @ECHO OFF @ECHO Downloading Emscripten... -..\bin\curl.exe -O https://www.beeflang.org/EmsdkDep0.zip +..\bin\curl.exe -O https://www.beeflang.org/EmsdkDep1.zip @IF %ERRORLEVEL% NEQ 0 GOTO HADERROR @ECHO Extracting Emscripten... cd .. -bin\tar.exe -xf wasm\EmsdkDep0.zip +bin\tar.exe -xf wasm\EmsdkDep1.zip @IF %ERRORLEVEL% NEQ 0 GOTO HADERROR -del wasm\EmsdkDep0.zip +del wasm\EmsdkDep1.zip @IF %ERRORLEVEL% NEQ 0 GOTO HADERROR :SUCCESS