Page 1 of 2
[SOLVED] Download Scripting Function
Posted: 27 Feb 2013 09:26
by Enternal
I have been "using" Marco's SimpleUpdater script for quite some time now. However I never used it for its intended function and mainly used it to read changelog without the need to open a browser. The reason is because the actual update never works so I have been assuming that it's my problem and just been ignoring it. However today I got a little bit annoyed with it and why it never works and started looking through Marco's script. I then realized that for some reason, the zip file that it downloaded has always been corrupted every time which lead to failure to unzip and hence, the update fails. I then explicitly tested:
::download "
http://xyplorer.com/download/xyplorer_f ... nstall.zip", "<xydata>\XYplorer.zip"
and once again the file is corrupted. I also tried testing other zip files for other programs to make sure it's not an issue with the server and I got the same corrupted zip file for CDBurnerXP and some others.
I started testing all this because I have been using wget, 7za.exe (7-zip console executable), and a batch file to do the entire update process to update XYplorer to the latest stable version. But I really wanted to ability to update to beta too if I want to try it out using SimpleUpdate.
Re: Download Scripting Function
Posted: 27 Feb 2013 10:25
by Marco
Better late than never, uh?

Can you reproduce this bug with a fresh install?
Re: Download Scripting Function
Posted: 27 Feb 2013 10:29
by Enternal
Yep! Haha. I know it's a bit odd not to use your script for it's intended purpose but I still found it really useful but in a different way hahaha.
And yes, I was able to reproduce it even with a fresh install.
Re: Download Scripting Function
Posted: 27 Feb 2013 10:32
by Marco
Any firewall/antivirus/hips that may get in the way of XY downloads?
Can you describe how the files are corrupted? Do they miss some final bytes perhaps?
Re: Download Scripting Function
Posted: 27 Feb 2013 10:47
by Enternal
No AV or anything is getting in the way. I have made sure that they're all disabled when I tested as well. The error I'm getting if I'm using WinRAR is: "Unexpected end of archive"
and the file is invalid if using Windows built in zip capability. If based on WinRAR, then it probably is missing something at the end of the file. I probably going to have to use a couple more tools to find the difference between the corrupted file and the actual file then.
By the sound of it, it seems like you're not encountering the problem? So it really is my problem only then? For me, it occurs on all my computers so I thought that it could not be me when I did all those tests.
Edit: Putting it through a hex editor, everything is different besides the header. This is quite interesting I would say.
Re: Download Scripting Function
Posted: 27 Feb 2013 10:54
by Marco
Nope, everything works smoothly here, and have been doing so for as long as I can remember.
You don't need special tools maybe to find the difference. Try downloading a file from XY and then from your browser. Then see if their file size are different.
Re: Download Scripting Function
Posted: 27 Feb 2013 10:57
by Enternal
Ah so it really is just me. Darn haha.
The size were exactly the same (it's the first thing I tried). However when I look at the finally internally using a hex editor, they are different. I could have used a hash finder instead which would have been quicker. Anyway using a hasher, the hashes are different. So the file is definitely different.
Re: Download Scripting Function
Posted: 27 Feb 2013 10:59
by Marco
They're different both at the beginning and at the end?
Re: Download Scripting Function
Posted: 27 Feb 2013 11:02
by Enternal
They're exactly the same near the beginning but slightly in after, they're completely different. Everything seems to end up being messed up.
Re: Download Scripting Function
Posted: 27 Feb 2013 11:04
by Marco
We better wait for Don's opinion then...
Re: Download Scripting Function
Posted: 27 Feb 2013 11:06
by Enternal
I also noticed that it only messes up binary type files such as images, archives, executable, and such. Text files like plain old text files and html pages work fine.
EDIT: I take that back. It screws up text files as well. Especially those that have different character encoding.
EDIT2: Yeah I guess we should wait to see what Don has to say as well. This is an interesting problem then.
EDIT3: Aha! I found the issue. I had a hunch and it turns out to be correct. I noticed it once I found out that downloading text files with different character encoding did not work (in my case I was downloading text files with UTF-8). The issue was I have my system "Language for non-Unicode Program" set to Japanese or Korean. Once I switch back to English, the Download command work perfectly.
Don, haha I guess once you get your hand on a Visual Basic compiler that can compile in Unicode and 64Bit, most of your problems related to this will probably be solved.
Re: Download Scripting Function
Posted: 28 Feb 2013 19:51
by admin
The download is corrupted when locale is set to Japanese?
Re: Download Scripting Function
Posted: 28 Feb 2013 22:11
by Enternal
Not just Japanese. I also had a computer in Korean that had the same issue. Once I changed both computers back to English, the download works perfectly.
Also to note is that the corruption is the same each time BUT different between the locales. Basically when my system is set to Japanese, the file is corrupted but when opened in WinRAR, I can see the first two files every download. When I have it on Korean, the corruption is now different in that I cannot see anything. It's really interesting to see. Somehow the locale changes how the Download command works which is odd since I think the download command should be independent of locale but somehow it's not.
Re: Download Scripting Function
Posted: 01 Mar 2013 09:16
by admin
OK, should be fixed in next version.
Re: Download Scripting Function
Posted: 01 Mar 2013 18:29
by admin
Better now?