Search code examples
c#winformsdrag-and-dropnsis

Drag and drop not working after installing my program


I have a c# winforms app that I have written which uses drag and drop to accept files. Running it from Visual Studio works fine, and if I manually copy the files to a folder it has no problems. I have an installer script that I have created to package it for distribution using NSIS.

After installing to my own system using the installer, drag and drop does not work. Everything else about the app runs fine.

Is there some sort of security thing I might be missing here?


Solution

  • UAC UIPI blocks dragging from a low/medium IL process to a elevated process.

    The easy solution is to just disable the run checkbox on the finish page in your installer. This forces the user to start your app normally from the start menu.

    Another solution is to whitelist the drag messages to allow the drag operation.