diff --git a/package.electron.json b/package.electron.json index 5d50e0197e87d49fffeb67ca3954c072f1276dce..2c6c7c676d069ec95456ee372b3e754ee6dbb035 100644 --- a/package.electron.json +++ b/package.electron.json @@ -1,5 +1,5 @@ { - "appId": "com.parity.ui", + "appId": "io.parity.ui", "directories": { "buildResources": "./" }, @@ -15,8 +15,14 @@ "category": "public.app-category.productivity", "icon": "./assets/icon/small-white-512x512.png" }, + "nsis": { + "allowToChangeInstallationDirectory": true, + "include": "installer.nsh", + "oneClick": false + }, "productName": "Parity UI", "win": { - "icon": "./assets/icon/small-white-512x512.png" + "icon": "./assets/icon/small-white-512x512.png", + "target": "nsis" } } \ No newline at end of file diff --git a/package.json b/package.json index dbc875b69a4afc9881126c5cf05715b364f2f328..3cdc46eecd291881f5d77e210c36c737bf3f1863 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "main": ".build/electron.js", "jsnext:main": ".build/electron.js", "author": { - "name": "Parity Team", + "name": "Parity Technologies", "email": "admin@parity.io" }, "maintainers": [ diff --git a/src/index.electron.js b/src/index.electron.js index ca8d3b173da831cc2ca9988c0f7c518622557406..9d851e0b3e22109a7bbbee165956186777a68c44 100644 --- a/src/index.electron.js +++ b/src/index.electron.js @@ -160,7 +160,7 @@ function createWindow () { session.defaultSession.webRequest.onBeforeSendHeaders({ urls: ['ws://*/*', 'wss://*/*'] }, (details, callback) => { - details.requestHeaders.Origin = `parity://${mainWindow.id}.wallet.parity`; + details.requestHeaders.Origin = `parity://${mainWindow.id}.ui.parity`; callback({ requestHeaders: details.requestHeaders }); }); diff --git a/src/util/windowInstaller.nsh b/src/util/windowInstaller.nsh new file mode 100644 index 0000000000000000000000000000000000000000..35434cd1270c90b8e515bf1cd63749ab54628569 --- /dev/null +++ b/src/util/windowInstaller.nsh @@ -0,0 +1,10 @@ +; Change default install directory on Windows +; https://www.electron.build/configuration/nsis#how-do-change-the-default-installation-directory-to-custom +macro preInit + SetRegView 64 + WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" + WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" + SetRegView 32 + WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" + WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\Program Files\Parity Technologies\Parity UI" +!macroend diff --git a/webpack/electron.js b/webpack/electron.js index 907e3ccfbe23e0217d2b89980b5efe4b85e1d211..debab775b04325e966aecf55b15882f974b2876e 100644 --- a/webpack/electron.js +++ b/webpack/electron.js @@ -16,6 +16,7 @@ // along with Parity. If not, see . const path = require('path'); +const CopyWebpackPlugin = require('copy-webpack-plugin'); const rulesEs6 = require('./rules/es6'); const rulesParity = require('./rules/parity'); @@ -57,5 +58,8 @@ module.exports = { ] }, - plugins: Shared.getPlugins() + plugins: Shared.getPlugins().concat(new CopyWebpackPlugin([{ + from: path.join(__dirname, '../src/util/windowInstaller.nsh'), + to: 'installer.nsh' + }])) };