Use the pre-defined downloading wizard page

In the dwinshs.iss script, a pre-defined downloading wizard page can be used by you. Please follow the steps below to use it:

  1. Prepartory step:

    Copy the file dwinshs.iss to your installation script folder or a sub-folder in it.

  2. Include the "dwinshs.iss" file in the "[Code]" section:

    Please define the DwinsHs_Use_Predefined_Downloading_WizardPage macro, then include the dwinshs.iss file at the beginning of the "[Code]" section. If the file is placed in the sub-folder of your installation scripts folder, please add path of the sub-folder in order to locate it. For exampe:

    [Code]
    #define DwinsHs_Use_Predefined_Downloading_WizardPage
    ......
    #include "dwinshs.iss"
    ......

    In the pre-defined downloading wizard page, the "Next" button will be disabled during downloading. It will be enabled when download completed, you can click on it to move to next wizard page. By define the DwinsHs_Auto_Continue macro before including the dwinshs.iss file, the Setup wizard will move to next wizard page automatically when download completed. For exampe:

    [Code]
    #define DwinsHs_Use_Predefined_Downloading_WizardPage
    ......
    #define DwinsHs_Auto_Continue
    ......
    #include "dwinshs.iss"
    ......

    If you want to use the DwinsHs_RemoveAllRemoteFiles and DwinsHs_ResetAllRemoteFiles procedures, or the DwinsHs_RemoveRemoteFile, DwinsHs_ResetRemoteFile, and DwinsHs_RemoteFilesCount functions, please define corresponding macros before including the dwinshs.iss file: DwinsHs_Use_RemoveAllRemoteFiles, DwinsHs_Use_ResetAllRemoteFiles, DwinsHs_Use_RemoveRemoteFile, DwinsHs_Use_ResetRemoteFile, and DwinsHs_Use_RemoteFilesCount. For example:

    [Code]
    #define DwinsHs_Use_Predefined_Downloading_WizardPage
    ......
    #define DwinsHs_Use_RemoveAllRemoteFiles
    #define DwinsHs_Use_ResetAllRemoteFiles
    #define DwinsHs_Use_RemoveRemoteFile
    #define DwinsHs_Use_ResetRemoteFile
    #define DwinsHs_Use_RemoteFilesCount
    ......
    #include "dwinshs.iss"
    ......

    Optional, you can specify the size of read buffer by defining the macro DwinsHs_Data_Buffer_Length before including the dwinshs.iss file. By default, it's 4096 bytes. For example:

    [Code]
    #define DwinsHs_Use_Predefined_Downloading_WizardPage
    ......
    #define DwinsHs_Data_Buffer_Length 8192
    ......
    #include "dwinshs.iss"
    ......

  3. Add "Check" parameter for each remote file in the "[Files]" section:

    In the "[Files]" section, please add a "Check" parameter for each remote file which will be downloaded from remote server, and use the DwinsHs_check function as its value, in order to append them into the DwinsHs_DwonloadsList download queue. Also, please add the external value to the Flags parameter of the file entry. For example:

    [Files]
    ...

    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}\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 );

    ...

    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. For example:

    [Files]
    ...

    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 );

    ...

  4. Change the "[Code]" section:

  5. Create custom messages for each language in the "[CustomMessages]" section:

    If you want to create a multilingual installation package, please use the [Languages] section defines the languages to make available to it. See also the Inno Setup Help document. For example:

    [Languages]
    Name: "en"; MessagesFile: "compiler:Default.isl"
    Name: "fr"; MessagesFile: "compiler:Languages\French.isl"

    Then translate the following messages for every language, and add them into the [CustomMessages] section. Note, in the dwinsHs.iss script, the default custom messages are defined for the pre-defined downloading wizard page (it's written in English, so the English messages isn't required). In the multilingual installation package, for every language, if you don't define the custom messages for the pre-defined downloading wizard page, the default custom messages will be used.

    DwinsHs_PageCaption =Downloading additional files
    DwinsHs_PageDescription =Please wait while setup downloads additional files...
    DwinsHs_TotalProgress =Total progress:
    DwinsHs_CurrentFile =Current file:
    DwinsHs_File =File:
    DwinsHs_Speed =Speed:
    DwinsHs_Status =Status:
    DwinsHs_ElapsedTime =Elapsed time:
    DwinsHs_RemainingTime =Remaining time:
    DwinsHs_Status_ButtonRetry =&Retry
    DwinsHs_Status_ButtonNext =&Next >
    DwinsHs_SizeInBytes =%d Bytes
    DwinsHs_SizeInKB =%.2f KB
    DwinsHs_SizeInMB =%.2f MB
    DwinsHs_ProgressValue = %s of %s (%d%%%)
    DwinsHs_SpeedInBytes =%d Byte/s
    DwinsHs_SpeedInKB =%.2f KB/s
    DwinsHs_SpeedInMB =%.2f MB/s
    DwinsHs_TimeInHour = %d hour(s), %d minute(s), %d second(s)
    DwinsHs_TimeInMinute = %d minute(s), %d second(s)
    DwinsHs_TimeInSecond = %d second(s)
    DwinsHs_Status_GetFileInformation =Fetch file size
    DwinsHs_Status_StartingDownload =Starting download
    DwinsHs_Status_Downloading =Downloading
    DwinsHs_Status_DownlaodComplete =Download complete
    DwinsHs_Error_Network =No active Internet connection
    DwinsHs_Error_Offline =The computer is in offline mode
    DwinsHs_Error_Initialize =Failed to initialize the setup
    DwinsHs_Error_OpenSession =Failed to open the FTP or HTTP session
    DwinsHs_Error_CreateRequest =Failed to create an HTTP request handle
    DwinsHs_Error_SendRequest =Failed to send request to the HTTP server
    DwinsHs_Error_DeleteFile =The old file cannot be deleted
    DwinsHs_Error_SaveFile =Failed to save data
    DwinsHs_Error_Canceled =Download canceled
    DwinsHs_Error_ReadData =Failed to read data
    DwinsHs_Status_HTTPError =HTTP error %d: %s
    DwinsHs_Status_HTTP400 =Bad request
    DwinsHs_Status_HTTP401 =Unauthorized
    DwinsHs_Status_HTTP404 =Not found
    DwinsHs_Status_HTTP407 =Proxy authentication required
    DwinsHs_Status_HTTP500 =Internal error
    DwinsHs_Status_HTTP502 =Bad gateway
    DwinsHs_Status_HTTP503 =Service unavailable
    DwinsHs_Status_HTTPxxx =Other error

    For example, add the following messages to support the French and Chinese:

    [CustomMessages]
    ; French custom messages for pre-defined downloading wizard page
    fr.DwinsHs_PageCaption =Le téléchargement de fichiers supplémentaires
    fr.DwinsHs_PageDescription =Se il vous plaît patienter pendant configuration \
    télécharge des fichiers supplémentaires...

    fr.DwinsHs_TotalProgress =Cours Total:
    ...

    ; Chinese custom messages for pre-defined downloading wizard page
    chs.DwinsHs_PageCaption =下载附加文件
    chs.DwinsHs_PageDescription =请稍等,正在下载必需的远程文件......
    chs.DwinsHs_TotalProgress =总进度:
    ...

    If the English messages are not required, or you want to define your own default custom messages in your script, you can define the DwinsHs_Disable_Custom_Messages macro before including the dwinshs.iss file to disabled the default custom messages in the dwinsHs.iss script. Optional, you can define your own default custom messages in your script. For example:

    [CustomMessages]
    ; French custom messages for pre-defined downloading wizard page
    fr.DwinsHs_PageCaption =Le téléchargement de fichiers supplémentaires
    fr.DwinsHs_PageDescription =Se il vous plaît patienter pendant configuration \
    télécharge des fichiers supplémentaires...

    fr.DwinsHs_TotalProgress =Cours Total:
    ...

    ; Chinese custom messages for pre-defined downloading wizard page
    chs.DwinsHs_PageCaption =下载附加文件
    chs.DwinsHs_PageDescription =请稍等,正在下载必需的远程文件......
    chs.DwinsHs_TotalProgress =总进度:
    ...

    ; Optional, define your own default custom messages for pre-defined downloading wizard page
    ; Here is in German

    DwinsHs_PageCaption =Herunterladen zusätzlicher Dateien
    DwinsHs_PageDescription =Bitte warten Sie, während Setup zusätzliche Dateien herunter ...
    DwinsHs_TotalProgress =Gesamtfortschritt:
    ...

    [Code]
    #define DwinsHs_Use_Predefined_Downloading_WizardPage
    ...
    #define DwinsHs_Disable_Custom_Messages
    ...
    #include "dwinshs.iss"
    ...

    Note, if you don't disable the default custom messages, please define your custom messages after the "[Code]" section which the dwinshs.iss file is included in it.

  6. Congratulations!

    Compile your setup script and watch the download wizard page at work! If it doesn't work, please add a link to our website in your web page, then contact us and send your link page to us.