Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

light.exe : error LGHT0306 : An error (E_FAIL) was returned while finalizing a CAB file. #184

Open
turalowski opened this issue May 1, 2024 · 0 comments

Comments

@turalowski
Copy link

Hello,

When I try to create msi installer for electron application with electron-wix-msi package, following error message appears:

                throw new Error(`Could not create ${type} file. Code: ${code} StdErr: ${stderr} StdOut: ${stdout}`);
                      ^

Error: Could not create msi file. Code: 306 StdErr:  StdOut: Windows Installer XML Toolset Linker version 3.14.1.8722
Copyright (c) .NET Foundation and contributors. All rights reserved.

light.exe : error LGHT0306 : An error (E_FAIL) was returned while finalizing a CAB file. This most commonly happens when creating a CAB file with more than 65535 files in it. Either reduce the number of files in your installation package or split your installation package's files into more than one CAB file using the Media element.

How can I create multiple CAB files?

build.js

const { MSICreator } = require('electron-wix-msi');
const fse = require('fs-extra');

const path = require('path')

module.exports.build = async (conf) => {
  let remove = conf.remove
  for (let file_path of remove) {
    fse.removeSync(file_path);
  }
  fse.removeSync(
    path.resolve(
      conf.src, 'resources', 'app', 'node_modules', '.cache'
    )
  )

  const options = {
    ...
  }
  fse.ensureDirSync(conf.dist);

  const msiCreator = new MSICreator(options);

  await msiCreator.create();
  await msiCreator.compile();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant