DownloadFiles.iss 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ; -- DownloadFiles.iss --
  2. ;
  3. ; This script demonstrates how to download files and archives, extract
  4. ; downloaded archives, and verify the integrity of downloaded files and
  5. ; archives, all without using [Code].
  6. ;
  7. ; To verify the downloaded files and archives, this script shows two methods:
  8. ; -For innosetup-latest.exe and MyProg-ExtraReadmes.7z: using Inno Setup
  9. ; Signature Tool and the [ISSigKeys] section
  10. ; -For iscrypt.dll: using a simple SHA-256 hash check
  11. ; Using the Inno Setup Signature Tool has the benefit that the script does not
  12. ; need to be changed when the downloaded file or archive changes, so any
  13. ; installers built will also keep working (they are "evergreen")
  14. [Setup]
  15. AppName=My Program
  16. AppVersion=1.5
  17. WizardStyle=modern
  18. DefaultDirName={autopf}\My Program
  19. DefaultGroupName=My Program
  20. UninstallDisplayIcon={app}\MyProg.exe
  21. OutputDir=userdocs:Inno Setup Examples Output
  22. ArchiveExtraction=full
  23. ;Use "ArchiveExtraction=enhanced" if all your archives are .7z files
  24. ;Use "ArchiveExtraction=enhanced/nopassword" if all your archives are not password-protected
  25. [ISSigKeys]
  26. Name: mykey; RuntimeID: def02; \
  27. KeyID: "def020edee3c4835fd54d85eff8b66d4d899b22a777353ca4a114b652e5e7a28"; \
  28. PublicX: "515dc7d6c16d4a46272ceb3d158c5630a96466ab4d948e72c2029d737c823097"; \
  29. PublicY: "f3c21f6b5156c52a35f6f28016ee3e31a3ded60c325b81fb7b1f88c221081a61"
  30. [Files]
  31. ; Place any regular files here
  32. Source: "MyProg.exe"; DestDir: "{app}"
  33. Source: "MyProg.chm"; DestDir: "{app}"
  34. Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
  35. ; These files will be downloaded and verified during the actual installation
  36. Source: "https://jrsoftware.org/download.php/is.exe?dontcount=1"; DestName: "innosetup-latest.exe"; DestDir: "{app}"; \
  37. ExternalSize: 7_000_000; Flags: external download ignoreversion issigverify
  38. Source: "https://jrsoftware.org/download.php/iscrypt.dll?dontcount=1"; DestName: "ISCrypt.dll"; DestDir: "{app}"; \
  39. Hash: "2f6294f9aa09f59a574b5dcd33be54e16b39377984f3d5658cda44950fa0f8fc"; \
  40. ExternalSize: 2560; Flags: external download ignoreversion
  41. ; This archive will be downloaded and verified at the start of the Preparing to Install Step
  42. ; It is then extracted normally during the actual installation process
  43. Source: "https://jrsoftware.org/download.php/myprog-extrareadmes.7z"; DestName: "MyProg-ExtraReadmes.7z"; DestDir: "{app}"; \
  44. ExternalSize: 275; Flags: external download extractarchive recursesubdirs ignoreversion issigverify
  45. ; This archive will be downloaded and extracted without verificaton
  46. Source: "https://github.com/jrsoftware/issrc/archive/refs/heads/main.zip"; DestName: "issrc-main.zip"; DestDir: "{app}"; \
  47. ExternalSize: 15_000_000; Flags: external download extractarchive recursesubdirs ignoreversion
  48. [Icons]
  49. Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"