0

I have created a project within VB.net, which downloads an .exe from my DropBox. When I manually download, the .exe it runs perfectly, however when I download it through my VB project, it comes up with the error:

EDIT:

"Unsupported 16-bit Application:"

"The program or feature cannot start or run due to incompatibility with 64-bit versions of Windows"

This is the code I use to automatically download the .exe:

My.Computer.Network.DownloadFile("[FILE LINK]", "[FILE DIRECTORY]")

The .exe downloaded through the VB.net project is only 155 bytes, whereas the actual .exe should be around 120 KB.

Why does the file become incompatible when downloaded through my VB.net project?

Community
  • 1
  • 1
SPIDERS _
  • 1
  • 2
  • Did you Google that error message? – jmcilhinney Nov 17 '15 at 03:59
  • Yes, most solutions suggest asking the software vendor for a 64-bit version, however I am the software vendor (as I created the .exe file). Yet I do however know it is not a problem with the actual .exe itself (since it runs perfectly fine when manually downloaded), but rather when it's downloaded through the vb.net project. – SPIDERS _ Nov 17 '15 at 04:11
  • At the moment, the 'Target CPU' of the .exe being downloaded is x86, I will play around with this and see if anything changes. – SPIDERS _ Nov 17 '15 at 04:14
  • Changing the 'Target CPU' did not change anything. – SPIDERS _ Nov 17 '15 at 04:29
  • Are you running the exe immediately following the download? Are you using Process.Start(), or running it by double-clicking? It is possible that the file writing is not complete and/or the file is locked at the moment you are attempting to run it. – vbnet3d Nov 17 '15 at 14:32
  • Are the files the same size from both downloads? Do you have some error handling around the `DownloadFile` code. You might be getting an error (like not supplying credentials) and ending up with a 1KB file instead of the full file. – Steve Nov 17 '15 at 15:53
  • @Steve, yes I just checked and the file sizes are different. The manually downoaded .exe is 243 KB, whereas the one downloaded through vb.net is 155 bytes. This is a significant difference. How would figuring out if an error is occurring in `DownloadFile`? – SPIDERS _ Nov 17 '15 at 22:16
  • I also began researching into `ICredentials` for the `DownloadFile` code, but this seems like super foreign territory for me. If anyone has had experience with this, could you please guide me. – SPIDERS _ Nov 17 '15 at 22:48
  • I have never downloaded from DropBox but maybe you should try this instead: http://stackoverflow.com/questions/16368233/download-public-file-from-dropbox-using-vb-net – Steve Nov 18 '15 at 00:01
  • @Steve that didn't seem to work either. I believe I have narrowed down the issue. When the VB.net project is downloading the file, it creates an empty .exe and inserts the link of the .exe into it. This can be further proven where I replaced the '.exe' extension within the download path with a '.txt' extension. The result was a text file with the following text: _302 Found The resource was found at https://dl.dropboxusercontent.com/s/e4489iyw2f4zy1o/TAC%20Gameplay.exe; you should be redirected automatically._ – SPIDERS _ Nov 18 '15 at 00:31
  • Sounds like an issue with the `[FILE LINK]` not pointing to the right place. – Steve Nov 18 '15 at 15:07
  • It appears that is the problem. Maybe I should test out other sites to download the .exe from – SPIDERS _ Nov 19 '15 at 21:21

0 Answers0