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

Custom Windows Signing does not work when signing to a different location #7910

Closed
sdesmond46 opened this issue Nov 29, 2023 · 1 comment · Fixed by #7919 or #7916 · May be fixed by jebibot/electron-builder#3
Closed

Custom Windows Signing does not work when signing to a different location #7910

sdesmond46 opened this issue Nov 29, 2023 · 1 comment · Fixed by #7919 or #7916 · May be fixed by jebibot/electron-builder#3

Comments

@sdesmond46
Copy link

sdesmond46 commented Nov 29, 2023

  • Electron-Builder Version****: 24.4.0
  • Node Version: 18.15.0
  • Electron Version: 25.8.3
  • Electron Type (current, beta, nightly): current
  • Target: Windows

When providing a custom sign function to the windows config section you have the option to set a resultOutputPath which is then supposed to be copied over the original file by electron-builder. However, where the actual sign function is called the object is passed using the spread operator which means you are modifying a copy of the context instead of the context itself. This then means that you never have a value for resultOutputPath set where the renaming is supposed to happen.

Minimal repo:

  win: {
    signingHashAlgorithms: ['sha256'],
    sign: async (context) => {
      // This should cause a failure when copying the file but it does not
      context.resultOutputPath = 'foo';
    },
    target: ['nsis'],
  },
@mmaietta
Copy link
Collaborator

Nice find! Would you be willing to open a PR with the needed changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants