diff --git a/package.json b/package.json index f8a2387d6..9b83111e5 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "license": "AGPL-3.0", "main": "./dist/electron/main.js", "scripts": { - "build": "cross-env node .electron-vue/build.js && node ./scripts/build/electron-build.js", + "build": "node .electron-vue/build.js && electron-builder", "build:dir": "node .electron-vue/build.js && electron-builder --dir", "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", @@ -20,7 +20,7 @@ "test": "npm run unit && npm run e2e", "unit": "karma start test/unit/karma.conf.js", "postinstall": "npm run lint:fix", - "publish": "./node_modules/.bin/electron-builder --publish always" + "publish": "electron-builder --publish always" }, "build": { "productName": "Internxt Drive", @@ -68,9 +68,9 @@ }, "nsis": { "allowElevation": true, - "deleteAppDataOnUninstall": true, + "deleteAppDataOnUninstall": false, "artifactName": "${productName}-${version}.${ext}", - "oneClick": false, + "oneClick": true, "perMachine": false }, "linux": { diff --git a/scripts/build/config/linux.json b/scripts/build/config/linux.json deleted file mode 100644 index 6a83076ef..000000000 --- a/scripts/build/config/linux.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "productName": "internxt-drive", - "appId": "com.internxt.drive", - "directories": { - "output": "build" - }, - "files": ["dist/electron/**/*", "src/resources/**/*"], - "publish": { - "provider": "github" - }, - "linux": { - "icon": "build/icons", - "category": "Network", - "target": ["deb", "AppImage"], - "executableName": "internxt-drive" - }, - "deb": { - "depends": ["libgconf-2-4"] - } -} diff --git a/scripts/build/config/mac.json b/scripts/build/config/mac.json deleted file mode 100644 index 5cc42081e..000000000 --- a/scripts/build/config/mac.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "productName": "Internxt Drive", - "appId": "com.internxt.drive", - "directories": { - "output": "build" - }, - "files": ["dist/electron/**/*", "src/resources/**/*"], - "publish": { - "provider": "github" - }, - "dmg": { - "sign": false, - "contents": [ - { - "x": 410, - "y": 150, - "type": "link", - "path": "/Applications" - }, - { - "x": 130, - "y": 150, - "type": "file" - } - ] - }, - "mac": { - "icon": "build/icons/icon.icns", - "hardenedRuntime": true, - "gatekeeperAssess": false, - "entitlements": "./resources/osx/Info.plist", - "entitlementsInherit": "./resources/osx/Info.plist", - "target": "dmg" - }, - "afterSign": "resources/osx/notarize.js" -} diff --git a/scripts/build/config/windows.json b/scripts/build/config/windows.json deleted file mode 100644 index cae12def5..000000000 --- a/scripts/build/config/windows.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "productName": "Internxt Drive", - "appId": "com.internxt.drive", - "directories": { - "output": "build" - }, - "files": ["dist/electron/**/*", "src/resources/**/*"], - "publish": { - "provider": "github" - }, - "win": { - "target": ["nsis"], - "certificateSubjectName": "Internxt Universal Technologies SL", - "icon": "build/icons/icon.ico" - }, - "nsis": { - "allowElevation": true, - "deleteAppDataOnUninstall": true, - "artifactName": "${productName}-${version}.${ext}", - "oneClick": false, - "perMachine": false - } -} diff --git a/scripts/build/electron-build.js b/scripts/build/electron-build.js deleted file mode 100755 index 7922d1fcc..000000000 --- a/scripts/build/electron-build.js +++ /dev/null @@ -1,51 +0,0 @@ -const builder = require('electron-builder') -const Platform = builder.Platform - -const programPlatforms = { - MAC: { name: 'mac', config: './config/mac.json', platform: Platform.MAC }, - WINDOWS: { name: 'win', config: './config/windows.json', platform: Platform.WINDOWS }, - LINUX: { name: 'linux', config: './config/linux.json', platform: Platform.LINUX } -} - -function getElectronPlatform(nodePlatform) { - let electronPlatform - if (!nodePlatform) { - return electronPlatform - } - - switch (nodePlatform) { - case 'darwin': - electronPlatform = programPlatforms.MAC - break - case 'linux': - electronPlatform = programPlatforms.LINUX - break - case 'win32': - electronPlatform = programPlatforms.WINDOWS - } - - return electronPlatform -} - -const currentPlatform = getElectronPlatform(process.platform) - -if (!currentPlatform) { - console.error('Your current platform is not supported for building this electron app') - process.exit() -} - -const buildConfig = require(currentPlatform.config) - -console.log(`Building electron app for ${currentPlatform.name} with config ${currentPlatform.config}`) - -// Promise is returned -builder.build({ - targets: currentPlatform.platform.createTarget(), - config: buildConfig -}) - .then(() => { - console.log(`Electron App for ${currentPlatform.name} with config ${currentPlatform.config} was succesfull build !!!`) - }) - .catch((error) => { - console.error(`Error building electron application: ${error}`) - })