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

The way to get all your binaries to be signed #3997

Closed
universeroc opened this issue Jun 26, 2019 · 0 comments
Closed

The way to get all your binaries to be signed #3997

universeroc opened this issue Jun 26, 2019 · 0 comments

Comments

@universeroc
Copy link

  • Version:
    electron-builder: 20.43.0

electron-updater: 4.0.6

  • Target:
    target: Windows 10

This is the a related issue of #3995

I read the source code of winPacker.ts and get some useful infomation:

  • set the "signDlls": true
  • _fsExtraP().readdir can not read recursively

I try some code to replace the _fsExtraP().readdir to make it could recursively read the directory and it works, but I don't know and I'm not sure how to make the recursive readdir a good one to contribute into the source code, so I open this issue @develar

`
const { promisify } = require('util');
const { resolve } = require('path');
const fs = require('fs');
const readdir = promisify(fs.readdir);
const stat = promisify(fs.stat);

  async function getFiles(dir) {
    const subdirs = await readdir(dir);
    const files = await Promise.all(subdirs.map(async (subdir) => {
      const res = resolve(dir, subdir);
      return (await stat(res)).isDirectory() ? getFiles(res) : res;
    }));
    return files.reduce((a, f) => a.concat(f), []);
  }

 const outResourcesDir = path.join(packContext.appOutDir, "resources", "app.asar.unpacked");
  // yield _bluebirdLst().default.map((0, _promise().orIfFileNotExist)((0, _fsExtraP().readdir)(outResourcesDir), []), file => {
  yield _bluebirdLst().default.map((0, _promise().orIfFileNotExist)((0, getFiles)(outResourcesDir), []), file => {
    console.log('file:', file)
    if (file.endsWith(".exe") || file.endsWith(".dll")) {
      return _this5.sign(path.join(outResourcesDir, file));
    } else {
      return null;
    }
  });

`

In my project there are several binaries in the resources/app.asar.unpacked/xxx/yyy/zzz/*.dll

So it should support readdir recursively to get the unpacked binaries to be signed, and I read this develar@66ee8ab

develar added a commit to develar/electron-builder that referenced this issue Jun 26, 2019
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