ENOENT: no such file or directory, open 'C:\Users\{windowsUser}\AppData\Local\Programs{appName}l\resources\app-update.yml'

76 Views Asked by At

An error occurs when I want to get a Windows update in my Electron.js application. When I examined the log records, I saw the following error message.

Error: ENOENT: no such file or directory, open 'C:\Users\{windowsUser}\AppData\Local\Programs\{appName}\resources\app-update.yml'

My application package json file is as follows. When I buy buildi nsis or msi it gives the same error.

{
   "version": "1.0.4",
   ...
   "dependencies": {
      ...
      "electron-updater": "^6.1.4",
      ...
   },
   "devDependencies": {
      ...
      "electron": "^26.2.1",
      "electron-builder": "^24.6.4",
      ...
   },
   "build": {
      ...
      "asar": true,
      "asarUnpack": "**\\*.{node,dll}",
      "publish": {
        "provider": "generic",
        "url": "appUpdateLink"
      },
      "afterSign": ".erb/scripts/notarize.js",
      "mac": {
         "target": {
           "target": "default",
           "arch": [
             "arm64",
             "x64"
           ]
         },
         "type": "distribution",
         "hardenedRuntime": true,
         "entitlements": "assets/entitlements.mac.plist",
         "entitlementsInherit": "assets/entitlements.mac.plist",
         "gatekeeperAssess": false
      },
      "dmg": {
         "contents": [
          {
            "x": 130,
            "y": 220
          },
          {
            "x": 410,
            "y": 220,
            "type": "link",
            "path": "/Applications"
          }
         ]
     },
     "win": {
        "target": [
          "msi"
        ]
     },
     "directories": {
        "app": "release/app",
        "buildResources": "assets",
        "output": "release/build"
     },
     "extraResources": [
        "./assets/**"
     ]
  },
  ...
}

I edited the feedUrl in the main.js file as follows.

autoUpdater.setFeedURL({
   provider: 'generic',
   channel:channel,
   url:feed,
});

Apart from this error, I also get the following blockmap error.

Cannot download differentially, fallback to full download: Error: Cannot parse blockmap "https://{appUpdateUrl}-1.0.4-full.nupkg.blockmap", error: Error: incorrect header check

how can i solve this problem.

0

There are 0 best solutions below