electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.47k stars 1.72k forks source link

Drag and drop files doesn't work after package application #8292

Open Vromga opened 1 week ago

Vromga commented 1 week ago

Hi. Drag and drop files works during development (electronic), but does not work after packaging. Dragging a file from the explorer into the application causes a cancel sign to appear under the cursor. I tried setting the asar: false; flag. But it didn't help me either. The drop, dragenter and dragleave events do not emit any value at all. Has anyone encountered this problem and can give advice on how to get around it? p.s. I can't use electron-forge.

mmaietta commented 4 days ago

I found this through a quick google search.

This is not a problem with Electron, this is a Windows OS concept (Mandatory Integrity Control). If you run Electron from an administrator mode console, or any "Run as Administrator" process, then you try to drag&drop from a Windows Explorer instance (which can't run in administrator mode), then Drag & Drop, and many other capabilities, will not work. If I run my Electron app from a normal console with no administrator UAC elevation, I can drag and drop normally.

During development, I'm guessing you're not running as Admin, but does your app require elevated admin mode in production?