-
-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad7bf1f
commit 76166af
Showing
3 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | ||
}; |