So I made a launcher/patcher for a game, where the launcher downloads files from a manifest and should add them to the current working folder.
When packaging the app as a portable and running it, the downloads are store in
%appdata%/local/temp
I’m trying to make the launcher download the files to the current folder, when running npm start
it works as intended, it downloads the files to the current working folder.
let getDirectory = path.dirname(data);
let getFileName = path.basename(data);
if (getDirectory === undefined) getDirectory = ".";
let request = needle.get(`${__PATCH_URL}${getDirectory}/${getFileName}`, {compressed: true}); // # Request data
let stream = fs.createWriteStream(`${getDirectory}\${getFileName}`); // # Write to directory
request.pipe(stream);