Electron-packager: Unable to delete output folder via Finder when tmpdir=true

Created on 21 May 2016  路  12Comments  路  Source: electron/electron-packager

When packaging an app on OS X (v10.11.4) using the default settings for out and tmpdir, the resulting [product name]-darwin-x64 output folder cannot be deleted via Finder. When attempting to delete it, Finder asks for an admin password, but then fails with a permissions error message. However, the folder appears to be properly owned and accessible to me, and I can delete it just fine via terminal with normal user privileges.

I discovered that if I use the --tmpdir=false option, I can delete the output folder just fine, so this issue seems to be related to the fs.move call in moveApp of common.js (so maybe it's actually a problem with fs-extra?). It's certainly not a major issue, but I'm curious to know what's causing it! Any ideas?

Which version of electron-packager are you using?

7.0.2

What CLI arguments are you passing? Alternatively, if you are using the API, what parameters are
you passing to the packager() function?

electron-packager . product-name --platform=darwin --arch=x64 --osx-sign.identity="[signing identity]" --ignore="[regex galore]" --download.strictSSL=true --icon design/icon.icns

What version of Electron are you building with?

1.0.2

What is the host platform are you running electron-packager on?

OS X El Capitan v10.11.4 (15E65)

What target platform(s)/architecture(s) are you building for?

--platform=darwin --arch=x64

Is there a stack trace in the error message you're seeing?

N/A

Please provide either a failing testcase or detailed steps to reproduce your problem.

  1. Package an application without specifying the out or tmpdir flags
  2. Attempt to delete the resulting output folder via Finder
blocked bug build-host

Most helpful comment

This was super demotivating, thanks a lot for your analysis @giilby --tmpdir=false seems like a good solution

Whenever something like this happens on OSX, it triggers my paranoia, hope this gets solved and others don't experience the same thing too, just wasted 45 minutes in anxiety until I found this issue

All 12 comments

fs-extra author here and electron-packager user...

when attempting to delete it, Finder asks for an admin password, but then fails with a permissions error message. However, the folder appears to be properly owned and accessible to me, and I can delete it just fine via terminal with normal user privileges.

I experience this same thing, although I never attributed it to fs-extra, but it's certainly possible. I just have not taken the time to look into it. Seems weird to me that it can be deleted in the console but not the finder. Also works to delete any top level folder.

I'm happy to make the necessary fixes.

This was super demotivating, thanks a lot for your analysis @giilby --tmpdir=false seems like a good solution

Whenever something like this happens on OSX, it triggers my paranoia, hope this gets solved and others don't experience the same thing too, just wasted 45 minutes in anxiety until I found this issue

Just for posterity, someone else will need to debug this, as I don't own a Mac and my knowledge of OSX is limited.

It would be interesting to know if it happens on OSX 10.10 or earlier, or, for that matter, the new macOS.

I can confirm that this is still happening in MacOS 10.12 Sierra.

Symptoms seem to be the same as @giilby described.

Files can be deleted using rm -r app-darwein-x64. just not through the finder GUI.

_Edit:_ Not sure if it is helpful but I noticed that if I delete the folder in sublime that I get a prompt that says 'There is no trash bin so this will be permanently deleted' which is different to any other folder I try to delete which has a typical 'do you want to delete?' prompt.

Any updates on this? Error happening for me on Mac OSX 10.11 (El Capitan). I can't delete through finder or command line. I might be stuck with this folder forever 馃樄

Unfortunately, the first paragraph of my last comment is still true. Still looking for a member of the community to debug this for me.

Same problem here, MacOS Sierra 10.12.3. Can only remove the folder using bruteforce
sudo rm -rf [foldername]

Could we please refrain from "me too" comments? Please use the issue reactions on the issue summary instead, so that there are less (email) notifications generated.

@malept @jprichardson Hi, I'm new to electron and have this problem as well. Let me know if there's thing I can look into to fix this. I'm willing to make PR

Problem is present on Windows 10 when tmpdir=false. The issue is pretty relevant because I cannot delete the file even as an administrator, or via the command line. Still trying to figure out how I can gain permission to the generated .exe file....

Edit: I was able to delete the file by using unlocker. It was unable to delete the file so it asked if it should try to delete it when the computer is restarted. It must have done that, as the file was gone after the reboot.

The upstream bug seems to have been fixed in fs-extra 6, which was released with Electron Packager 13.

Was this page helpful?
0 / 5 - 0 ratings