electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.67k stars 1.74k forks source link

electron-builder not generating "latest.yml" file on Windows (NSIS) #925

Closed Zamiell closed 7 years ago

Zamiell commented 7 years ago

Rebuilding native production dependencies for arch x64 Packaging for win32 x64 using electron 1.4.7 to dist\win-unpacked Packaging NSIS installer for arch x64 Building NSIS installer


* **Main package.json**:

{ "name": "RacingPlus", "description": "A racing mod for The Binding of Isaac: Afterbirth+.", "scripts": { "start": "electron ./app", "postinstall": "install-app-deps", "pack": "build --dir", "dist": "build", }, "build": { "appId": "org.electron.isaacRacingClient", "win": {}, "publish": { "provider": "github" } }, "repository": { "type": "git", "url": "git+https://github.com/Zamiell/isaac-racing-client.git" }, "license": "GPL-3.0", "bugs": { "url": "https://github.com/Zamiell/isaac-racing-client/issues" }, "homepage": "https://isaacracing.net", "devDependencies": { "electron": "^1.4.7", "electron-builder": "^8.6.0" } }


* **App package.json (in app subdirectory)**:

{ "name": "RacingPlus", "productName": "Racing+", "main": "./main.js", "version": "0.0.1", "description": "A racing mod for The Binding of Isaac: Afterbirth+.", "author": "Racing+", "license": "GPL-3.0", "dependencies": { "electron-auto-updater": "^0.5.3", "electron-is-dev": "^0.1.2", "fs-extra": "^1.0.0", "keytar": "^3.0.2", "tail": "^1.2.1", "teeny-conf": "^1.0.1" } }



* **Node version**: v6.9.1
* **NPM version**: 3.10.8
* **OS**: Windows 7 x64 Professional

<!-- Enter your issue details below this comment. -->
After building my app, I get a `Racing+ Setup 0.0.1.exe` in my `dist` subfolder. This is all well and good. But shouldn't there be a `latest.yml` there too? I need to upload that file to my GitHub releases page in order for automatic updating to work. Where am I supposed to get the `latest.yml` file?
develar commented 7 years ago

I need to upload that file to my GitHub releases page in order for automatic updating to work

It will be uploaded automatically. Local file is not created.

(JFYI: Also, app-update.yml is not created, but will be created locally if app will be published).

So, please specify GH_TOKEN env and your app will be uploaded automatically.

develar commented 7 years ago

Please see https://github.com/electron-userland/electron-builder/wiki/Publishing-Artifacts#github-repository-and-bintray-package

Zamiell commented 7 years ago

Isn't that a bug though?

What if I DON'T want electron-builder to automatically publish releases to GitHub? What if I want to: 1) manage the release process myself manually, or 2) use a separate automated solution?

In both of these use cases, it would be handy for electron-builder to place a latest.yml in the dist subfolder alongside the generated installer exe file.

Otherwise the user is forced to write a small Python script or something to manually generate the latest.yml file, which is a little messy. Not to mention that the format of the latest.yml file isn't included in the documentation at all, to my knowledge.

develar commented 7 years ago

Isn't that a bug though?

Yes, it is bug. It the reason why issue was not closed. Should be addressed.

Zamiell commented 7 years ago

Ok, great. Thank you for your continued support develar. =)

develar commented 7 years ago

Both files should be generated regardless of publish state. I spent 20 minutes to understand why my local test app cannot be updated due to missed app-update.yml :)

scotttrinh commented 7 years ago

@develar Any progress on this? I'd be happy to jump in and help debug this if you're not already elbow-deep into fixing it.

develar commented 7 years ago

Fix requires deep understanding what electron-builder does and how. Some design decision should be made. In short: we cannot generate latest.yml for GitHub as file in the local fs for now due to special file escaping rules for Github releases. And I really don't want to introduce special folder in the dist for that, but I am going to try to avoid such escaping/transformation.

So, only I can fix this issue :(

scotttrinh commented 7 years ago

Just to be clear, this issue effects generic as well as github release targets, correct?

develar commented 7 years ago

No, only github.

kofno commented 7 years ago

It's only github? I'm not seeing the latest.yml being generated for generic releases.

UPDATE: Never mind... worked this time. No idea what I messed up before... sheesh. Keep up the good work!

develar commented 7 years ago

Solution "use product name everywhere and replace space to _" failed. Because GitHub doesn't allow unicode as well in the asset name.

develar commented 7 years ago

githubArtifactName is added to update info. So, the same file can be reused both for generic and GitHub providers.

Oscarato commented 7 years ago

Just add line on "package.json" "win": { "publish":[{"provider": "generic", "url": "your url (it could be localhost)"}] } and the "latest.yml" wil be generate

develar commented 7 years ago

@Oscarato ... only if you really use generic provider and not Github. otherwise you must not do it because GitHub url is different.

Oscarato commented 7 years ago

exactly....

obermillerk commented 7 years ago

I cannot get app-update.yml to be generated at all. Nor latest.yml for that matter but app-update is what's causing my updates to error out. How exactly am I supposed to make these generate? I'm trying to run a build with "publish" set in my package.json like so:

"build": {
  "appId": "com.my.app",
  "win": {
    "publish": {
      "provider": "generic",
      "url": "https://my.url"
    },
    "target": [
      "squirrel"
    ]
  }
  ...
}

I initially tried build -p never since I need to deploy it manually, but when this didn't work, I tried build -p always which still didn't work. I don't understand the need for this "publish" field, why can't I just configure it separately?

develar commented 7 years ago

@obermillerk https://www.electron.build/auto-update

Simplified auto-update is supported on Windows if you use the default NSIS target, but is not supported for Squirrel.Windows.

obermillerk commented 7 years ago

@develar so electron-updater is not usable with squirrel at all?

develar commented 7 years ago

@obermillerk Yes.

obermillerk commented 7 years ago

That is unfortunate... Also, the phrasing "Simplified auto-update" does not make it clear that the whole library is not usable with squirrel.

I assume it would be quite a chore adding support for squirrel? If it's something you've considered doing it would be greatly appreciated, as the built in autoUpdater is very limiting but I'm not sure that we would want to use NSIS.

develar commented 7 years ago

Squirrel.Windows is limited and no plans to support it. NSIS is feature-rich, proven and widely used solution.

obermillerk commented 7 years ago

Gonna switch over to NSIS. Thanks for all your work on this project, it's phenomenal.

develar commented 7 years ago

To make clear — Squirrel.Windows is limited in all aspects. User customizability, feature set, debugability. Not suitable for a lot of users. Our principle — do not reinvent the wheel. Nsis allows us to easily implement features/requests instead of writing yet another Windows installer tool. And a lot of users simply write own maintainable installer scripts without need to wait upstream.

Nantris commented 6 years ago

I'm seeing this issue in Electron Builder starting with (I think) v19.47.x on Windows 7 x64.

I see a blockmap file, but no longer a yml.

Nantris commented 6 years ago

I'm seeing this issue again with electron-builder@20.8.1

I haven't been able to build for a while, so I can't say with any level of precision where this began to occur again, but in version between 19.47.x and now, it had been working properly. I'm using NSIS on Windows with Electron 1.8.4.

Thoughts?

mifi commented 2 years ago

Also seeing this issue in 22.14.5

https://github.com/mifi/lossless-cut/issues/621 https://github.com/mifi/lossless-cut/releases/tag/v3.39.0

DekCode commented 2 years ago

Just add line on "package.json" "win": { "publish":[{"provider": "generic", "url": "your url (it could be localhost)"}] } and the "latest.yml" wil be generate

This helps me fix the issue. Correction, it's

"win": { "publish": { "provider": "generic", "url": "localhost"} }