Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Managing extra-long number...


1 reply to this topic

gronchi

gronchi
  • Members
  • 71 posts

Posted 25 July 2002 - 12:46

Hi to all,
referring a previous post of mine (Ftp get file doesn't work under One-click install) I'm trying to go round the problem playing with other FtpGetFileA flags like:

#define INTERNET_FLAG_NEED_FILE         0x00000010
// need a file for this request
#define INTERNET_FLAG_RESYNCHRONIZE 0x00000800
// asking wininet to update an item if it is newer
#define INTERNET_FLAG_RELOAD             0x80000000
// retrieve the original item

That is:
Code Sample

FtpGetFileA(hFtp, sRemoteFileName, sLocalFileName, bFailIfExists, FILE_ATTRIBUTE_NORMAL, FTP_TRANSFER_TYPE_BINARY, 0)

will become (for example):
FtpGetFileA(hFtp, sRemoteFileName, sLocalFileName, bFailIfExists, FILE_ATTRIBUTE_NORMAL, (FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_RELOAD), 0)

It doesn't work because INTERNET_FLAG_RELOAD = 0x80000000 = 2.147.483.648 (2G)
InstallShield int = 4byte signed = (-2.147.483.648 =< n =< +2.147.483.647)
So that 0x80000000 = -2.147.483.648

Is there a way to go round this troublesome problem?

I know managing extra-long number in InstallShield script is a minor problem but I think it could repeat in the future.


Thanks.
Ciao, Giuseppe

gronchi

gronchi
  • Members
  • 71 posts

Posted 26 July 2002 - 07:17

maybe I make a mistake...

That is InstallShield call FtpGetFileA function with a field containing -2.147.483.648 (decimal with sign). The MS library which run the function (or right away the CPU) work in two-complement (I hope this is the correct word, I translate the italian "complemento a 2") so -2.147.483.648(d) --> 80000000(h) and
(FTP_TRANSFER_TYPE_BINARY | INTERNET_FLAG_RELOAD) = -2.147.483.648(d) +2(d) = -2.147.483.646(d) --> 80000002(h) which is exactly OR (bit-to-bit) of the two flag above defined.
Isn't it?