Skip to content
⌘ NSIS Forum Archive

Inetc plugin shows negative download percentage for large 3GB file

16 posts

inst-user#

Inetc plugin shows negative download percentage for large 3GB file

Using the Inetc plugin to download a large 3GB file and it displays a negative percent download (so the progress bar doesn't move).

Any help?
T.Slappy#
Originally Posted by inst-user View Post
Is there any way I could fix this?
You need to modify the sources and rebuild the library.
inst-user#
I'm kind of new to NSIS and I don't know a lot about C++ coding for editing the source file. Is there anyone who can help me with this?

Inetc Plugin: http://nsis.sourceforge.net/Inetc_plug-in

Thanks!
LoRd_MuldeR#
Here is quick fix. Size above 4 GB will still cause problem, no matter what. Take this with a grain of salt!
inst-user#
Originally Posted by LoRd_MuldeR View Post
Here is quick fix. Size above 4 GB will still cause problem, no matter what. Take this with a grain of salt!
When I use this it still seems to give me a percentage far above 100 (it starts off with a 7 digit percentage) and the progress bar doesn't move. In fact it counts down from that number to 100% and then completes. Do you know what the fix for this is? Thanks!
inst-user#
Originally Posted by LoRd_MuldeR View Post
Can you share the download link to the 3 GB file, so I can actually give it a try?
I'm sorry I can't share the link to the file; however, I'm pretty sure theres a way to create a test file any size you want. It explains it here: http://tweaks.com/windows/62755/gene...es-in-windows/

Thanks🙂
LoRd_MuldeR#
Creating a 3 GB file locally is easy, but doesn't help for testing inetc. I would either have to upload it to a web-server (but who has 3 GB of web-space? also uploading 3 GB would take ages) or setup a web-server on my local machine. I will look into the latter option tonight...
Anders#
Just grab a copy of the free Visual Studio ISO, a Linux distro or something else that is big? To do it locally you could use HFS, Baby web server, analogx sswww or one of the other free basic web servers...
LoRd_MuldeR#
Originally Posted by Anders View Post
Just grab a copy of the free Visual Studio ISO, a Linux distro or something else that is big? To do it locally you could use HFS, Baby web server, analogx sswww or one of the other free basic web servers...
I'd need to find an ISO that is larger than 2 GB, but still below 4 GB. Should be pretty doable, though.

For local WWW server, I have been using XAMPP before...
LoRd_MuldeR#
Okay, here is another attempt 😉

In previous version, the code was still using MulDiv(), which is signed. Unfortunately, there is no unsigned version of that function. So I had to implement my own UMulDiv() function. But then the linker failed with missing reference to __aulldiv(). Apparently a 64-Bit integer division in 32-Bit code requires CRT library calls - which isn't possible when the CRT is excluded from the binary, as in Inetc project. Bummer!

(In the end I had to add a custom __aulldiv() implementation to the Inetc project, as assembly code. Seems to work though)
Anders#
You could use inline assembly but there has to be a better way. Not sure if WinInet is limited to 4gb but if it is you can just set the progressbar range to filesize/2 and the pos to downloaded/2?
inst-user#
Originally Posted by LoRd_MuldeR View Post
Okay, here is another attempt 😉

In previous version, the code was still using MulDiv(), which is signed. Unfortunately, there is no unsigned version of that function. So I had to implement my own UMulDiv() function. But then the linker failed with missing reference to __aulldiv(). Apparently a 64-Bit integer division in 32-Bit code requires CRT library calls - which isn't possible when the CRT is excluded from the binary, as in Inetc project. Bummer!

(In the end I had to add a custom __aulldiv() implementation to the Inetc project, as assembly code. Seems to work though)
It works!! Thank you 🙂