From 0b3cdfb3d31c18d94bd54634239deabc28e0597e Mon Sep 17 00:00:00 2001 From: 0neGal Date: Sun, 4 Feb 2024 23:28:36 +0100 Subject: removed use of "vipertmp" folder Previously we downloaded the Northstar archive and packages to a folder named "vipertmp" in the system's cache folder, now that's just moved into "Viper/Temp" (still inside the system's cache folder) With this, all Viper cache is stored in the same folder in the system's cache folder... Wait... Why wasn't it always like this? Oh right, my past stupidity and lack of foresight. Oh well. "vipertmp" still gets deleted when clearing install cache, along with the new folder, so doing so will by itself clean up the old folder. --- src/modules/mods.js | 2 +- src/modules/packages.js | 2 +- src/modules/settings.js | 2 +- src/modules/update.js | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/mods.js b/src/modules/mods.js index 97d4e16..9e3e81e 100644 --- a/src/modules/mods.js +++ b/src/modules/mods.js @@ -597,7 +597,7 @@ mods.installFromURL = (url, author) => { // download mod to a temporary location https.get(url, (res) => { - let tmp = path.join(app.getPath("cache"), "vipertmp"); + let tmp = path.join(app.getPath("userData"), "Temp"); let modlocation = path.join(tmp, "/mod.zip"); // make sure the temporary folder exists diff --git a/src/modules/packages.js b/src/modules/packages.js index fca0a44..d690824 100644 --- a/src/modules/packages.js +++ b/src/modules/packages.js @@ -333,7 +333,7 @@ packages.download = async (url, name) => { return new Promise((resolve) => { // download mod to a temporary location https.get(url, (res) => { - let tmp = path.join(app.getPath("cache"), "vipertmp"); + let tmp = path.join(app.getPath("userData"), "Temp"); let zip_name = name || "package"; let zip_path = path.join(tmp, `${zip_name}.zip`); diff --git a/src/modules/settings.js b/src/modules/settings.js index 5449570..d513ec9 100644 --- a/src/modules/settings.js +++ b/src/modules/settings.js @@ -68,7 +68,7 @@ if (fs.existsSync("viper.json")) { ...settings, ...conf } - settings.zip = path.join(app.getPath("cache"), "vipertmp/northstar.zip"); + settings.zip = path.join(app.getPath("userData"), "Temp/northstar.zip"); let args = path.join(settings.gamepath, "ns_startup_args.txt"); if (! settings.nsargs && fs.existsSync(args)) { diff --git a/src/modules/update.js b/src/modules/update.js index 3def83b..7140fcd 100644 --- a/src/modules/update.js +++ b/src/modules/update.js @@ -22,6 +22,7 @@ let update = {}; ipcMain.on("delete-install-cache", () => { let delete_dirs = [ + path.join(app.getPath("userData"), "Temp"), path.join(app.getPath("cache"), "vipertmp"), path.join(settings().gamepath, "northstar.zip") ] -- cgit v1.2.3