Skip to content

Commit ce07589

Browse files
committed
Error handling on mod updater.
1 parent 47d6845 commit ce07589

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "modloader64-gui",
33
"productName": "modloader64-gui",
4-
"version": "1.1.53",
4+
"version": "1.1.55",
55
"description": "Play N64 mods the modern way!",
66
"license": "GPL",
77
"repository": {

resources/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"modloader64-gui","productName":"modloader64-gui","version":"1.1.53","description":"Play N64 mods the modern way!","license":"GPL","repository":{"type":"git","url":"git+https://github.com/hylianmodding/modloader64-gui.git"},"author":"denoflions <denvstheworld@gmail.com> (http://hylianmodding.com)","scripts":{"postinstall":"npx patch-package && electron-builder install-app-deps","build":"node ./resources.js && tsc && node ./fix_browser.js","start":"npm run build && electron ./app","start_debug":"electron ./app","pack":"npm run build && electron-builder --dir","dist":"npm run build && electron-builder --windows && electron-builder --linux","publish":"npm run bump && npm run dist","bump":"npm version --no-git-tag-version patch"},"dependencies":{"@types/discord-rpc":"^3.0.2","@types/fs-extra":"^8.1.0","adm-zip":"^0.4.16","ansi-to-html":"^0.6.14","buffer-json":"^2.0.0","deep-equal":"^2.0.3","discord-rpc":"^3.1.0","download-file":"^0.1.5","electron-context-menu":"0.16.0","electron-debug":"3.0.1","electron-store":"5.1.0","electron-unhandled":"3.0.2","electron-updater":"4.2.2","electron-util":"0.14.0","eventemitter2":"6.0.0","fs-extra":"^8.1.0","lzma":"^2.3.2","mkdir-recursive":"^0.4.0","node-fetch":"^2.6.1","recursive-readdir":"^2.2.2","request":"^2.88.2","slash":"^3.0.0","source-map-support":"^0.5.16"},"devDependencies":{"@types/adm-zip":"^0.4.33","@types/jquery":"^3.3.32","@types/request":"^2.48.4","copy-node-modules":"^1.1.1","electron":"8.2.4","electron-builder":"22.3.2","np":"^6.1.0","patch-package":"^6.2.0","typescript":"^3.7.5","xo":"^0.26.1"},"xo":{"envs":["node","browser"]},"np":{"publish":false,"releaseDraft":false},"bugs":{"url":"https://github.com/hylianmodding/modloader64-gui/issues"},"homepage":"https://github.com/hylianmodding/modloader64-gui#readme","main":"index.js","keywords":[]}
1+
{"name":"modloader64-gui","productName":"modloader64-gui","version":"1.1.55","description":"Play N64 mods the modern way!","license":"GPL","repository":{"type":"git","url":"git+https://github.com/hylianmodding/modloader64-gui.git"},"author":"denoflions <denvstheworld@gmail.com> (http://hylianmodding.com)","scripts":{"postinstall":"npx patch-package && electron-builder install-app-deps","build":"node ./resources.js && tsc && node ./fix_browser.js","start":"npm run build && electron ./app","start_debug":"electron ./app","pack":"npm run build && electron-builder --dir","dist":"npm run build && electron-builder --windows && electron-builder --linux","publish":"npm run bump && npm run dist","bump":"npm version --no-git-tag-version patch"},"dependencies":{"@types/discord-rpc":"^3.0.2","@types/fs-extra":"^8.1.0","adm-zip":"^0.4.16","ansi-to-html":"^0.6.14","buffer-json":"^2.0.0","deep-equal":"^2.0.3","discord-rpc":"^3.1.0","download-file":"^0.1.5","electron-context-menu":"0.16.0","electron-debug":"3.0.1","electron-store":"5.1.0","electron-unhandled":"3.0.2","electron-updater":"4.2.2","electron-util":"0.14.0","eventemitter2":"6.0.0","fs-extra":"^8.1.0","lzma":"^2.3.2","mkdir-recursive":"^0.4.0","node-fetch":"^2.6.1","recursive-readdir":"^2.2.2","request":"^2.88.2","slash":"^3.0.0","source-map-support":"^0.5.16"},"devDependencies":{"@types/adm-zip":"^0.4.33","@types/jquery":"^3.3.32","@types/request":"^2.48.4","copy-node-modules":"^1.1.1","electron":"8.2.4","electron-builder":"22.3.2","np":"^6.1.0","patch-package":"^6.2.0","typescript":"^3.7.5","xo":"^0.26.1"},"xo":{"envs":["node","browser"]},"np":{"publish":false,"releaseDraft":false},"bugs":{"url":"https://github.com/hylianmodding/modloader64-gui/issues"},"homepage":"https://github.com/hylianmodding/modloader64-gui#readme","main":"index.js","keywords":[]}

src/updatePlugins.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function runUpdateCheck(m: Buffer, download_dir: string, parse: path.ParsedPath,
4747
directory: download_dir,
4848
filename: path.basename(url.parse(j.url).pathname),
4949
};
50-
console.log(j);
50+
console.log(j.url);
5151
download(j.url, options, function (err: any) {
5252
try{
5353
if (err) throw err;
@@ -182,7 +182,12 @@ if (fs.existsSync('./ModLoader/mods')) {
182182
if (modPak.verify()) {
183183
for (let i = 0; i < modPak.pak.header.files.length; i++) {
184184
if (modPak.pak.header.files[i].filename.indexOf('package.json') > -1) {
185-
runUpdateCheck(modPak.load(i), download_dir, parse, cores_dir, mods_dir);
185+
try{
186+
runUpdateCheck(modPak.load(i), download_dir, parse, cores_dir, mods_dir);
187+
}catch(err){
188+
console.log(err);
189+
continue;
190+
}
186191
break;
187192
}
188193
}
@@ -195,7 +200,12 @@ if (fs.existsSync('./ModLoader/mods')) {
195200
let modPak: AdmZip = new AdmZip(file);
196201
modPak.getEntries().forEach((e: IZipEntry) => {
197202
if (e.name.indexOf('package.json') > -1) {
198-
runUpdateCheck(e.getData(), download_dir, parse, cores_dir, mods_dir);
203+
try{
204+
runUpdateCheck(e.getData(), download_dir, parse, cores_dir, mods_dir);
205+
}catch(err){
206+
console.log(err);
207+
return;
208+
}
199209
}
200210
});
201211
}

0 commit comments

Comments
 (0)