Browse Source

Fixed: Crash caused by a problem loading the application icon.

Fixed: Updater may name the downloaded file incorrectly.
Fixed: Installer updater downloads the portable version.
tags/v1.5.2-early
Ivan Bravo Bravo 2 months ago
parent
commit
00980117f0

+ 1
- 1
src/.env-cmdrc.js View File

@@ -12,7 +12,7 @@ module.exports = {
"NODE_ENV": "development",
"ROLLBAR_ACCESS_TOKEN": "e62c909ec771492fa7f371dc61eea092",
"LOGROCKET_ACCESS_TOKEN": "5iqym0/dreamtime-development",
"DREAMTRACK_HOST": "localhost:3333",
//"DREAMTRACK_HOST": "localhost:3333",
...development
},
"production": {

+ 1
- 1
src/components/UI/ProjectUpdate.vue View File

@@ -7,7 +7,7 @@
</figure>

<h1 class="title">
{{ data.name }} <span v-tooltip="'New version'">{{ updater.latest.tag_name }}</span>
{{ data.name }} <span v-tooltip="'New version'">{{ updater.latestCompatible.tag_name }}</span>
</h1>

<h2 v-if="!updater.update.active" class="subtitle">

+ 3
- 3
src/electron-builder.js View File

@@ -8,7 +8,7 @@ const pkg = require('./package.json')
const windows = {
win: {
target: process.env.BUILD_PORTABLE ? 'zip' : 'nsis',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-windows-portable.${ext}' : '${productName}-v${version}-windows.${ext}',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-windows-portable.${ext}' : '${productName}-v${version}-windows-installer.${ext}',
extraResources: [
{
from: 'node_modules/regedit/vbs',
@@ -37,7 +37,7 @@ const windows = {
const linux = {
linux: {
target: process.env.BUILD_PORTABLE ? 'zip' : 'snap',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-ubuntu-portable.${ext}' : '${productName}-v${version}-ubuntu.${ext}',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-ubuntu-portable.${ext}' : '${productName}-v${version}-ubuntu-installer.${ext}',
executableName: process.env.npm_package_name,
synopsis: pkg.description,
category: 'Graphics',
@@ -56,7 +56,7 @@ const linux = {
const macos = {
mac: {
target: process.env.BUILD_PORTABLE ? 'zip' : 'dmg',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-macos-portable.${ext}' : '${productName}-v${version}-macos.${ext}',
artifactName: process.env.BUILD_PORTABLE ? '${productName}-v${version}-macos-portable.${ext}' : '${productName}-v${version}-macos-installer.${ext}',
darkModeSupport: true,
category: 'public.app-category.graphics-design',
minimumSystemVersion: '10.15.0',

+ 8
- 3
src/electron/src/index.js View File

@@ -9,7 +9,7 @@

import { startsWith } from 'lodash'
import {
app, BrowserWindow, shell, protocol,
app, BrowserWindow, shell, protocol, nativeImage,
} from 'electron'
import { dirname, resolve } from 'path'
import Logger from '@dreamnet/logplease'
@@ -236,7 +236,12 @@ class DreamApp {
static createWindow() {
logger.info('Creating window...')

const iconPath = resolve(config.rootDir, 'dist', 'icon.ico')
let icon
const iconPath = resolve(config.rootDir, 'dist', 'icon.png')

if (fs.existsSync(iconPath)) {
icon = nativeImage.createFromPath(iconPath)
}

// browser window.
this.window = new BrowserWindow({
@@ -247,7 +252,7 @@ class DreamApp {
frame: false,
show: false,
backgroundColor: '#060709',
icon: fs.existsSync(iconPath) ? iconPath : undefined,
icon,

webPreferences: {
nodeIntegration: true,

+ 0
- 71
src/electron/src/modules/tools/fs.js View File

@@ -206,77 +206,6 @@ export function download(url, options = {}) {
bus.emit('error', null, err)
})

/*
axios.request({
url,
responseType: 'stream',
maxContentLength: -1,
}).then((response) => {
const contentLength = response.data.headers['content-length'] || -1
const totalSize = filesize(contentLength, { exponent: 2, output: 'object' }).value
const output = createWriteStream(filepath)

stream = response.data

stream.on('data', (chunk) => {
output.write(Buffer.from(chunk))

const written = filesize(writeStream.bytesWritten, { exponent: 2, output: 'object' }).value

if (contentLength > 0) {
const progress = output.bytesWritten / contentLength

bus.emit('progress', null, {
progress,
written,
total: totalSize,
})
} else {
bus.emit('progress', null, {
progress: -1,
written,
total: -1,
})
}
})

stream.on('end', () => {
output.end()

if (!existsSync(filepath)) {
throw new AppError('The file was not saved correctly.', { title: 'Download failed.' })
}

bus.emit('end', null, filepath)
})

stream.on('error', (err) => {
throw new AppError(err, { title: 'Download failed.' })
})

output.on('error', (err) => {
throw new AppError(err, { title: 'Download failed.' })
})

bus.on('cancel', () => {
output.destroy()
stream.destroy()
deleteFile()

logger.info('Download canceled by user.')
bus.emit('end')
})

return true
}).catch((err) => {
stream.destroy(err)
deleteFile()

logger.warn('Download canceled due to an error.', err)
bus.emit('error', null, err)
})
*/

return bus
}


+ 6
- 6
src/modules/updater/base.js View File

@@ -231,7 +231,7 @@ export class BaseUpdater {
dialog.showMessageBoxSync({
type: 'error',
title: 'Connect to Internet.',
message: `There was a problem getting the latest version of the components needed to use DreamTime.
message: `There was a problem getting the latest version of the components needed to use DreamTime.
Please make sure you are connected to the Internet just for this time and try again.`,
})

@@ -265,7 +265,7 @@ export class BaseUpdater {
let asset

try {
urls = dreamtrack.get(['projects', this.name, 'releases', this.latestVersion, 'urls'])
urls = dreamtrack.get(['projects', this.name, 'releases', this.latestCompatibleVersion, 'urls'])
} catch (err) {
// not the best way, but works
urls = []
@@ -279,10 +279,10 @@ export class BaseUpdater {
urls = []
}

if (this.latest.assets.length === 1) {
[asset] = this.latest.assets
if (this.latestCompatible.assets.length === 1) {
[asset] = this.latestCompatible.assets
} else {
asset = find(this.latest.assets, (item) => item.name.includes(this.platform))
asset = find(this.latestCompatible.assets, (item) => item.name.includes(this.platform))
}

if (!isNil(asset)) {
@@ -389,7 +389,7 @@ export class BaseUpdater {

await this.install(filepath)
} catch (err) {
throw new Exception('The installation failed.', 'There was a problem trying to install the downloaded file, please try again.', err)
throw new Warning('The installation failed.', 'There was a problem trying to install the downloaded file, please try again.', err)
}
}


+ 2
- 0
src/modules/updater/dreamtime.js View File

@@ -39,6 +39,8 @@ class DreamTimeUpdater extends BaseUpdater {

if (dream.isPortable) {
platform = `${platform}-portable`
} else {
platform = `${platform}-installer`
}

return platform

+ 1
- 1
src/package.json View File

@@ -3,7 +3,7 @@
"private": true,
"displayName": "DreamTime",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.5.0",
"version": "1.5.1",
"homepage": "https://time.dreamnet.tech",
"main": "electron/dist/index.js",
"license": "GPL-3.0-only",

+ 2
- 2
src/package.min.json View File

@@ -3,7 +3,7 @@
"private": true,
"displayName": "DreamTime",
"description": "Application that uses artificial intelligence to generate fake nudes.",
"version": "1.5.0",
"version": "1.5.1",
"main": "electron/dist/index.js",
"license": "GPL-3.0-only"
}
}

+ 4
- 2
src/scripts/deploy.js View File

@@ -30,6 +30,8 @@ if (process.env.GITHUB_REF) {
//
process.env.DEPLOY_GIT_REPO = 'dreamtime'

const isEarly = process.env.DEPLOY_GIT_TAG.includes('-early') || process.env.DEPLOY_GIT_TAG.includes('-rc')

//
const VERSION = `v${pkg.version}`
const FILENAME = `DreamTime-${VERSION}-${process.env.BUILD_PLATFORM}`
@@ -74,7 +76,7 @@ async function run(release) {

const response = await release.run()

if (process.env.DEPLOY_GIT_TAG.includes('early')) {
if (isEarly) {
output.push(release.cryptr.encrypt(JSON.stringify(response)))
} else {
output.push(response)
@@ -92,7 +94,7 @@ async function start() {
}

const portablePath = path.resolve(DISTPATH, `${FILENAME}-portable.zip`)
const installerPath = path.resolve(DISTPATH, `${FILENAME}.${process.env.BUILD_EXTENSION}`)
const installerPath = path.resolve(DISTPATH, `${FILENAME}-installer.${process.env.BUILD_EXTENSION}`)

const buildPath = fs.existsSync(portablePath) ? portablePath : installerPath


Loading…
Cancel
Save