0
votes

I have a compiled program which runs great after being compressed, copied to another computer using a USB key, extracted and ran.

However, if I upload the compressed file to Google Drive or Dropbox, download it and extract it, the program will not run. It gives me an error "program.exe has stopped working".

Using a tool called WinMerge, I compared the program that was extracted from a USB drive with the program that was extracted after being downloaded. Every file, both binary and text, was identical.

Next I used attrib -r -a -s -h on every program file in both folders, thinking perhaps one of the file attributes was incorrect. I still had the same problem; the copied program works, the downloaded one does not.

I also tried changing the name and location of the folders the program was in but it had no effect.

The only thing I can think of is some additional attribute that Windows gives files which were downloaded from the internet, to possibly trigger an additional UAC check which is interfering with the program. Does this exist?

This is on Windows 7.

1
What happens if you right-click and go to the properties of the file? Does it say something about being downloaded? - Ewoud
Nothing seems out of the ordinary other than an initial "Security: This file came from another computer and might be blocked to help protect this computer". Choosing Unblock removes this dialog, but the downloaded program will still not run. - K. Standeven
And if you put the downloaded file in the USB drive after downloading, does it run then? - Ewoud

1 Answers

1
votes

Found the problem. Windows adds an Alternate Data Stream (ADS) to every file downloaded off the internet. For some reason, these streams were preventing the program from running. Stripping the ADS from each file allows it to run.

I used a Windows Sysinternals program called Streams to strip the ADS data.