DwinsHs_Check function

The function adds a remote file to the DwinsHs_DwonloadsList download queue, the file will be downloaded when the DwinsHs_CurPageChanged procedure is executed (the Setup wizard moves to the pre-defined downloading wizard page). You can use the DwinsHs_AppendMirrorFile procedure to add one mirror source, or add multile mirror sources for the remote file in the BeforeDownlaod callback function of the DwinsHs_CurPageChanged procedure.

The function can be used as the value of "Check" parameter of entries in the "[Files]" section. When the "Components" or "Tasks" parameter exists in an entry, the remote file will be downloaded and installed if user selects a component or task from its "Components" or "Tasks" parameter value. Otherwise, the entry will be ignored, and the remote file will not be downloaded.

An entry without a "Components" or "Tasks" parameter is always processed, the remote file will be downloaded always if the DwinsHs_Check) function is used in its "Check" parameter, unless other parameters say it shouldn't be.

Note, the remote files which added by the DwinsHs_Check function will be installed automatically, you don't need to move them using the Pascal script in "[Code]" scetion.

If an entry has contained the "Check" parameter, and you want to download it from the remote server, please concatenate its value and the DwinsHs_Check function using the and operator. Note, please put the DwinsHs_Check function as the final item in the "Check" parameter, because the Inno Setup use short-circuit evaluation in the "Check" parameter.

Please add the external value to the Flags parameter of the file entry which download from remote server.


function DwinsHs_Check(Filename, URL, Agent, Method: string; FileSize, FileSizeHigh: LongInt): Boolean;



In order to conactenate the function and other check parameter values using the and operator, the function returns true always.



Source: "{tmp}\main.dll"; DestDir: "{app}"; Flags: external; \
  Check: DwinsHs_Check( ExpandConstant('{tmp}\main.dll'), 'http://domain.com/main.dll', \
  'My_Setup', 'Get', 0, 0 );

Source: "{tmp}\ext.dll"; DestDir: "{app}"; Flags: external; Components: ext_a ext_b; \
  Check: DwinsHs_Check( ExpandConstant('{tmp}\ext.dll'), 'http://domain.com/extension.dll', \
  'My_Setup', 'Get', 0, 0 );

Source: "{tmp}\abc.dll"; DestDir: "{app}\abc"; Flags: external; \
  Check: DirCheck(ExpandConstant('{app}\abc')) and \
  DwinsHs_Check( ExpandConstant('{tmp}\abc.dll'), 'http://domain.com/abc.dll', \
  'My_Setup', 'Get', 0, 0 );

Source: "{tmp}\a.exe"; DestDir: "{app}"; Flags: external; Tasks: install_a; \
  Check: DwinsHs_Check( ExpandConstant('{tmp}\a.exe'), 'http://domain.com/a.exe', \
  'My_Setup', 'Get', 0, 0 );



The function is avaliable only when the DwinsHs_Use_Predefined_Downloading_WizardPage marco is defined.