Skip to content

Commit

Permalink
feat(maker): add Wix support
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored and malept committed Jan 30, 2018
1 parent ad7bf1f commit 76166af
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ config object:
| `zip` | All | Zips your packaged application | None | Yes | `zip` on Darwin/Linux |
| `squirrel` | Windows | Generates an installer and `.nupkg` files for Squirrel.Windows | [`electronWinstallerConfig`](https://github.com/electron/windows-installer#usage) | Yes | |
| `appx` | Windows | Generates a Windows Store package | [`windowsStoreConfig`](https://github.com/felixrieseberg/electron-windows-store#programmatic-usage) | No | |
| `wix` | Windows | Generates a traditional MSI file | [`electronWixMSIConfig`](https://github.com/felixrieseberg/electron-wix-msi#configuration) | No | [Wix Toolit](https://github.com/felixrieseberg/electron-wix-msi#prerequisites) |
| `dmg` | Darwin | Generates a DMG file | [`electronInstallerDMG`](https://github.com/mongodb-js/electron-installer-dmg#api) | No | |
| `deb` | Linux | Generates a Debian package | [`electronInstallerDebian`](https://github.com/unindented/electron-installer-debian#options) | Yes | [`fakeroot` and `dpkg`](https://github.com/unindented/electron-installer-debian#requirements) |
| `rpm` | Linux | Generates an RPM package | [`electronInstallerRedhat`](https://github.com/unindented/electron-installer-redhat#options) | Yes | [`rpm`](https://github.com/unindented/electron-installer-redhatn#requirements) |
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@
"electron-installer-flatpak": "^0.8.0",
"electron-installer-redhat": "^0.5.0",
"electron-windows-store": "^0.12.0",
"electron-winstaller": "^2.5.0"
"electron-winstaller": "^2.5.0",
"electron-wix-msi": "^1.2.3"
},
"engines": {
"node": ">= 6.0"
Expand Down
31 changes: 31 additions & 0 deletions src/makers/win32/wix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import path from 'path';

import { ensureDirectory } from '../../util/ensure-output';
import configFn from '../../util/config-fn';
import isInstalled from '../../util/is-installed';
import { getDistinguishedNameFromAuthor } from './appx';

export const isSupportedOnCurrentPlatform = async () => isInstalled('electron-wix-msi');

export default async ({ dir, appName, targetArch, forgeConfig, packageJSON }) => {
const { MSICreator } = require('electron-wix-msi');

const outPath = path.resolve(dir, `../make/wix/${targetArch}`);
await ensureDirectory(outPath);

const creator = new MSICreator(Object.assign({
description: packageJSON.description,
name: appName,
version: packageJSON.version,
manufacturer: getDistinguishedNameFromAuthor(packageJSON.author).substr(3),
exe: `${appName}.exe`,
}, configFn(forgeConfig.electronWixMSIConfig, targetArch), {
appDirectory: dir,
outputDirectory: outPath,
}));

await creator.create();
const { msiFile } = await creator.compile();

return [msiFile];
};

0 comments on commit 76166af

Please sign in to comment.