0

We are considering Electron for our next app and we have several enterprise customers that require that they be able to change the install location. Because of this, I'm trying to use Electron Forge's Wix MSI installer. I am able to create the installer and it runs. I am stuck on the auto update feature. I can't figure out where I specify the update location, or where the app should look for possible updates.

I have read the README several times and looked at several tutorials but no one mentions this feature.

I have this builder script:

const { MSICreator } = require('electron-wix-msi');
const path = require('path')

const APP_DIR = path.resolve(__dirname, './out/ElectronTest-win32-x64')
const OUT_DIR = path.resolve(__dirname, './out/windows_installer');

const msiCreator = new MSICreator({
    appDirectory: APP_DIR,
    outputDirectory: OUT_DIR,

    description: 'This is a demo application',
    exe: 'Electron Test',
    name: 'Electron Test',
    manufacturer: 'Me',
    version: '1.0.0',
    icon: 'windows icon.ico',
    features:{
        autoLaunch: true,
        autoUpdate: true,
      },
    ui:{
        chooseDirectory: true,

    },
    beforeCreate: async (msiCreator) => {
        msiCreator.wixTemplate = getTemplate('myWix', false);
        msiCreator.updaterTemplate = getTemplate('myUpdateFeature', true);
        console.info('msiCreator config', msiCreator);
      }
});

msiCreator.create().then(function(){
    msiCreator.compile();
});

const getTemplate = (name, trimTrailingNewLine) => {
    const content = fs.readFileSync(path.join(__dirname, `temp/${name}.xml`), 'utf-8');
    if (trimTrailingNewLine) {
      return content.replace(/[\r\n]+$/g, '');
    } else {
      return content;
    }
  };

Can someone point me in the right direction?

0