|
@@ -2,11 +2,10 @@
|
|
;
|
|
;
|
|
; This script shows how the CreateDownloadPage support function can be used to
|
|
; This script shows how the CreateDownloadPage support function can be used to
|
|
; download temporary files while showing the download progress to the user.
|
|
; download temporary files while showing the download progress to the user.
|
|
-; One of the files is a 7-Zip archive and the script shows how to extract it.
|
|
|
|
;
|
|
;
|
|
; To verify the downloaded files, this script shows two methods:
|
|
; To verify the downloaded files, this script shows two methods:
|
|
-; -For innosetup-latest.exe and MyProg-ExtraReadmes.7z: using the Inno Setup
|
|
|
|
-; Signature Tool, the [ISSigKeys] section, and the issigverify flag
|
|
|
|
|
|
+; -For innosetup-latest.exe: using the Inno Setup Signature Tool, the [ISSigKeys]
|
|
|
|
+; section, and the issigverify flag
|
|
; -For iscrypt.dll: using a simple SHA256 check
|
|
; -For iscrypt.dll: using a simple SHA256 check
|
|
; Using the Inno Setup Signature Tool has the benefit that the script does not
|
|
; Using the Inno Setup Signature Tool has the benefit that the script does not
|
|
; need to be changed when the downloaded file changes, so any installers built
|
|
; need to be changed when the downloaded file changes, so any installers built
|
|
@@ -27,18 +26,7 @@ Name: "mykey"; \
|
|
PublicX: "515dc7d6c16d4a46272ceb3d158c5630a96466ab4d948e72c2029d737c823097"; \
|
|
PublicX: "515dc7d6c16d4a46272ceb3d158c5630a96466ab4d948e72c2029d737c823097"; \
|
|
PublicY: "f3c21f6b5156c52a35f6f28016ee3e31a3ded60c325b81fb7b1f88c221081a61"
|
|
PublicY: "f3c21f6b5156c52a35f6f28016ee3e31a3ded60c325b81fb7b1f88c221081a61"
|
|
|
|
|
|
-// Uncomment the following line to use the 7-Zip library for extraction
|
|
|
|
-//#define USE7ZDLL
|
|
|
|
-// Please see the Init7ZipLibrary topic in the help file for more information
|
|
|
|
-//
|
|
|
|
-#ifdef USE7ZDLL
|
|
|
|
- #define _7ZDLL "7zxa.dll"
|
|
|
|
-#endif
|
|
|
|
-//
|
|
|
|
[Files]
|
|
[Files]
|
|
-#ifdef USE7ZDLL
|
|
|
|
-Source: "{#_7ZDLL}"; Flags: dontcopy
|
|
|
|
-#endif
|
|
|
|
; Place any regular files here
|
|
; Place any regular files here
|
|
Source: "MyProg.exe"; DestDir: "{app}";
|
|
Source: "MyProg.exe"; DestDir: "{app}";
|
|
Source: "MyProg.chm"; DestDir: "{app}";
|
|
Source: "MyProg.chm"; DestDir: "{app}";
|
|
@@ -46,7 +34,6 @@ Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme;
|
|
; These files will be downloaded
|
|
; These files will be downloaded
|
|
Source: "{tmp}\innosetup-latest.exe"; DestDir: "{app}"; Flags: external ignoreversion issigverify
|
|
Source: "{tmp}\innosetup-latest.exe"; DestDir: "{app}"; Flags: external ignoreversion issigverify
|
|
Source: "{tmp}\ISCrypt.dll"; DestDir: "{app}"; Flags: external ignoreversion
|
|
Source: "{tmp}\ISCrypt.dll"; DestDir: "{app}"; Flags: external ignoreversion
|
|
-Source: "{tmp}\MyProg-ExtraReadmes\*"; Excludes: "*.issig"; DestDir: "{app}"; Flags: external recursesubdirs ignoreversion issigverify
|
|
|
|
|
|
|
|
[Icons]
|
|
[Icons]
|
|
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
|
|
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
|
|
@@ -54,13 +41,11 @@ Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
|
|
[Code]
|
|
[Code]
|
|
var
|
|
var
|
|
DownloadPage: TDownloadWizardPage;
|
|
DownloadPage: TDownloadWizardPage;
|
|
- ExtractionPage: TExtractionWizardPage;
|
|
|
|
|
|
|
|
procedure InitializeWizard;
|
|
procedure InitializeWizard;
|
|
begin
|
|
begin
|
|
DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), nil);
|
|
DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), nil);
|
|
DownloadPage.ShowBaseNameInsteadOfUrl := True;
|
|
DownloadPage.ShowBaseNameInsteadOfUrl := True;
|
|
- ExtractionPage := CreateExtractionPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), nil);
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
function NextButtonClick(CurPageID: Integer): Boolean;
|
|
function NextButtonClick(CurPageID: Integer): Boolean;
|
|
@@ -71,7 +56,6 @@ begin
|
|
DownloadPage.Add('https://jrsoftware.org/download.php/is.exe?dontcount=1', 'innosetup-latest.exe', '');
|
|
DownloadPage.Add('https://jrsoftware.org/download.php/is.exe?dontcount=1', 'innosetup-latest.exe', '');
|
|
DownloadPage.Add('https://jrsoftware.org/download.php/is.exe.issig?dontcount=1', 'innosetup-latest.exe.issig', '');
|
|
DownloadPage.Add('https://jrsoftware.org/download.php/is.exe.issig?dontcount=1', 'innosetup-latest.exe.issig', '');
|
|
DownloadPage.Add('https://jrsoftware.org/download.php/iscrypt.dll?dontcount=1', 'ISCrypt.dll', '2f6294f9aa09f59a574b5dcd33be54e16b39377984f3d5658cda44950fa0f8fc');
|
|
DownloadPage.Add('https://jrsoftware.org/download.php/iscrypt.dll?dontcount=1', 'ISCrypt.dll', '2f6294f9aa09f59a574b5dcd33be54e16b39377984f3d5658cda44950fa0f8fc');
|
|
- DownloadPage.Add('https://jrsoftware.org/download.php/myprog-extrareadmes.7z?dontcount=1', 'MyProg-ExtraReadmes.7z', '');
|
|
|
|
DownloadPage.Show;
|
|
DownloadPage.Show;
|
|
try
|
|
try
|
|
try
|
|
try
|
|
@@ -88,38 +72,6 @@ begin
|
|
finally
|
|
finally
|
|
DownloadPage.Hide;
|
|
DownloadPage.Hide;
|
|
end;
|
|
end;
|
|
-
|
|
|
|
- if not Result then
|
|
|
|
- Exit;
|
|
|
|
-
|
|
|
|
- ExtractionPage.Clear;
|
|
|
|
- // Use AddEx to specify a password
|
|
|
|
- ExtractionPage.Add(ExpandConstant('{tmp}\MyProg-ExtraReadmes.7z'), ExpandConstant('{tmp}\MyProg-ExtraReadmes'), True);
|
|
|
|
- ExtractionPage.Show;
|
|
|
|
- try
|
|
|
|
- try
|
|
|
|
- #ifdef USE7ZDLL
|
|
|
|
- // Extract and initialize the 7-Zip library
|
|
|
|
- // This which will make the ExtractionPage switch from using Extract7ZipArchive to using ExtractArchive
|
|
|
|
- ExtractTemporaryFile('{#_7ZDLL}');
|
|
|
|
- Init7ZipLibrary(ExpandConstant('{tmp}\{#_7ZDLL}'));
|
|
|
|
- #endif
|
|
|
|
- // Extracts the archive to {tmp}\MyProg-ExtraReadmes
|
|
|
|
- // Please see the Extract7ZipArchive or ExtractArchive topic in the help file for limitations
|
|
|
|
- // Note that each file in the MyProg-ExtraReadmes.7z example archive comes with an .issig signature file
|
|
|
|
- // These signature files are used by the [Files] section to verify the archive's content
|
|
|
|
- ExtractionPage.Extract;
|
|
|
|
- Result := True;
|
|
|
|
- except
|
|
|
|
- if ExtractionPage.AbortedByUser then
|
|
|
|
- Log('Aborted by user.')
|
|
|
|
- else
|
|
|
|
- SuppressibleMsgBox(AddPeriod(GetExceptionMessage), mbCriticalError, MB_OK, IDOK);
|
|
|
|
- Result := False;
|
|
|
|
- end;
|
|
|
|
- finally
|
|
|
|
- ExtractionPage.Hide;
|
|
|
|
- end;
|
|
|
|
end else
|
|
end else
|
|
Result := True;
|
|
Result := True;
|
|
end;
|
|
end;
|