diff --git a/installer.nsh b/installer.nsh new file mode 100644 index 0000000..da1815b --- /dev/null +++ b/installer.nsh @@ -0,0 +1,8 @@ +!macro preInit + SetRegView 64 + WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LOCALAPPDATA\Microsoft\Mixer\CDK" + WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LOCALAPPDATA\Microsoft\Mixer\CDK" + SetRegView 32 + WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LOCALAPPDATA\Microsoft\Mixer\CDK" + WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LOCALAPPDATA\Microsoft\Mixer\CDK" +!macroend diff --git a/package.json b/package.json index 7bb63cb..4d65e17 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mixer/cdk", - "version": "0.2.7", + "version": "0.4.0", "description": "Command line tool for developing with Mixer Interactive", "main": "./dist/src/electron.js", "bin": { @@ -17,6 +17,8 @@ "fmt:ts": "prettier --write \"{src,test,types}/**/*.{scss,js,ts}\"", "build:cli": "rimraf dist && tsc", "build:editor:pack": "npm run -s build:editor:base && electron-builder --dir", + "build:editor:dist:win": "npm run -s build:editor:base && electron-builder --win --x64", + "build:editor:dist:mac": "npm run -s build:editor:base && electron-builder --mac --x64", "build:editor:dist": "npm run -s build:editor:base && electron-builder --win --mac --x64", "build:editor:base": "rimraf dist app && ts-node src/app/tools/setProfile.ts && tsc && ng build -prod", "start": "ts-node src/app/tools/setProfile.ts && tsc && npm-run-all -p start:ng start:electron", @@ -33,6 +35,12 @@ "output": "app", "buildResources": "." }, + "win": { + "target": "nsis" + }, + "nsis": { + "include": "./installer.nsh" + }, "files": [ "./dist" ], @@ -78,7 +86,7 @@ "interactive", "cli" ], - "author": "Connor Peet ", + "author": "Microsoft Corporation", "license": "MIT", "bugs": { "url": "https://github.com/mixer/miix-cli/issues" @@ -157,6 +165,7 @@ "@mcph/miix-webpack-plugin": "^0.1.2", "chalk": "^2.3.0", "command-exists": "^1.2.2", + "electron-updater": "^2.21.4", "fix-path": "^2.1.0", "form-data": "^2.3.1", "json5": "^0.5.1", diff --git a/src/app/editor/editor.config.ts b/src/app/editor/editor.config.ts index 5a8eb18..2823542 100644 --- a/src/app/editor/editor.config.ts +++ b/src/app/editor/editor.config.ts @@ -4,7 +4,7 @@ import { CONF_PROD } from '../environments/environment.prod'; // tslint:disable const ENV: string = 'dev'; -const VERSION: string = '0.2.7'; +const VERSION: string = '0.4.0'; export let AppConfig: { production: boolean; diff --git a/src/electron.ts b/src/electron.ts index c9f51d8..2b8cec6 100755 --- a/src/electron.ts +++ b/src/electron.ts @@ -1,10 +1,13 @@ import { app, BrowserWindow, Menu, MenuItem } from 'electron'; +import { autoUpdater } from 'electron-updater'; import * as fixPath from 'fix-path'; import * as path from 'path'; import * as url from 'url'; import { ElectronServer } from './server/electron-server'; +autoUpdater.checkForUpdatesAndNotify().catch(err => err); + let window: BrowserWindow | null = null; let server: ElectronServer;