-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: Provide a custom verify function interface in NsisUpdater #7337
Conversation
🦋 Changeset detectedLatest commit: e9295e6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for car-park-attendant-cleat-11576 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Could I add the example to slow-avocados-carry.md ? import { NsisUpdater } from "electron-updater"
import { verifySignatureByPublishName } from "win-verify-signature"
// Or MacUpdater, AppImageUpdater
export default class AppUpdater {
constructor() {
const options = {
requestHeaders: {
// Any request headers to include here
},
provider: 'generic',
url: 'https://example.com/auto-updates'
}
const autoUpdater = new NsisUpdater(options)
autoUpdater.verifyUpdateCodeSignature = (publisherName: string[], path: string) => {
const result = verifySignatureByPublishName(path, publisherName);
if(result.signed) return Promise.resolve(null);
return Promise.resolve(result.message);
}
autoUpdater.addAuthHeader(`Bearer ${token}`)
autoUpdater.checkForUpdatesAndNotify()
}
} |
Your example provided looks great though. Perhaps we could add it to the Common Questions for Windows configuration? I can't seem to find any other docs specifically on auto-update configuration, just for publishers but not the AppUpdater itself? (Maybe I need to create a separate Page just for that in the future?) |
I have added the example to win.md. Please help check it. |
Any chance we could get a bit more info on how this can be implemented? import { autoUpdater } from "electron-updater"; How could this be implemented with the "default" updater? |
Replace the PowerShell with a native verify signature module, but not all users will have access to a Windows build machine if their project does not currently require a native module. For instance, compiling with Wine on linux/docker would no longer work.
Providing a custom verify function interface, if the user want to use native verify module, they can pass it and they need to have an access to a windows build machine. If they don't pass it, will use the default verify signature function(https://github.com/electron-userland/electron-builder/blob/master/packages/electron-updater/src/windowsExecutableCodeSignatureVerifier.ts).
Interface
Example