Skip to content

Commit

Permalink
create windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
ryogx committed Nov 18, 2021
1 parent 72f7c45 commit f1864e4
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
Binary file added build_assets/ryo-wallet-background.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added build_assets/ryo-wallet-banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions build_msi_installer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// ./build_installer.js

// 1. Import Modules
const { MSICreator } = require('@zenul_abidin/electron-wix-msi');
const path = require('path');
const fsPromises = require('fs/promises');

// 2. Define input and output directory.
// Important: the directories must be absolute, not relative.
const APP_DIR = path.resolve(__dirname, './dist/electron-mat/Packaged/win-unpacked');
const OUT_DIR = path.resolve(__dirname, './dist/electron-mat/windows_installer');

// 3, Copy LICENSE file into app directory or else the build will abort.
async function copyLicenseFile() {
try {
await fsPromises.copyFile(path.resolve(__dirname, './LICENSE'), path.join(APP_DIR, './LICENSE'), 0)
} catch (err) {
process.stderr.write(`Could not copy LICENSE file to app directory (does it exist?): ${err}`)
process.exit()
}
}

copyLicenseFile()

// 4. Instantiate the MSICreator
const msiCreator = new MSICreator({
appDirectory: APP_DIR,
outputDirectory: OUT_DIR,

// Configure metadata
description: 'Ryo Wallet - Privacy for eveRYOne',
exe: 'Ryo Wallet Atom',
name: 'Ryo Wallet Atom',
manufacturer: 'Ryo Wallet Developers',
version: '1.5.0',

// Configure installer User Interface
ui: {
chooseDirectory: true,
images: {
background: path.resolve(__dirname, './build_assets/ryo-wallet-background.jpg'),
banner: path.resolve(__dirname, './build_assets/ryo-wallet-banner.jpg'),
}
},
});

// 5. Create a .wxs template file
msiCreator.create().then(function(){

// 6: Compile the template to a .msi file
msiCreator.compile();
});

1 change: 1 addition & 0 deletions install_windows_deps.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm install @zenul_abidin/electron-wix-msi@3.2.5 exe-icon-extractor@1.0.8

0 comments on commit f1864e4

Please sign in to comment.