From 473ccf0249d8b8f3aedad723a4c3fa8878163da3 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Mon, 5 Oct 2015 20:08:05 -0400 Subject: [PATCH 1/3] Remove VirtualBox install & requirement Signed-off-by: Jeffrey Morgan --- package.json | 5 ----- src/stores/SetupStore.js | 48 +++++----------------------------------- 2 files changed, 5 insertions(+), 48 deletions(-) diff --git a/package.json b/package.json index 71a485fbc4..120f2b563a 100644 --- a/package.json +++ b/package.json @@ -25,11 +25,6 @@ "docker-version": "1.8.2", "docker-machine-version": "0.4.1", "electron-version": "0.27.2", - "virtualbox-version": "5.0.4", - "virtualbox-filename": "VirtualBox-5.0.4.pkg", - "virtualbox-filename-win": "VirtualBox-5.0.4.exe", - "virtualbox-checksum": "4597b2ebdf7a334a3a4028e2285f62cf4cf157477e33fa5f433d944da54737d6", - "virtualbox-checksum-win": "17fe9943eae33d1d23d37160fd862b7c5db0eef8cb48225cf143244d0e934f94", "dependencies": { "alt": "^0.16.2", "ansi-to-html": "0.3.0", diff --git a/src/stores/SetupStore.js b/src/stores/SetupStore.js index 9d8418bbe9..efb2e48b73 100644 --- a/src/stores/SetupStore.js +++ b/src/stores/SetupStore.js @@ -19,41 +19,6 @@ var _retryPromise = null; var _requiredSteps = []; var _steps = [{ - name: 'download', - title: 'Downloading VirtualBox', - message: 'VirtualBox is being downloaded. Kitematic requires VirtualBox to run containers.', - totalPercent: 35, - percent: 0, - run: function (progressCallback) { - return setupUtil.download(virtualBox.url(), path.join(util.supportDir(), virtualBox.filename()), virtualBox.checksum(), percent => { - progressCallback(percent); - }); - } -}, { - name: 'install', - title: 'Installing VirtualBox & Docker', - message: 'VirtualBox & Docker are being installed or upgraded in the background. We may need you to type in your password to continue.', - totalPercent: 5, - percent: 0, - seconds: 5, - run: Promise.coroutine(function* (progressCallback) { - if (!virtualBox.installed()) { - yield virtualBox.killall(); - progressCallback(50); // TODO: detect when the installation has started so we can simulate progress - try { - if (util.isWindows()) { - yield util.exec([path.join(util.supportDir(), virtualBox.filename()), '-msiparams', 'REBOOT=ReallySuppress', 'LIMITUI=INSTALLUILEVEL_PROGRESSONLY']); - } else { - yield util.exec(setupUtil.macSudoCmd(setupUtil.installVirtualBoxCmd())); - } - } catch (err) { - throw null; - } - } else if (!util.isWindows() && !virtualBox.active()) { - yield util.exec(setupUtil.macSudoCmd(util.escapePath('/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh') + ' restart')); - } - }) -}, { name: 'init', title: 'Starting Docker VM', message: 'To run Docker containers on your computer, Kitematic is starting a Linux virtual machine. This may take a minute...', @@ -146,12 +111,8 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { var packagejson = util.packagejson(); var isoversion = machine.isoversion(); var required = {}; - var vboxfile = path.join(util.supportDir(), virtualBox.filename()); - var vboxNeedsInstall = !virtualBox.installed(); - required.download = vboxNeedsInstall && (!fs.existsSync(vboxfile) || setupUtil.checksum(vboxfile) !== virtualBox.checksum()); - required.install = vboxNeedsInstall || (!util.isWindows() && !virtualBox.active()); - required.init = required.install || !(yield machine.exists()) || (yield machine.state()) !== 'Running' || !isoversion || util.compareVersions(isoversion, packagejson['docker-version']) < 0; + required.init = !(yield machine.exists()) || (yield machine.state()) !== 'Running' || !isoversion || util.compareVersions(isoversion, packagejson['docker-version']) < 0; var exists = yield machine.exists(); if (isoversion && util.compareVersions(isoversion, packagejson['docker-version']) < 0) { @@ -168,9 +129,7 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { return Promise.resolve(_requiredSteps); }), run: Promise.coroutine(function* () { - metrics.track('Started Setup', { - virtualbox: virtualBox.installed() ? yield virtualBox.version() : 'Not Installed' - }); + metrics.track('Started Setup'); var steps = yield this.requiredSteps(); for (let step of steps) { _currentStep = step; @@ -207,6 +166,9 @@ var SetupStore = assign(Object.create(EventEmitter.prototype), { setup: Promise.coroutine(function * () { while (true) { try { + if (!virtualBox.installed()) { + throw {message: 'VirtualBox is not installed, please install it and try again. VirtualBox is included in the Docker Toolbox.'} + } var ip = yield this.run(); if (!ip || !ip.length) { throw { From d9d24854087064bfdd9a5ee260896b63938434ac Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Mon, 5 Oct 2015 20:10:52 -0400 Subject: [PATCH 2/3] Bump to 0.8.6 Signed-off-by: Jeffrey Morgan --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 120f2b563a..cd61e19bdc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Kitematic", - "version": "0.8.5", + "version": "0.8.6", "author": "Kitematic", "description": "Simple Docker Container management for Mac OS X.", "homepage": "https://kitematic.com/", From d3a962226292b2545876b31e3c14ca7c8512998d Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Tue, 6 Oct 2015 07:22:23 -0700 Subject: [PATCH 3/3] Better VirtualBox detection on Windows Signed-off-by: Jeffrey Morgan --- Gruntfile.js | 2 +- src/utils/VirtualBoxUtil.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 9b02a0811b..b8d621e1ae 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -313,7 +313,7 @@ module.exports = function (grunt) { grunt.registerTask('default', ['download-binary', 'newer:babel', 'less', 'newer:copy:dev', 'shell:electron', 'watchChokidar']); if (process.platform === 'win32') { - grunt.registerTask('release', ['clean:release', 'download-binary', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'rcedit:exes', 'compress', 'create-windows-installer', 'rename:installer']); + grunt.registerTask('release', ['clean:release', 'download-binary', 'babel', 'less', 'copy:dev', 'electron:windows', 'copy:windows', 'rcedit:exes', 'compress']); } else { grunt.registerTask('release', ['clean:release', 'download-binary', 'babel', 'less', 'copy:dev', 'electron:osx', 'copy:osx', 'shell:sign', 'shell:zip']); } diff --git a/src/utils/VirtualBoxUtil.js b/src/utils/VirtualBoxUtil.js index 338717676a..b93403736d 100644 --- a/src/utils/VirtualBoxUtil.js +++ b/src/utils/VirtualBoxUtil.js @@ -1,11 +1,16 @@ import fs from 'fs'; +import path from 'path'; import util from './Util'; import Promise from 'bluebird'; var VirtualBox = { command: function () { if(util.isWindows()) { - return 'C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe'; + if (process.env.VBOX_MSI_INSTALL_PATH) { + return path.join(process.env.VBOX_MSI_INSTALL_PATH, 'VBoxManage.exe'); + } else { + return path.join(process.env.VBOX_INSTALL_PATH, 'VBoxManage.exe'); + } } else { return '/Applications/VirtualBox.app/Contents/MacOS/VBoxManage'; } @@ -21,7 +26,8 @@ var VirtualBox = { }, installed: function () { if(util.isWindows()) { - return fs.existsSync('C:\\Program Files\\Oracle\\VirtualBox\\VBoxManage.exe') && fs.existsSync('C:\\Program Files\\Oracle\\VirtualBox\\VirtualBox.exe'); + return (process.env.VBOX_MSI_INSTALL_PATH && fs.existsSync(path.join(process.env.VBOX_MSI_INSTALL_PATH, 'VBoxManage.exe'))) || + (process.env.VBOX_INSTALL_PATH && fs.existsSync(path.join(process.env.VBOX_INSTALL_PATH, 'VBoxManage.exe'))); } else { return fs.existsSync('/Applications/VirtualBox.app') && fs.existsSync('/Applications/VirtualBox.app/Contents/MacOS/VBoxManage'); }