[SOLVED] Download Scripting Function

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

[SOLVED] Download Scripting Function

Post 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.
Last edited by Enternal on 16 Apr 2013 02:28, edited 1 time in total.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Download Scripting Function

Post by Marco »

Better late than never, uh? :D
Can you reproduce this bug with a fresh install?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: Download Scripting Function

Post 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.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Download Scripting Function

Post 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?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: Download Scripting Function

Post 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.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Download Scripting Function

Post 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.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: Download Scripting Function

Post 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.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Download Scripting Function

Post by Marco »

They're different both at the beginning and at the end?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: Download Scripting Function

Post 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.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Download Scripting Function

Post by Marco »

We better wait for Don's opinion then...
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: Download Scripting Function

Post 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.

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Download Scripting Function

Post by admin »

The download is corrupted when locale is set to Japanese?

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: Download Scripting Function

Post 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.

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Download Scripting Function

Post by admin »

OK, should be fixed in next version.

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Download Scripting Function

Post by admin »

Better now?

Post Reply