Skip to content

Commit

Permalink
installBinaries completed
Browse files Browse the repository at this point in the history
  • Loading branch information
DMDComposer committed Mar 17, 2022
1 parent 949a552 commit 89354a2
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 8 deletions.
3 changes: 1 addition & 2 deletions loadingWindow/installBinaries.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const { app } = require("electron")
const { resolve } = require("path")
const { platform } = require("os")
const { execSync } = require("child_process")
const Sudoer = require("electron-sudo").default
const request = require("request")
const { createWriteStream, rm, rmSync, existsSync } = require("fs")
const { createWriteStream, rmSync } = require("fs")

const sleep = (ms = 0) => new Promise((res) => setTimeout(res, ms))
const appData = resolve(app.getPath("userData"), "tmpDownload.zip")
Expand Down
3 changes: 2 additions & 1 deletion loadingWindow/loading.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
</head>
<body>
<body>
<h3>v1.0.1 Application Is Starting...</h3>
<div class="appVersion">
</div>
<!-- Spinner Loader -->
<div class="loader"></div>

Expand Down
4 changes: 4 additions & 0 deletions loadingWindow/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
position: fixed;
}

.appVersion {
color: #fff;
}

/* Safari */
@-webkit-keyframes spin {
0% {
Expand Down
4 changes: 4 additions & 0 deletions loadingWindow/updater.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
const progressBar = document.getElementById("download")
const label = document.getElementById("download-label")
const appVersion = document.querySelector(".appVersion")

const currVersion = await window.api.appVersion()
appVersion.innerHTML = `<h3>${currVersion} Application Is Starting...</h3>`

window.api.on("update/progressBar", (args) => {
// console.table({ args })
Expand Down
6 changes: 3 additions & 3 deletions macUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function GetUpdateURL(options) {
async function downloadDMG(window, url, path) {
let path = appData
console.log("downloading")
// updateHeader("Downloading FFmpeg & FFprobe") // update window header
window.webContents.send("update/statusTitle", "Downloading new update...")
let received_bytes = 0
let total_bytes = 0

Expand All @@ -61,9 +61,9 @@ async function downloadDMG(window, url, path) {
})

req.on("end", async () => {
await installDMG(window, path)
const results = await installDMG(window, path)
console.log("done downloading")
return true
resolve(results)
})
console.log("down here")
}
Expand Down
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ async function checkForBinaries() {
const ffprobePath = existsSync("/usr/local/bin/ffprobe")
return ffmpegPath && ffprobePath
}
const ffmpegPath = existsSync("C:/Program Files (x86)/FFmpeg/bin/ffmpeg1.exe")
const ffmpegPath = existsSync("C:/Program Files (x86)/FFmpeg/bin/ffmpeg.exe")
const ffprobePath = existsSync("C:/Program Files (x86)/FFmpeg/bin/ffprobe.exe")
return ffmpegPath && ffprobePath
}
Expand Down Expand Up @@ -379,6 +379,9 @@ ipcMain.on("app/quit", (_, error) => {
ipcMain.handle("get/appName", async (_) => {
return app.getName()
})
ipcMain.handle("get/appVersion", async (_) => {
return app.getVersion()
})

async function closeLoaderOpenMainWindow() {
mainWindow.show()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "MW_AudioSplitter",
"appId": "com.MW.AudioSplitter",
"version": "1.0.4",
"version": "1.0.5",
"description": "Audio Splitting using FFmpeg & FFprobe",
"main": "main.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const api = {
quit: () => ipcRenderer.send("app/quit"),
},
appName: () => ipcRenderer.invoke("get/appName"),
appVersion: () => ipcRenderer.invoke("get/appVersion"),
isFile: (path) => ipcRenderer.invoke("is-file", path),
isFolder: (path) => ipcRenderer.invoke("is-folder", path),
ffmpeg: (args) => ipcRenderer.invoke("ffmpeg", args),
Expand Down

0 comments on commit 89354a2

Please sign in to comment.