ArekSredzki / electron-release-server

A fully featured, self-hosted release server for electron applications, compatible with auto-updater.
MIT License
2.07k stars 546 forks source link

NSIS Support Documentation #87

Open SxMShaDoW opened 7 years ago

SxMShaDoW commented 7 years ago

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.

develar commented 7 years ago

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

SxMShaDoW commented 7 years ago

I guess this is more of a "modify documentation/provide use cases" suggestion. I will update the description.

SxMShaDoW commented 7 years ago

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?

Jflinchum commented 7 years ago

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.

develar commented 7 years ago

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

ArekSredzki commented 7 years ago

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

develar commented 7 years ago

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).

ArekSredzki commented 7 years ago

Thanks @develar Is there a way to use a SHA1 hash instead? I currently compute it on upload for use in the RELEASES file.

develar commented 7 years ago

sha2 is optional field. You can addsha1 field instead and it will be supported by electron-builder later.

ArekSredzki commented 7 years ago

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?

develar commented 7 years ago

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.

wizcas commented 7 years ago

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.

develar commented 7 years ago

@wizcas Use any generic server and configure generic provider — https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts#GenericServerOptions

wizcas commented 7 years ago

@develar just read about it. so all i need is:

develar commented 7 years ago

@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".

wizcas commented 7 years ago

@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!

ArekSredzki commented 7 years ago

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

develar commented 7 years ago

@ArekSredzki users want to specify only release server url, but it is not supported. So issue is still actual.

jmvallejo commented 7 years ago

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?

ArekSredzki commented 7 years ago

@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

jmvallejo commented 7 years ago

Thanks! I will create an /update/:platform/latest.yml and work with this

ArekSredzki commented 7 years ago

Awesome, thanks 👍

ghost commented 6 years ago

any progress on this?

pixel-fixer commented 4 years ago

Hi! Any progess on this?

Zhell1 commented 4 years ago

interested in any progress on this too

almas commented 3 years ago

Hello. Is there anyway to use it with NSIS for Windows update? Is it only support Squirrel.Windows with .nupkg?