Take this script:
Source: "{tmp}\HelpDocSetup.exe"; \
DestDir: "{app}"; \
Flags: external deleteafterinstall; \
Tasks: downloadhelp; \
Check: DwinsHs_Check( ExpandConstant('{tmp}\HelpDocSetup.exe'), '{#HelpDocSetupURL}', 'My_Setup', 'Get', 0, 0 )
See the 0, 0 at the end of the line?
According to the documentation for DwinsHs_Check it states:
FileSize : LongInt
Together with the
FileSizeHighparameter specifies the file size in bytes. It will be used to calculate the download progress and remaining time. This avoids delays before the download begins because the script doesn't have to fetch the file size from the server.This parameter specifies the low 31 bits of the file size, and the
FileSizeHighparameter specifies the high 31 bits of the file size. Note, not 32 bits.Note, the file size will be fetched from the server if the parameter is set to
FILESIZE_QUERY_SERVER (0),FILESIZE_UNKNOWN (-1), orFILESIZE_KEEP_FORMER (-2). In this case, the value ofFileSizeparameter will be ignored.Note, only digital value can be used in this parameter, the constant identifier cannot be used.
FileSizeHigh: LongInt
Together with the
FileSizeparameter specifies the file size in bytes. It will be used to calculate the download progress and remaining time. This avoids delays before the download begins because the script doesn't have to fetch the file size from the server.This parameter specifies the high 31 bits of the file size, and the
FileSizeparameter specifies the low 31 bits of the file size.Note, the value of this parameter will be ignored if the FileSize parameter is set to
FILESIZE_QUERY_SERVER (0),FILESIZE_UNKNOWN (-1), orFILESIZE_KEEP_FORMER (-2).Note, only digital value can be used in this parameter, the constant identifier cannot be used.
This particular setup file is also on my computer. Relative to the main ISS file the path would be:
..\HelpNDoc\CHM\Output\PublicTalksHelpDocumentationSetup.exe
Can we use ISPP to extract the file size and split it as the two parameters required for DwinsHs_Check?
You can use
FileSizepreprocessor function to retrieve the file size. But it's limited to 2GB = 31 bits. What corresponds to theFileSizeargument ofDwinsHs_Check:If the file could theoretically be over 2GB, you would have to use other means to retrieve the file size – e.g. by calling PowerShell code with
Execpreprocessor function. And you should split the size into the two parts in the PowerShell (or other) code straight away, as the Inno Setup preprocessor cannot work with 64-bit numbers anyway.For examples of calling PowerShell code and returning its results, see: