electron-wix-msi
electron-wix-msi copied to clipboard
Setting additional WIX options
Is there a way to do more WIX configuration? Specifically, I am trying to set the installer icon. And eventually I want do things like: http://wixtoolset.org/documentation/manual/v3/howtos/ui_and_localization/configure_arp_appearance.html
Electron wix msi generates a WIX template before compiling it with WIX toolset.
I've been able to override the template generated by new MSICreator()
and store it as a file.
Initial wix .wxs template can be read from the output msiCreator.wixTemplate
initially. Then you can update it with new placeholders {{WhatYouWant}}
and dynamically set values.
// custom wix template to add another shortcut for readonly mode
msiCreator.wixTemplate = fs.readFileSync(path.join(__dirname, wixTemplatePath), 'utf8');
msiCreator.wixTemplate = msiCreator.wixTemplate.replace(/{{DefaultIcon}}/gi, path.join(__dirname, staticResourcesDir, 'myicon.ico'));
Apparently, there's already an option to update the WiX template built into the MSICreator
class:
const creator = new MSICreator({})
//replace is built-in
creator.wixTemplate.replace('find expression', 'replace expression')
That being said, it's still unclear how this actually works. I'm assuming that electron-wix-msi
loads the wix.xml
template file from (/node_modules/electron-wix-msi/static/wix.xml
) into memory, does the replace
, then uses the result as the WiX template.