{"action":"opened","issue":{"url":"https://api.github.com/repos/electron-userland/electron-builder/issues/946","repository_url":"https://api.github.com/repos/electron-userland/electron-builder","labels_url":"https://api.github.com/repos/electron-userland/electron-builder/issues/946/labels{/name}","comments_url":"https://api.github.com/repos/electron-userland/electron-builder/issues/946/comments","events_url":"https://api.github.com/repos/electron-userland/electron-builder/issues/946/events","html_url":"https://github.com/electron-userland/electron-builder/issues/946","id":192120985,"number":946,"title":"install with AutoUpdate in existing application","user":{"login":"Ludea","id":2116692,"avatar_url":"https://avatars.githubusercontent.com/u/2116692?v=3","gravatar_id":"","url":"https://api.github.com/users/Ludea","html_url":"https://github.com/Ludea","followers_url":"https://api.github.com/users/Ludea/followers","following_url":"https://api.github.com/users/Ludea/following{/other_user}","gists_url":"https://api.github.com/users/Ludea/gists{/gist_id}","starred_url":"https://api.github.com/users/Ludea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ludea/subscriptions","organizations_url":"https://api.github.com/users/Ludea/orgs","repos_url":"https://api.github.com/users/Ludea/repos","events_url":"https://api.github.com/users/Ludea/events{/privacy}","received_events_url":"https://api.github.com/users/Ludea/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-28T21:24:33Z","updated_at":"2016-11-28T21:24:33Z","closed_at":null,"body":"<!-- Which version of electron-builder are you using? -->\r\n* **Version**:  9.1\r\n\r\n<!-- What target are you building for? -->\r\n* **Target**:  Windows x64\r\n\r\n<!-- Enter your issue details below this comment. -->\r\nI can not integrate the AutoUpdate with my electron application.\r\n\r\nHere attached, I have this error with \"npm start\".\r\nI also add my package.json, tsconfig.js and update.ts\r\nI don't inderstant what happen. I start development, all works fine.\r\nI add electron-builder with autoupdate but it fails.\r\n\r\n![error](https://cloud.githubusercontent.com/assets/2116692/20686369/ab149f90-b5b8-11e6-8999-0e757b870caa.png)\r\n\r\npackage.json :\r\n`{\r\n  \"name\": \"Johnny-app\",\r\n  \"version\": \"0.0.1\",\r\n  \"description\": \"\",\r\n  \"main\": \"app.js\",\r\n  \"author\": \"Johnny\",\r\n  \"scripts\": {\r\n       \"start\": \"electron .\",\r\n       \"pack\": \"build --dir\",\r\n       \"dist\": \"build\"\r\n  },\r\n\r\n  \"build\": {\r\n  \"appId\": \"your.id\",\r\n  \"mac\": {\r\n    \"category\": \"your.app.category.type\"\r\n  },\r\n  \"win\": {\r\n    \"iconUrl\": \"(windows-only) https link to icon\"\r\n  }\r\n},\r\n\r\n  \"dependencies\": {\r\n    \"electron-auto-updater\": \"latest\"\r\n  },\r\n\r\n  \"devDependencies\": {\r\n    \"electron\": \"latest\",\r\n    \"electron-builder\": \"latest\",\r\n    \"typescript\" : \"^2.0.10\"\r\n  }\r\n}\r\n`\r\n\r\ntsconfig.json :\r\n`{\r\n  \"compilerOptions\":{\r\n  \"module\" : \"commonjs\",\r\n  \"target\" : \"es6\",\r\n  \"noImplicitAny\" : true,\r\n  \"removeContents\" : true,\r\n  \"outDir\" : \"out\",\r\n  \"newLine\" : \"LF\",\r\n  \"noResolve\" : true,\r\n  \"noEmitOnError\" : true,\r\n  \"inlineSources\" : true,\r\n  \"sourceMap\" : true,\r\n  \"noUnusedLocals\" : true\r\n},\r\n\"include\" : [\r\n  \"node_modules/electron-auto-updater/out/*.d.ts\" ,\r\n  \"src/*.ts\",\r\n  \"typings/**/*.d.ts\"\r\n  ],\r\n\"exclude\" :[\r\n  ]\r\n}`\r\n\r\n/js/update.ts\r\n`import {app, BrowserWindow as BrowserWindowElectron} from \"electron\";\r\nimport * as os from \"os\";\r\nimport {isDev, log} from \"./util\";\r\nimport {autoUpdater} from \"electron-auto-updater\";\r\nimport BrowserWindow = GitHubElectron.BrowserWindow\r\n\r\nconst UPDATE_SERVER_HOST = \"test.org\"\r\n\r\nexport default class AppUpdater {\r\nconstructor(window: BrowserWindow) {\r\n  if (isDev()) {\r\n    return\r\n  }\r\n\r\n  const platform = os.platform()\r\n  if (platform === \"linux\") {\r\n    return\r\n  }\r\n\r\n  const version = app.getVersion()\r\n  autoUpdater.addListener(\"update-available\", (event: any) => {\r\n    log(\"A new update is available\")\r\n  })\r\n  autoUpdater.addListener(\"update-downloaded\", (event: any, releaseNotes: string, releaseName: string, releaseDate: string, updateURL: string) => {\r\n    notify(\"A new update is ready to install\", `Version ${releaseName} is downloaded and will be automatically installed on Quit`)\r\n    log(\"quitAndInstall\")\r\n    autoUpdater.quitAndInstall()\r\n    return true\r\n\r\n  })\r\n  autoUpdater.addListener(\"error\", (error: any) => {\r\n    log(error)\r\n  })\r\n  autoUpdater.addListener(\"checking-for-update\", (event: any) => {\r\n    log(\"checking-for-update\")\r\n  })\r\n  autoUpdater.addListener(\"update-not-available\", () => {\r\n    log(\"update-not-available\")\r\n  })\r\n\r\n  if (platform === \"darwin\") {\r\n    autoUpdater.setFeedURL(`https://${UPDATE_SERVER_HOST}/update/${platform}_${os.arch()}/${version}`)\r\n  }\r\n\r\n  window.webContents.once(\"did-frame-finish-load\", (event: any) => {\r\n    autoUpdater.checkForUpdates()\r\n  })\r\n}\r\n}\r\n\r\nfunction notify(title: string, message: string) {\r\nlet windows = BrowserWindowElectron.getAllWindows()\r\nif (windows.length == 0) {\r\n  return\r\n}\r\n\r\nwindows[0].webContents.send(\"notify\", title, message)\r\n}\r\n\r\n`"}}
{"actor":{"display_login":"Ludea"}}