Skip to content

build linux deb APP can not produce latest.yml file #4704

@leejaygo

Description

@leejaygo

"electron-builder": "21.2.0",
"electron-updater": "4.2.0"

build for deb app

some piece code in electron-builder.json
"linux": {
"icon": "img/",
{
"target": "deb",
"arch": ["x64"]
}],
"category": "System",
"publish": [
{
"provider":"generic",
"url":"http://xxx.xxx.xxx.xx:1053/linux/",
"channel": "latest"
}
]
}
i can create deb app, but it can not create latest.yml file, so i can not update app. so which produce this problem, the config problem of other problem?

ps:when target is AppImage, it can create latest.yml. but change target to deb can not create latest.yml。in my project, i just need to build deb app。Recently, i read the source code and find the solution on the internet, it seem like, when build deb app, it can not create latest.yml,so what should i do to config or other methods?

Activity

kzimny

kzimny commented on Feb 26, 2020

@kzimny

As explained in documentation the target on Linux should be set to AppImage. Did you already try to build with this option? I'm not familiar with Linux, I only read the note in the documentation. The latest.yml should be generated then.

Sednaoui

Sednaoui commented on Feb 26, 2020

@Sednaoui

In my case, I have my Linux target as AppImage, and it is still not generating neither latest-linux.yml nor app-update.yml. I am using a plain HTTP server. I tried to follow a workaround by adding a publish options specified for the build target (Linux) based on one of the comments, but it did not work for me.

I am using electron-builder: 20.39.0

#2736

kzimny

kzimny commented on Feb 26, 2020

@kzimny

did you try to add the publish options with channel?

        "publish": {
            "provider": "generic",
            "url": "https://www.mywebsite.com/software/${os}",
            "channel": "latest-xyz"
        },
Sednaoui

Sednaoui commented on Feb 26, 2020

@Sednaoui

I did. I still have the same error message on my console:

"Error: Error: Cannot find channel "latest-linux.yml" update info: HttpError: 404 Not Found"

Update: I switched my machine to a mac from Linux and it generated all my latest files and app-updates, expect for the app-update.yml for Linux. It seems there is a problem generating the files for Linux.

leejaygo

leejaygo commented on Feb 27, 2020

@leejaygo
Author

As explained in documentation the target on Linux should be set to AppImage. Did you already try to build with this option? I'm not familiar with Linux, I only read the note in the documentation. The latest.yml should be generated then.

leejaygo

leejaygo commented on Feb 27, 2020

@leejaygo
Author

ps:when target is AppImage, it can create latest.yml. but change target to deb can not create latest.yml。in my project, i just need to build deb app。Recently, i read the source code and find the solution on the internet, it seem like, when build deb app, it can not create latest.yml,so what should i do to config or other methods?

Sednaoui

Sednaoui commented on Feb 27, 2020

@Sednaoui

@leejaygo does it create the app-update.yml file in your resources folder for AppImage linux?

kzimny

kzimny commented on Feb 27, 2020

@kzimny

why in ressources folder? .yml is created in output directory defined in the build section of packege.json file.

        "directories": {
            "output": "build"
        },
Sednaoui

Sednaoui commented on Feb 27, 2020

@Sednaoui

I meant the resources folder in each target OS: linux-unpacked, win-unpacked, mac. In both mac and win-unpacked, I have a resource folder with app-update.yml inside, but not linux-unpacked.

I still don't know why it is not generated automatically. For now, I added a script that copies app-update.yml from win and add it to linux since it is the same file

stale

stale commented on Apr 27, 2020

@stale

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

starhu521

starhu521 commented on Mar 5, 2021

@starhu521

ps:when target is AppImage, it can create latest.yml. but change target to deb can not create latest.yml。in my project, i just need to build deb app。Recently, i read the source code and find the solution on the internet, it seem like, when build deb app, it can not create latest.yml,so what should i do to config or other methods?

hello, I have the same problem. It can't generate yml when set the target is deb for linux. In addition, I can't download when I set the target is AppImage. I got this error: #5678 (comment)

And I don't have any problems when target is nsis for windows.

mmaietta

mmaietta commented on Mar 5, 2021

@mmaietta
Collaborator

I was under the impression that the publish latest.yml was only generated for supported targets:

Auto-updatable Targets
macOS: DMG.
Linux: AppImage.
Windows: NSIS.

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

starhu521

starhu521 commented on Mar 6, 2021

@starhu521

I was under the impression that the publish latest.yml was only generated for supported targets:

Auto-updatable Targets
macOS: DMG.
Linux: AppImage.
Windows: NSIS.

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

Maybe, I just think those targets are default when I read the doc. Thanks.

kroko

kroko commented on May 4, 2021

@kroko

Actually having app-update.yml in non AppImage targets would be helpful nonetheless.

Auto-update still looks for it under resources/app-update.yml if .checkForUpdates() is called in non AppImage cases (say, deb).

Currently it would fail of course with

checkForUpdates Error {"errno":-2,"code":"ENOENT","syscall":"open","path":"/opt/my-app-name/resources/app-update.yml"}

I mean, the logic for looking for app-update.yml is already there, it is not like electron-updater internally does not look for it once .checkForUpdates() is called if platform is nixlike and process.env.APPIMAGE is not present.

If such file existed package users could still utilise .checkForUpdates() and on update-available receive message - 'hey, update available, i just cannot auto update - you have to do it by yourself'. that would be helpful from user experience standpoint.

Of course, some extra steps would be needed on non AppImage if app-update.yml was generated, that is - never try to actually download and install, just notify. So developer has to take care of it and assure something along these lines before first .checkForUpdates() is called

    // if GNU and not AppImage do not auto update, but try informing user that updates available when 'update-available' arrives
    if (platformIsNixlike() && !process.env.APPIMAGE) {
      autoUpdater.autoDownload = false;
      autoUpdater.autoInstallOnAppQuit = false;
      this.#manualUpdateFeedback = true;
    }

// ...

    // ----------------------------------------
    // Emitted when there is an available update. The update is downloaded automatically if autoDownload is true.
    autoUpdater.on('update-available', (info) => {
      // if this was originated by daemon tick and user on non-updatable
      if (this.#manualUpdateFeedback) {
        ElectronDialog.showMessageBox(
          null,
          {
            type: 'info',
            title: 'Update is available',
            message: 'New AppName version is available',
            detail: `Although version ${info.version} is available unfortunately AppName cannot self autoupdate as you are not using AppImage. As most probably you are using packages update has to be executed using packages.`,
            buttons: [
              'OK'
            ]
          })
          .then((respObj) => {
          })
          .catch((error) => {
            wlUpdater.error('error in message box for update-available', error?.name, error);
          });
      }

      // ...
    });
aymengraoui

aymengraoui commented on Aug 1, 2022

@aymengraoui

any news about this issue ? :(

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @kroko@mmaietta@Sednaoui@leejaygo@aymengraoui

        Issue actions

          build linux deb APP can not produce latest.yml file · Issue #4704 · electron-userland/electron-builder