electron-release-server
electron-release-server copied to clipboard
NSIS Support Documentation
As develar is getting closer to completing NSIS, it may be a good idea to put a tracking ticket on this side to provide examples of hosting the artifact and retrieving the artifact.
It seems electron-auto-updater
should support electron-release-server
as a update server provider. I mean — grab lasest version using /download/latest
and download file using /download/:version/:platform
I guess this is more of a "modify documentation/provide use cases" suggestion. I will update the description.
It looks like the /update, for Windows, will only serve .nupkg and its quoted here
When an update is not available, the update endpoints will return a 204 response. This happens when the version you are requesting is newer than or equal to the last available version on the server, but also when the appropriate file type is not present for Squirrel to be able to update your application (.zip for Squirrel.Mac, .nupkg for Squirrel.Windows).
Currently we use the /api/version. Iterate through the assets and use semVer to check if an update is available. then use the download/:version/:platform to download the .exe.
If we do it that way, I think we lose the ability to make use of the autoupdater
functionality. We could use the .quitAndInstall but its not recommended to run it without using update-downloaded
. @develar or @ArekSredzki. Should I just have a check to make sure the entire file was downloaded, placed in the location that squirrel places it, then just run .quitAndInstall or Am I missing something?
I'm currently attempting to use electron-release-server
as a generic provider in electron-builder
. From my understanding, the electron-auto-updater
for Windows NSIS requires a latest.yml
and the installer-version.exe
.
Currently the electron-release-server
does not support uploading .yml
to the assets. There is also no api endpoint that will return both the .exe
and the .yml
in the latest asset. Because of this, you cannot set the correct publish configurations to point to that asset.
I'm currently attempting to use electron-release-server as a generic provider in electron-builder
@Jflinchum Provider like BintrayProvider.ts or GenericProvider.ts should be implemented in this case. Please see https://github.com/electron-userland/electron-builder/blob/master/nsis-auto-updater/src/BintrayProvider.ts or https://github.com/electron-userland/electron-builder/blob/master/nsis-auto-updater/src/GenericProvider.ts
Or, electron-release-server should be modified to allow upload latest.yml.
Should I just have a check to make sure the entire file was downloaded, placed in the location that squirrel places it, then just run .quitAndInstall or Am I missing something?
@SxMShaDoW We do not use Squirrel.Windows anymore. NSIS is recommended (electron-builder). https://github.com/electron-userland/electron-builder/issues/529#issuecomment-253731088
Hey all,
Sorry for the delayed response, I've been very busy recently.
Could you provide some information about what latest.yml
contains? Does it really need to be uploaded, or can it be generated like the RELEASES
file is now?
Thanks
can it be generated like the RELEASES file is now?
Yes, it can be generated.
export interface VersionInfo {
readonly version: string
}
export interface UpdateInfo extends VersionInfo {
readonly path: string
readonly sha2: string
}
All 3 fields can be easily generated on the fly (sha2
— sha256 checksum, path
relative path to file (relative to latest.yaml
parent), version
semantic app version).
Thanks @develar
Is there a way to use a SHA1 hash instead? I currently compute it on upload for use in the RELEASES
file.
sha2
is optional field. You can addsha1
field instead and it will be supported by electron-builder later.
Interesting, so this is only used for building new versions? I assume that one of these is required for each release channel. To clarify, it only refers to the latest release in that channel? This is used for creating delta updates?
Is Squirrel still used for Mac?
it only refers to the latest release in that channel?
Yes.
This is used for creating delta updates?
Delta is not yet supported. NSIS offers superb lzma compression.
Is Squirrel still used for Mac?
Yes. But special server will be not required soon.
Is the NSIS support available now? I'm thinking of building my app as an NSIS installer, but cannot use GitHub/Amazon S3/Bintray as a release provider due to network restrictions. It would be really helpful if electron-release-server is able to support NSIS auto update.
@wizcas Use any generic server and configure generic provider — https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts#GenericServerOptions
@develar just read about it. so all i need is:
- set up an http download server
- upload the yml
- config the 'path' field to the file's location
- and all good to go am i thinking it right?
@wizcas Yes, please see url docs. The base url. e.g. https://example.com/foo And latest.yml will be downloaded as result from https://example.com/foo/latest.yml
I don't understand what do you mean " 'path' field".
@develar sorry i was referring the path property of UpgateInfo class mentioned in one of the comments above. I havent built a release pack and check out the yml file yet. thought it was one of the yml configs😜 i'll make a build later and find out how it works in action.
thank you so much for the explanations and links!
I've once again been very busy so I haven't been able to put in the time to get anything done on this. That said, is it now the case that nothing special has to be added to the server for it to support the new electron-builder install system? @develar
@ArekSredzki users want to specify only release server url, but it is not supported. So issue is still actual.
Hi, I'm interested in modifying electron-release-server to provide auto update for NSIS installers. Although sha2 is an optional field I would like to include it, which library is used to compute the sha2 field?
@jmvallejo https://github.com/ArekSredzki/electron-release-server/blob/master/api/services/AssetService.js#L78 You should be able to take a similar approach to generating a sha2 hash rather than sha1
Thanks! I will create an /update/:platform/latest.yml and work with this
Awesome, thanks 👍
any progress on this?
Hi! Any progess on this?
interested in any progress on this too
Hello. Is there anyway to use it with NSIS for Windows update? Is it only support Squirrel.Windows with .nupkg?