Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const path = require('path')
const { MSICreator } = require('electron-wix-msi')
const BUILDDIR = path.join(__dirname, '..', process.env.BUILDDIR)
const { PRODUCT_NAME, SETUP_ICON: setupIcon } = process.env
const appDirectory = path.join(BUILDDIR, `${PRODUCT_NAME}-win32-x64`)
const outputDirectory = path.join(BUILDDIR, 'installers/win32-x64')
console.log('Windows msi build started')
const creator = new MSICreator({
appDirectory,
outputDirectory,
setupIcon,
name: 'kui',
setupExe: `${PRODUCT_NAME}.exe`,
exe: 'kui'
})
creator
.create()
.then(() => creator.compile())
.then(() => {
console.log('Windows msi build succeeded')
})
.catch(err => {
console.error(err)
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: getNameFromAuthor(packageJSON.author),
exe: `${appName}.exe`,
}, configFn(forgeConfig.electronWixMSIConfig, targetArch), {
appDirectory: dir,
outputDirectory: outPath,
}));
await creator.create();
const { msiFile } = await creator.compile();
return [msiFile];
};