Compare commits
2 Commits
2068b7470b
...
324a4a1e6f
| Author | SHA1 | Date | |
|---|---|---|---|
| 324a4a1e6f | |||
| df1228ffa6 |
@ -9,6 +9,7 @@ import { launchMacInstaller } from './macappupdate.js'
|
|||||||
import { launchWindowsInstaller } from './winappupdate.js'
|
import { launchWindowsInstaller } from './winappupdate.js'
|
||||||
import { checkForDuplicateInstallations } from './check-duplicate-installations.js'
|
import { checkForDuplicateInstallations } from './check-duplicate-installations.js'
|
||||||
import { scheduleAppRestart } from './updater-runner.js'
|
import { scheduleAppRestart } from './updater-runner.js'
|
||||||
|
import buildInfo from '../buildInfo.json'
|
||||||
import { getAppSettings, setAppSettings } from './store.js'
|
import { getAppSettings, setAppSettings } from './store.js'
|
||||||
|
|
||||||
const SUPPORTED_TARGETS = {
|
const SUPPORTED_TARGETS = {
|
||||||
@ -215,8 +216,30 @@ const downloadArtifact = async (artifact, destinationPath, sendProgress) => {
|
|||||||
const getRunningEngine = (mainWindow) =>
|
const getRunningEngine = (mainWindow) =>
|
||||||
mainWindow?.renderer === 'cef' ? 'chromium' : 'native'
|
mainWindow?.renderer === 'cef' ? 'chromium' : 'native'
|
||||||
|
|
||||||
|
const formatFullAppVersion = (version, buildNumber) => {
|
||||||
|
const normalizedVersion = String(version || '')
|
||||||
|
.trim()
|
||||||
|
.replace(/^v/i, '')
|
||||||
|
|
||||||
|
if (!normalizedVersion) return null
|
||||||
|
|
||||||
|
const build = String(
|
||||||
|
buildNumber || process.env.BUILD_NUMBER || process.env.VITE_BUILD_NUMBER || ''
|
||||||
|
).trim()
|
||||||
|
const buildSuffix =
|
||||||
|
!build || build === 'dev' ? 'dev' : build.startsWith('b') ? build : `b${build}`
|
||||||
|
|
||||||
|
return `v${normalizedVersion}-${buildSuffix}`
|
||||||
|
}
|
||||||
|
|
||||||
|
const getRunningAppVersion = () =>
|
||||||
|
formatFullAppVersion(
|
||||||
|
process.env.ELECTROBUN_VERSION,
|
||||||
|
buildInfo?.buildNumber
|
||||||
|
)
|
||||||
|
|
||||||
const getRunningAppState = (mainWindow, settings) => ({
|
const getRunningAppState = (mainWindow, settings) => ({
|
||||||
version: process.env.ELECTROBUN_VERSION || null,
|
version: getRunningAppVersion(),
|
||||||
branch: settings?.appUpdateRunningBranch || null,
|
branch: settings?.appUpdateRunningBranch || null,
|
||||||
engine: getRunningEngine(mainWindow)
|
engine: getRunningEngine(mainWindow)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -45,7 +45,10 @@ const parseWindowsInstallerProgress = (output) => {
|
|||||||
const copyFile = line.match(/^installer:COPY_FILE:(\d+):(.*)$/)
|
const copyFile = line.match(/^installer:COPY_FILE:(\d+):(.*)$/)
|
||||||
if (copyFile) {
|
if (copyFile) {
|
||||||
const fileBytes = Number.parseInt(copyFile[1], 10)
|
const fileBytes = Number.parseInt(copyFile[1], 10)
|
||||||
const relativePath = copyFile[2].trim()
|
var fileName = copyFile[2].trim()
|
||||||
|
if (fileName.includes('\\')) {
|
||||||
|
fileName = fileName.split('\\').pop()
|
||||||
|
}
|
||||||
|
|
||||||
if (Number.isFinite(fileBytes)) {
|
if (Number.isFinite(fileBytes)) {
|
||||||
copiedBytes += fileBytes
|
copiedBytes += fileBytes
|
||||||
@ -57,8 +60,8 @@ const parseWindowsInstallerProgress = (output) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (relativePath) {
|
if (fileName) {
|
||||||
message = `Copying ${relativePath} (${formatBytes(fileBytes)})`
|
message = `Copying ${fileName} (${formatBytes(fileBytes)})`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (
|
} else if (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user