diff --git a/app/assets/js/scripts/landing.js b/app/assets/js/scripts/landing.js index bea8c7b..d013798 100644 --- a/app/assets/js/scripts/landing.js +++ b/app/assets/js/scripts/landing.js @@ -376,8 +376,8 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) { let received = 0 await downloadFile(asset.url, asset.path, ({ transferred }) => { - received += transferred - setDownloadPercentage(transferred/asset.size) + received = transferred + setDownloadPercentage(Math.trunc((transferred/asset.size)*100)) }) setDownloadPercentage(100) @@ -395,10 +395,8 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) { // Show installing progress bar. remote.getCurrentWindow().setProgressBar(2) - const newJavaExec = await extractJdk(asset.path) - // Wait for extration to complete. - const eLStr = 'Extracting' + const eLStr = 'Extracting Java' let dotStr = '' setLaunchDetails(eLStr) const extractListener = setInterval(() => { @@ -410,6 +408,8 @@ async function downloadJava(effectiveJavaOptions, launchAfter = true) { setLaunchDetails(eLStr + dotStr) }, 750) + const newJavaExec = await extractJdk(asset.path) + // Extraction complete, remove the loading from the OS progress bar. remote.getCurrentWindow().setProgressBar(-1)