|
| 1 | +// |
| 2 | +// Copyright (c) Microsoft. All rights reserved. |
| 3 | +// Licensed under the MIT license. |
| 4 | +// |
| 5 | +// Microsoft Bot Framework: http://botframework.com |
| 6 | +// |
| 7 | +// Bot Framework Emulator Github: |
| 8 | +// https://github.com/Microsoft/BotFramwork-Emulator |
| 9 | +// |
| 10 | +// Copyright (c) Microsoft Corporation |
| 11 | +// All rights reserved. |
| 12 | +// |
| 13 | +// MIT License: |
| 14 | +// Permission is hereby granted, free of charge, to any person obtaining |
| 15 | +// a copy of this software and associated documentation files (the |
| 16 | +// "Software"), to deal in the Software without restriction, including |
| 17 | +// without limitation the rights to use, copy, modify, merge, publish, |
| 18 | +// distribute, sublicense, and/or sell copies of the Software, and to |
| 19 | +// permit persons to whom the Software is furnished to do so, subject to |
| 20 | +// the following conditions: |
| 21 | +// |
| 22 | +// The above copyright notice and this permission notice shall be |
| 23 | +// included in all copies or substantial portions of the Software. |
| 24 | +// |
| 25 | +// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, |
| 26 | +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 27 | +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 28 | +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| 29 | +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 30 | +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 31 | +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 32 | +// |
| 33 | + |
| 34 | +const packageJson = require('../../package.json'); |
| 35 | +const electronVersion = packageJson.devDependencies.electron; |
| 36 | + |
| 37 | +const baseConfig = { |
| 38 | + asar: true, |
| 39 | + appId: 'F3C061A6-FE81-4548-82ED-C1171D9856BB', |
| 40 | + productName: 'Bot Framework Emulator', |
| 41 | + copyright: 'Copyright © 2018 Microsoft Corporation', |
| 42 | + protocols: [ |
| 43 | + { |
| 44 | + name: 'Bot Framework Emulator', |
| 45 | + role: 'Viewer', |
| 46 | + schemes: ['bfemulator'], |
| 47 | + }, |
| 48 | + ], |
| 49 | + fileAssociations: [ |
| 50 | + { |
| 51 | + name: 'Bot', |
| 52 | + ext: 'bot', |
| 53 | + }, |
| 54 | + { |
| 55 | + name: 'Transcript', |
| 56 | + ext: 'transcript', |
| 57 | + }, |
| 58 | + ], |
| 59 | + asarUnpack: ['app/extensions/**', 'node_modules/@bfemulator/extension-*/**'], |
| 60 | + directories: { |
| 61 | + buildResources: './scripts/config/resources', |
| 62 | + }, |
| 63 | + files: [ |
| 64 | + '**/*', |
| 65 | + '!**/node_modules/*/{README.md,README,readme.md,readme,test}', |
| 66 | + '!**/node_modules/.bin', |
| 67 | + '!**/*.{o,hprof,orig,pyc,pyo,rbc}', |
| 68 | + '!**/._*', |
| 69 | + '!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,__pycache__,thumbs.db,.gitignore,.gitattributes,.editorconfig,.idea,appveyor.yml,.travis.yml,circle.yml,.babelrc,.eslintignore,.eslintrc.js,.prettierrc,.eslintrc.react.js,.node-version}', |
| 70 | + '!.vscode${/*}', |
| 71 | + '!doc${/*}', |
| 72 | + '!**/{tsconfig.json,README.md,getlicenses.cmd}', |
| 73 | + '!**/node_modules/@types', |
| 74 | + '!./scripts', |
| 75 | + '!**/cache', |
| 76 | + '!./installer', |
| 77 | + ], |
| 78 | + win: { |
| 79 | + artifactName: 'BotFramework-Emulator-${version}-windows-setup.${ext}', |
| 80 | + icon: './scripts/config/resources/icon.ico', |
| 81 | + target: [ |
| 82 | + { |
| 83 | + target: 'nsis', |
| 84 | + arch: ['ia32'], |
| 85 | + }, |
| 86 | + ], |
| 87 | + }, |
| 88 | + nsis: { |
| 89 | + include: './scripts/config/resources/nsis/installer.nsh', |
| 90 | + perMachine: false, |
| 91 | + allowElevation: true, |
| 92 | + allowToChangeInstallationDirectory: true, |
| 93 | + packElevateHelper: true, |
| 94 | + unicode: true, |
| 95 | + runAfterFinish: true, |
| 96 | + installerHeader: './scripts/config/resources/nsis/installerHeader.bmp', |
| 97 | + installerIcon: './scripts/config/resources/icon.ico', |
| 98 | + installerSidebar: './scripts/config/resources/nsis/installerSidebar.bmp', |
| 99 | + uninstallerIcon: './scripts/config/resources/icon.ico', |
| 100 | + uninstallerSidebar: './scripts/config/resources/nsis/installerSidebar.bmp', |
| 101 | + createDesktopShortcut: true, |
| 102 | + createStartMenuShortcut: true, |
| 103 | + shortcutName: 'Bot Framework Emulator (V4)', |
| 104 | + oneClick: false, |
| 105 | + }, |
| 106 | + mac: { |
| 107 | + artifactName: 'BotFramework-Emulator-${version}-mac.${ext}', |
| 108 | + category: 'public.app-category.developer-tools', |
| 109 | + target: [ |
| 110 | + { |
| 111 | + target: 'dmg', |
| 112 | + arch: ['x64'], |
| 113 | + }, |
| 114 | + ], |
| 115 | + extendInfo: { |
| 116 | + NSMicrophoneUsageDescription: 'This app requires microphone access to record audio.', |
| 117 | + }, |
| 118 | + entitlements: './scripts/config/resources/entitlements.plist', |
| 119 | + }, |
| 120 | + dmg: { |
| 121 | + background: './scripts/config/resources/background.tiff', |
| 122 | + icon: './scripts/config/resources/emulator_dmg.icns', |
| 123 | + title: 'Bot Framework Emulator Installer', |
| 124 | + contents: [ |
| 125 | + { |
| 126 | + x: 140, |
| 127 | + y: 244, |
| 128 | + }, |
| 129 | + { |
| 130 | + x: 380, |
| 131 | + y: 244, |
| 132 | + type: 'link', |
| 133 | + path: '/Applications', |
| 134 | + }, |
| 135 | + ], |
| 136 | + }, |
| 137 | + linux: { |
| 138 | + artifactName: 'BotFramework-Emulator-${version}-${platform}-${arch}.${ext}', |
| 139 | + category: 'Development', |
| 140 | + target: [ |
| 141 | + { |
| 142 | + target: 'AppImage', |
| 143 | + arch: ['x64'], |
| 144 | + }, |
| 145 | + ], |
| 146 | + }, |
| 147 | + publish: null, |
| 148 | + remoteBuild: false, |
| 149 | +}; |
| 150 | + |
| 151 | +export default () => { |
| 152 | + if (process.platform === 'win32') { |
| 153 | + // on Windows we need to manually download the internal Electron binary |
| 154 | + // and then unsign it before packing it up to be signed |
| 155 | + return { |
| 156 | + ...baseConfig, |
| 157 | + electronDist: 'customElectron', |
| 158 | + }; |
| 159 | + } else { |
| 160 | + // on Mac and Linux we will download the internal Electron binary as-is |
| 161 | + // during the electron-builder pack call |
| 162 | + return { |
| 163 | + ...baseConfig, |
| 164 | + electronDownload: { |
| 165 | + version: electronVersion, |
| 166 | + }, |
| 167 | + }; |
| 168 | + } |
| 169 | +}; |
0 commit comments