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

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

Closed
Zamiell opened this issue Nov 19, 2016 · 28 comments · May be fixed by qcif/data-curator#563
Closed

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

Zamiell opened this issue Nov 19, 2016 · 28 comments · May be fixed by qcif/data-curator#563

Comments

@Zamiell
Copy link

Zamiell commented Nov 19, 2016

  • Version: 8.6.0
  • Target: win32 x64

  • Build command:
    npm run dist --python="C:/Python27/python.exe"

  • Console output:

> RacingPlus@ dist2 D:\Repositories\isaac-racing-client
> build --publish always

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

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
Copy link
Member

develar commented Nov 19, 2016

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.

@Zamiell
Copy link
Author

Zamiell commented Nov 19, 2016

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
Copy link
Member

develar commented Nov 19, 2016

Isn't that a bug though?

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

@Zamiell
Copy link
Author

Zamiell commented Nov 19, 2016

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

@develar
Copy link
Member

develar commented Nov 19, 2016

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
Copy link

@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
Copy link
Member

develar commented Dec 6, 2016

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
Copy link

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

@develar
Copy link
Member

develar commented Dec 7, 2016

No, only github.

@kofno
Copy link

kofno commented Dec 23, 2016

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
Copy link
Member

develar commented Jan 5, 2017

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

develar added a commit to develar/electron-builder that referenced this issue Jan 5, 2017
develar added a commit to develar/electron-builder that referenced this issue Jan 5, 2017
@develar
Copy link
Member

develar commented Jan 5, 2017

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

develar added a commit to develar/electron-builder that referenced this issue Jan 5, 2017
develar added a commit to develar/electron-builder that referenced this issue Jan 5, 2017
develar added a commit to develar/electron-builder that referenced this issue Jan 5, 2017
develar added a commit to develar/electron-builder that referenced this issue Jan 5, 2017
@develar develar closed this as completed in 0f1fc4d Jan 5, 2017
@Oscarato
Copy link

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
Copy link
Member

develar commented Feb 23, 2017

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

@Oscarato
Copy link

Oscarato commented Mar 8, 2017

exactly....

@obermillerk
Copy link

obermillerk commented Oct 11, 2017

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
Copy link
Member

develar commented Oct 12, 2017

@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
Copy link

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

@develar
Copy link
Member

develar commented Oct 12, 2017

@obermillerk Yes.

@obermillerk
Copy link

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
Copy link
Member

develar commented Oct 12, 2017

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

@obermillerk
Copy link

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

@develar
Copy link
Member

develar commented Oct 12, 2017

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
Copy link

Nantris commented Dec 19, 2017

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
Copy link

Nantris commented Apr 3, 2018

I'm seeing this issue again with [email protected]

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
Copy link
Contributor

mifi commented Jan 15, 2022

Also seeing this issue in 22.14.5

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

@DekCode
Copy link

DekCode commented Jul 26, 2022

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"} }

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

Successfully merging a pull request may close this issue.

9 participants