packager: Cannot unzip files on Windows due to UAC rules
ENOENT: no such file or directory, rename ‘C:\Users\aasmunds\AppData\Local\Temp\electron-packager\win32-x64\stox-win32-x64\electron.exe’ -> ‘C:\Users<user>\AppData\Local\Temp\electron-packager\win32-x64\stox-win32-x64\stox.exe’
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! stox@1.0.0 package-win: electron-packager . <appname> --platform win32 --arch x64 --out dist/ --overwrite
npm ERR! Exit status 1
npm ERR!
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 21 (8 by maintainers)
using electron packager 14.0.0, than it crashed. had to downgrade to 13.1.1 then it worked fine. thanks package “main”: “index.js”, “scripts”: { “start”: “electron .”, “package-win”: “electron-packager . stox --platform win32 --arch x64 --out dist/ --overwrite --asar”,
From: Mark Lee [mailto:notifications@github.com] Sent: 01 July 2019 15:40 To: electron-userland/electron-packager electron-packager@noreply.github.com Cc: Skålevik, Åsmund aasmund.skaalevik@hi.no; Author author@noreply.github.com Subject: Re: [electron-userland/electron-packager] ENOENT error in 14.0.0 (#1024)
Thanks for filing an issue! In order to help you with your problem, we’re going to need more information about it. In particular:
· Operating System (Platform and Version) e.g. macOS 10.13.6 / Windows 10 (1803) / Ubuntu 18.04 x64
· Last Known Working Electron Packager version (if applicable) e.g. 11.0.0
· Console output when you run electron-packager with the environment variable DEBUG=electron-packager (instructions for Windowshttps://github.com/visionmedia/debug#windows-command-prompt-notes and non-Windowshttps://en.wikipedia.org/wiki/Environment_variable#Unix). Please include the stack trace if one exists.
· What does your package.json file look like?
· Please provide either a failing minimal testcase (with code) or detailed steps to reproduce your problem. Using electron-quick-starthttps://github.com/electron/electron-quick-start is a good starting point.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/electron-userland/electron-packager/issues/1024?email_source=notifications&email_token=ACWW3K7AYAEA45SEA2IEFYLP5ICKLA5CNFSM4H4RSAMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODY6E5HQ#issuecomment-507268766, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACWW3K34IWMG5CVZOWMVZHTP5ICKLANCNFSM4H4RSAMA.
I played a bit with cross-zip (similar to what you did in your unzip.js) , and yes it may be prevented by the UAC. The Event viewer log shows that %OSDRIVE%\USERS<user>\APPDATA\LOCAL\TEMP__PSSCRIPTPOLICYTEST_S5NE442K.JV4.PSM1 was prevented from running. Maybe it is a wrong postscript policy in the UAC management.
const zip = require(‘cross-zip’) const { promisify } = require(‘util’) const unzip = promisify(zip.unzip) let zipPath = ‘C:\Users\aasmunds\AppData\Local\electron\Cache\httpsgithub.comelectronelectronreleasesdownloadv7.1.2electron-v7.1.2-win32-x64.zip\electron-v7.1.2-win32-x64.zip’; let targetDir = ‘C:\Users\aasmunds\AppData\Local\Temp\electron-packager\win32-x64-template’; unzip(zipPath, targetDir);