vercel / hazel

Lightweight update server for Electron apps
https://twitter.com/notquiteleo/status/893547786255421441
MIT License
2.91k stars 385 forks source link

rizwan92 #0247 i am facing System.aggregate Exception 81513513 is notvalid string error while checking for update. #154

Open rizwan92 opened 2 years ago

rizwan92 commented 2 years ago

I have electron.js file

const path = require("path");
const { app, BrowserWindow, ipcMain, autoUpdater } = require("electron");
const isDev = require("electron-is-dev");

if (!isDev) {
  if (require("electron-squirrel-startup")) return app.quit();
}

const server = "https://random-server.com";
const updateUrl = `${server}/update/${process.platform}/${app.getVersion()}`;

autoUpdater.setFeedURL({ url: updateUrl });

if (!isDev) {
  setTimeout(() => {
    autoUpdater.checkForUpdates();
  }, 60000);
}

function createWindow() {
  const win = new BrowserWindow({
    width: 800,
    height: 600,
    icon: "desktop-icons/icon.png",
    webPreferences: {
      preload: path.join(__dirname, "preload.js"),
      nodeIntegration: false,
      contextIsolation: true,
      enableRemoteModule: false,
    },
  });

  win.loadURL(
    isDev
      ? "http://localhost:3001"
      : `file://${path.join(__dirname, "./index.html")}`
  );

}

and hazel server running in vercel fetching my release from github repostitory image is attched .

after 60 seconds i am facing an error image is attached i am usinf electron forge with gihub publish package to publish my release

module.exports = {
  packagerConfig: {
    icon: "desktop-icons/icon",
    name: "chikupos",
    appBundleId: "billing.chikupos.com",
    asar: true,
    hardenedRuntime: true,
  },
  makers: [
    {
      name: "@electron-forge/maker-squirrel",
      config: {
        iconUrl: "https://billing.chikupos.com/desktop-icons/icon.png",
        setupIcon: "desktop-icons/icon.ico",
      },
    },
    {
      name: "@electron-forge/maker-zip",
    },
  ],
  publishers: [
    {
      name: "@electron-forge/publisher-github",
      config: {
        repository: {
          owner: "myusernam",
          name: "my-repository",
        },
        authToken: "my token",
      },
    },
  ],
  buildIdentifier: "billing.chikupos.com",
};

Screenshot 2022-10-19 135834 image

rizwan92 commented 2 years ago

i am getting this logs at release path

directCache [ 'exe', 'dmg', 'rpm', 'deb', 'AppImage' ]
directCache [ 'exe', 'dmg', 'rpm', 'deb', 'AppImage' ]
Finished caching version 1.0.0
releases {
  version: '1.0.0',
  notes: null,
  pub_date: '2022-10-21T13:06:27Z',
  platforms: {
    exe: {
      name: 'chikupos-Setup-1.0.0.exe',
      api_url: 'https://api.github.com/repos/rizwan92/chikupos-software-update/releases/assets/81806373',
      url: 'https://github.com/rizwan92/chikupos-software-update/releases/download/1.0.0/chikupos-Setup-1.0.0.exe',
      content_type: 'application/octet-stream',
      size: 103
    }
  },
  files: {
    RELEASES: 'F2CCE1CA5E1E6060FBC2312E9A33DDC3598C034B https://api.github.com/repos/rizwan92/chikupos-software-update/releases/assets/81806374 101743115'
  }
}
sergeichestakov commented 1 year ago

I'm seeing the same thing. Looks like this is an issue when Squirrel.Windows tries to parse the release file. It seems that it's treating the URL as a local path to the nupkg and expecting a semver string which is not present in the download URL.

Did you end up finding a solution @rizwan92?

rizwan92 commented 1 year ago

you need to buy code signing certificates to make it work

sergeichestakov commented 1 year ago

Hmm our app is signed.

Anyways we ended up figuring it out - we just needed to update the download URL in the release file to end in the .nupkg filename, including the version, rather than a more generic link.