Skip to content

Commit

Permalink
fix: windows install issues
Browse files Browse the repository at this point in the history
chore(release): 4.0.0-beta.18 [skip ci]

* linux icons ([6622e80](6622e80))
* show error step on Ledger error, closes [#296](#296) ([a2fca81](a2fca81))
* windows install issues ([73ea00a](73ea00a))
  • Loading branch information
kyranjamie committed Jan 14, 2021
1 parent 8781dfe commit 1469915
Show file tree
Hide file tree
Showing 27 changed files with 118 additions and 88 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/debug-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- os: windows-latest
NPM_COMMAND: win
UPLOAD_ASSETS: release/**/*.msi
UPLOAD_ASSETS: release/**/*.exe
CSC_LINK_SECRET_NAME: CODE_SIGNING_CERTIFICATE_WINDOWS
CSC_KEY_PASSWORD_SECRET_NAME: CODE_SIGNING_PASSWORD_WINDOWS

Expand All @@ -56,7 +56,7 @@ jobs:
id: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}

- name: Variables
id: vars
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- os: windows-latest
NPM_COMMAND: win
UPLOAD_ASSETS: release/**/*.msi
UPLOAD_ASSETS: release/**/*.exe
CSC_LINK_SECRET_NAME: CODE_SIGNING_CERTIFICATE_WINDOWS
CSC_KEY_PASSWORD_SECRET_NAME: CODE_SIGNING_PASSWORD_WINDOWS

Expand Down Expand Up @@ -144,11 +144,11 @@ jobs:
max-parallel: 2
matrix:
stx_network: [testnet, mainnet]
ext: [dmg, msi, deb, rpm]
ext: [dmg, exe, deb, rpm]
include:
- ext: dmg
os: mac
- ext: msi
- ext: exe
os: win
- ext: rpm
os: linux
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# [4.0.0-beta.18](https://github.com/blockstack/stacks-wallet/compare/v4.0.0-beta.17...v4.0.0-beta.18) (2021-01-11)


### Bug Fixes

* linux icons ([6622e80](https://github.com/blockstack/stacks-wallet/commit/6622e80f4e3d32c6696f71de2ca54b59053e70dc))
* show error step on Ledger error, closes [#296](https://github.com/blockstack/stacks-wallet/issues/296) ([a2fca81](https://github.com/blockstack/stacks-wallet/commit/a2fca8128ddb16efba720c5d2a0febb81ebb2d6e))
* windows install issues ([73ea00a](https://github.com/blockstack/stacks-wallet/commit/73ea00a32dc70bf5b4d937809eb62794bdc7c435))

# [4.0.0-beta.17](https://github.com/blockstack/stacks-wallet/compare/v4.0.0-beta.16...v4.0.0-beta.17) (2021-01-11)


Expand Down
1 change: 0 additions & 1 deletion app/app-dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<title>Stacks Wallet</title>
</head>

<body>
Expand Down
1 change: 0 additions & 1 deletion app/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<html>
<head>
<meta charset="utf-8" />
<title>Stacks Wallet</title>
<meta
http-equiv="Content-Security-Policy"
content="default-src 'none'; font-src 'self'; img-src data:; style-src 'unsafe-inline'; script-src 'self' 'unsafe-eval' 'nonce-6ca3c3e1fcd34bbc8cfaeceaa8106e36' 'nonce-6ca3c3e1fcd34bbc8cfaeceaa8106e37'; connect-src *;"
Expand Down
6 changes: 3 additions & 3 deletions app/components/beta-notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { openExternalLink } from '@utils/external-links';
import { NETWORK } from '@constants/index';
import packageJson from '../../package.json';

const sha = process.env.SHA;
const sha = CONFIG.SHA;
const shaShort = sha && sha.substr(0, 7);
const pullRequest = process.env.PULL_REQUEST;
const branchName = process.env.BRANCH_NAME;
const pullRequest = CONFIG.PULL_REQUEST;
const branchName = CONFIG.BRANCH_NAME;
const version = packageJson.version;

const issueParams = new URLSearchParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const TransactionListError: FC<TransactionListErrorProps> = ({ node, erro
<Text textStyle="caption" color="ink.600" textAlign="center" mx="base" lineHeight="20px">
{usingPbcHostedNode && (
<>
Unable to connect to the Blockstack PBC hosted node.
Unable to connect to the Hiro Systems PBC hosted node.
<br />
<Text {...linkProps} onClick={() => void openExternalLink(STATUS_PAGE_URL)}>
Check the status page
Expand Down
2 changes: 1 addition & 1 deletion app/components/title-bar/title-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const TitleBar: FC = () => {
const content = (
<Flex
justifyContent="space-between"
pl="90px"
pl={process.platform === 'darwin' ? '90px' : 'tight'}
height="100%"
backgroundColor={winState === 'focused' ? 'white' : '#FAFAFC'}
>
Expand Down
4 changes: 2 additions & 2 deletions app/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import packageJson from '../../package.json';

type Environments = 'development' | 'testing' | 'production';

export const NETWORK = process.env.STX_NETWORK as 'mainnet' | 'testnet';
export const NETWORK = CONFIG.STX_NETWORK;

export const ENV = (process.env.NODE_ENV ?? 'production') as Environments;
export const ENV = (CONFIG.NODE_ENV ?? 'production') as Environments;

export const MNEMONIC_ENTROPY = 256;

Expand Down
1 change: 0 additions & 1 deletion app/crypto/key-generation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ describe(deriveKey.name, () => {
const pass = 'f255cadb0af84854819c63f26c53e1a9';
const { derivedKeyHash } = await deriveKey({ salt, pass });
const hash = Buffer.from(derivedKeyHash).toString('hex');
console.log(hash);
expect(hash).toEqual(
'd941c6ec3f04fa67c68b497169986588436b1697aa6b3a93218152658e5c494d2e3da9ea93522f0e4cb14b414b57b463'
);
Expand Down
2 changes: 1 addition & 1 deletion app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { configureStore, history } from './store/configureStore';

const { store, persistor } = configureStore();

const AppContainer = process.env.PLAIN_HMR ? Fragment : ReactHotAppContainer;
const AppContainer = CONFIG.PLAIN_HMR ? Fragment : ReactHotAppContainer;

document.addEventListener('DOMContentLoaded', () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
Expand Down
21 changes: 14 additions & 7 deletions app/main.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ import 'regenerator-runtime/runtime';
import path from 'path';
import { app, BrowserWindow, clipboard, ipcMain, Menu, session } from 'electron';
import { autoUpdater } from 'electron-updater';
import Store from 'electron-store';
import log from 'electron-log';
import windowState from 'electron-window-state';
import contextMenu from 'electron-context-menu';
import Store from 'electron-store';

import MenuBuilder from './menu';
import { deriveKey } from './crypto/key-generation';
import { NETWORK } from './constants/index';
import { validateConfig } from './main/validate-config';
import { getUserDataPath } from './main/get-user-data-path';

// CSP enabled in production mode, don't warn in development
delete process.env.ELECTRON_ENABLE_SECURITY_WARNINGS;
Expand Down Expand Up @@ -54,6 +55,9 @@ if (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === 'true')
require('electron-debug')();
}

app.setPath('userData', getUserDataPath(app));
app.setPath('logs', path.join(getUserDataPath(app), 'logs'));

const installExtensions = () => {
const installer = require('electron-devtools-installer');
const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
Expand All @@ -69,6 +73,10 @@ const createWindow = async () => {
await installExtensions();
}

// https://github.com/electron/electron/issues/22995
session.defaultSession.setSpellCheckerDictionaryDownloadURL('https://00.00/');
session.fromPartition('some-partition').setSpellCheckerDictionaryDownloadURL('https://00.00/');

const mainWindowState = windowState({
defaultWidth: 1024,
defaultHeight: 728,
Expand All @@ -88,8 +96,10 @@ const createWindow = async () => {
frame: process.platform !== 'darwin',
titleBarStyle: process.platform === 'darwin' ? 'hidden' : 'default',
icon: iconPath,
title: `Stacks Wallet` + (NETWORK === 'testnet' ? ' Testnet' : ''),
webPreferences: {
disableBlinkFeatures: 'Auxclick',
spellcheck: false,
webSecurity: true,
nodeIntegration: false,
nodeIntegrationInWorker: false,
Expand Down Expand Up @@ -148,11 +158,9 @@ const createWindow = async () => {
// eslint-disable-next-line
new AppUpdater();

session
.fromPartition('some-partition')
.setPermissionRequestHandler((_webContents, _permission, callback) => {
callback(false);
});
session.defaultSession.setPermissionRequestHandler((_webContents, _permission, callback) => {
callback(false);
});
};

app.on('web-contents-created', (_event, contents) => {
Expand Down Expand Up @@ -191,7 +199,6 @@ ipcMain.handle('store-get', (_e, { key }: any) => store.get(key));
ipcMain.handle('store-delete', (_e, { key }: any) => store.delete(key));
// ipcMain.handle('store-getEntireStore', () => store.store);
ipcMain.handle('store-clear', () => store.clear());

ipcMain.on('store-getEntireStore', event => {
event.returnValue = store.store;
});
Expand Down
14 changes: 14 additions & 0 deletions app/main/get-user-data-path.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { App } from 'electron';
import path from 'path';

export function getUserDataPath(app: App) {
const appId = 'so.hiro.StacksWallet';
const appData = app.getPath('appData');
const network = process.env.STX_NETWORK === 'mainnet' ? '' : 'Testnet';
if (CONFIG.NODE_ENV === 'development') {
const devName = `${appId}${network}Dev`;
return path.join(appData, devName);
}
const prodName = `${appId}${network}`;
return path.join(appData, prodName);
}
5 changes: 2 additions & 3 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "stacks-wallet",
"version": "4.0.0-beta.8",
"name": "stacks-wallet-inner-package",
"description": "Stacks Wallet v4 — Participate in Stacking to earn bitcoin rewards",
"main": "./main.prod.js",
"author": {
"email": "info@blockstack.com",
"name": "Blockstack PBC"
"name": "Hiro Systems PBC"
},
"scripts": {
"electron-rebuild": "node -r ../internals/scripts/BabelRegister.js ../internals/scripts/ElectronRebuild.js",
Expand Down
1 change: 0 additions & 1 deletion app/pages/home/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import { HomeLayout } from './home-layout';

export const Home: FC = () => {
const dispatch = useDispatch();

const {
address,
balance,
Expand Down
4 changes: 3 additions & 1 deletion app/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV === 'development') {

if (process.env.START_HOT) {
// Dynamically insert the bundled app script in the renderer process
const port = process.env.PORT || 1212;
const port = 1212;
scriptsToLoad.push(`http://localhost:${port}/dist/renderer.dev.js`);
} else {
scriptsToLoad.push('./dist/renderer.prod.js');
Expand Down Expand Up @@ -91,6 +91,8 @@ const walletApi = {
},

contextMenu: (menuItems: any) => ipcRenderer.send('context-menu-open', { menuItems }),

installPath: () => ipcRenderer.sendSync('installPath'),
};

declare global {
Expand Down
2 changes: 1 addition & 1 deletion app/store/configureStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as configureStoreDev from './configureStore.dev';
import * as configureStoreProd from './configureStore.prod';

const selectedConfigureStore =
process.env.NODE_ENV === 'production' ? configureStoreProd : configureStoreDev;
CONFIG.NODE_ENV === 'production' ? configureStoreProd : configureStoreDev;

export const { configureStore } = selectedConfigureStore;

Expand Down
14 changes: 14 additions & 0 deletions app/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
export type WindowActiveState = 'focused' | 'blurred';

declare global {
const CONFIG: {
NODE_ENV: 'development' | 'production';
DEBUG_PROD: string;
STX_NETWORK: 'testnet' | 'mainnet';
PLAIN_HMR?: string;
START_HOT: boolean;
PORT?: number;
PULL_REQUEST?: string;
BRANCH_NAME?: string;
SHA?: string;
};
}
1 change: 0 additions & 1 deletion app/utils/stacking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ interface ConvertToPoxAddressBtc {
export function convertPoxAddressToBtc(network: 'mainnet' | 'testnet') {
return ({ version, hashbytes }: ConvertToPoxAddressBtc) => {
const ver = new BN(version).toNumber() as AddressHashMode;
console.log({ ver });
if (ver === AddressHashMode.SerializeP2WPKH || ver === AddressHashMode.SerializeP2WSH)
return null;
return address.toBase58Check(hashbytes, poxKeyToVersionBytesMap[network][ver]);
Expand Down
18 changes: 15 additions & 3 deletions configs/webpack.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import path from 'path';
import webpack from 'webpack';
import TsconfigPathsPlugin from 'tsconfig-paths-webpack-plugin';
import ExtendedDefinePlugin from 'extended-define-webpack-plugin';

import { dependencies as externals } from '../app/package.json';

// eslint-disable-next-line import/no-default-export
Expand Down Expand Up @@ -67,9 +69,19 @@ export default {
},

plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
SHA: '',
new ExtendedDefinePlugin({
CONFIG: {
NODE_ENV: process.env.NODE_ENV,
PLAIN_HMR: process.env.PLAIN_HMR,
STX_NETWORK: process.env.STX_NETWORK || 'testnet',
DEBUG_PROD: process.env.DEBUG_PROD,
START_HOT: process.env.START_HOT,
PORT: process.env.PORT,
PULL_REQUEST: process.env.PULL_REQUEST,
BRANCH_NAME: process.env.BRANCH_NAME,
SHA: process.env.SHA,
PULL_REQUEST: process.env.PULL_REQUEST,
},
}),
],
};
19 changes: 7 additions & 12 deletions configs/webpack.config.main.prod.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,12 @@ export default merge(baseConfig, {
filename: './app/main.prod.js',
},

// optimization: {
// minimizer: process.env.E2E_BUILD
// ? []
// : [
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
// new TerserPlugin({
// parallel: true,
// sourceMap: true,
// cache: true,
// }),
// ],
// },
optimization: {
minimizer: [
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
// new TerserPlugin({}),
],
},

plugins: [
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
Expand All @@ -65,6 +59,7 @@ export default merge(baseConfig, {
DEBUG_PROD: false,
START_MINIMIZED: false,
E2E_BUILD: false,
STX_NETWORK: process.env.STX_NETWORK,
}),
],

Expand Down
22 changes: 0 additions & 22 deletions configs/webpack.config.renderer.dev.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,32 +125,10 @@ export default merge(baseConfig, {

new webpack.NoEmitOnErrorsPlugin(),

/**
* Create global constants which can be configured at compile time.
*
* Useful for allowing different behaviour between development builds and
* release builds
*
* NODE_ENV should be production so that modules do not perform certain
* development checks
*
* By default, use 'development' as NODE_ENV. This can be overriden with
* 'staging', for example, by changing the ENV variables in the npm scripts
*/
new webpack.EnvironmentPlugin({
NODE_ENV: 'development',
STX_NETWORK: 'testnet',
SHA: '',
}),

new webpack.LoaderOptionsPlugin({
debug: true,
}),

// new webpack.ProvidePlugin({
// Buffer: ['buffer', 'Buffer'],
// }),

new CopyPlugin({
patterns: [{ from: 'node_modules/argon2-browser/dist/argon2.wasm', to: '.' }],
}),
Expand Down
2 changes: 1 addition & 1 deletion configs/webpack.config.renderer.prod.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export default merge(baseConfig, {
new webpack.EnvironmentPlugin({
NODE_ENV: 'production',
DEBUG_PROD: false,
STX_NETWORK: 'testnet',
STX_NETWORK: process.env.STX_NETWORK,
E2E_BUILD: false,
}),

Expand Down
Loading

0 comments on commit 1469915

Please sign in to comment.