idf_tool_setup.iss 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. ; Copyright 2019-2021 Espressif Systems (Shanghai) CO LTD
  2. ; SPDX-License-Identifier: Apache-2.0
  3. #pragma include __INCLUDE__ + ";" + ReadReg(HKLM, "Software\Mitrich Software\Inno Download Plugin", "InstallDir")
  4. #include <idp.iss>
  5. #define MyAppName "ESP-IDF Tools"
  6. #define MyAppVersion "2.5"
  7. #define MyAppPublisher "Espressif Systems (Shanghai) Co. Ltd."
  8. #define MyAppURL "https://github.com/espressif/esp-idf"
  9. #ifndef PYTHONVERSION
  10. #define PYTHONVERSION "3.8.7"
  11. #endif
  12. #define PythonInstallerName "idf-python-" + PYTHONVERSION + "-embed-win64.zip"
  13. #define PythonInstallerDownloadURL "https://dl.espressif.com/dl/idf-python/idf-python-" + PYTHONVERSION + "-embed-win64.zip"
  14. #ifndef GITVERSION
  15. #define GITVERSION "2.30.0.2"
  16. #endif
  17. ; The URL where git is stored is not equal to it's version. Minor build has prefixes with windows
  18. #ifndef GITVERSIONDIR
  19. #define GITVERSIONDIR "v2.30.0.windows.2"
  20. #endif
  21. #define GitInstallerName "Git-" + GITVERSION + "-64-bit.exe"
  22. #define GitInstallerDownloadURL "https://github.com/git-for-windows/git/releases/download/" + GITVERSIONDIR + "/Git-" + GITVERSION + "-64-bit.exe"
  23. #define IDFVersionsURL "https://dl.espressif.com/dl/esp-idf/idf_versions.txt"
  24. #define IDFCmdExeShortcutDescription "Open ESP-IDF Command Prompt (cmd.exe) Environment"
  25. #define IDFCmdExeShortcutFile "ESP-IDF Command Prompt (cmd.exe).lnk"
  26. #define IDFPsShortcutDescription "Open ESP-IDF PowerShell Environment"
  27. #define IDFPsShortcutFile "ESP-IDF PowerShell.lnk"
  28. ; List of default values
  29. ; Default values can be set by command-line option when startig installer
  30. ; or it can be stored in .INI file which can be passed to installer by /CONFIG=[PATH].
  31. ; Code for evaluating configuration is in the file configuration.inc.iss.
  32. #ifndef COMPRESSION
  33. #define COMPRESSION = 'lzma';
  34. #endif
  35. ; In case of large installer set it to 'no' to avoid problem delay during starting installer
  36. ; In case of 1 GB installer it could be 30+ seconds just to start installer.
  37. #ifndef SOLIDCOMPRESSION
  38. #define SOLIDCOMPRESSION = 'yes';
  39. #endif
  40. ; Offline installation specific options
  41. #ifndef OFFLINE
  42. #define OFFLINE = 'no';
  43. #endif
  44. #ifndef PYTHONWHEELSVERSION
  45. #define PYTHONWHEELSVERSION = '3.8-2021-01-21'
  46. #endif
  47. [Setup]
  48. ; NOTE: The value of AppId uniquely identifies this application.
  49. ; Do not use the same AppId value in installers for other applications.
  50. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  51. AppId={{9E068D99-5C4B-4E5F-96A3-B17CF291E6BD}
  52. AppName={#MyAppName}
  53. AppVersion={#MyAppVersion}
  54. AppVerName={#MyAppName} {#MyAppVersion}
  55. AppPublisher={#MyAppPublisher}
  56. AppPublisherURL={#MyAppURL}
  57. AppSupportURL={#MyAppURL}
  58. AppUpdatesURL={#MyAppURL}
  59. DefaultDirName={%USERPROFILE}\.espressif
  60. UsePreviousAppDir=no
  61. DirExistsWarning=no
  62. DefaultGroupName=ESP-IDF
  63. DisableProgramGroupPage=yes
  64. OutputBaseFilename=esp-idf-tools-setup-unsigned
  65. Compression={#COMPRESSION}
  66. SolidCompression={#SOLIDCOMPRESSION}
  67. ArchitecturesAllowed=x64
  68. ArchitecturesInstallIn64BitMode=x64
  69. LicenseFile=license.txt
  70. PrivilegesRequired=lowest
  71. SetupLogging=yes
  72. ChangesEnvironment=yes
  73. WizardStyle=modern
  74. ; https://jrsoftware.org/ishelp/index.php?topic=setup_touchdate
  75. ; Default values are set to 'no' which might result in files that are installed on the machine
  76. ; in the 'future'. This creates a problem for Ninja/CMake which may end up in a neverending loop.
  77. ; Setting this flag to 'yes' should avoid the problem.
  78. TimeStampsInUTC=yes
  79. [Languages]
  80. Name: "english"; MessagesFile: "compiler:Default.isl,Languages/idf_tool_en-US.islu"
  81. [Dirs]
  82. Name: "{app}\dist"
  83. [Files]
  84. Source: "configuration.ini"; Flags: dontcopy noencryption
  85. Source: "cmdlinerunner\build\cmdlinerunner.dll"; Flags: dontcopy
  86. Source: "unzip\7za.exe"; Flags: dontcopy
  87. Source: "idf_versions.txt"; Flags: dontcopy
  88. Source: "..\..\idf_tools.py"; DestDir: "{app}"; DestName: "idf_tools_fallback.py"
  89. ; Note: this tools.json matches the requirements of IDF v3.x versions.
  90. Source: "tools_fallback.json"; DestDir: "{app}"; DestName: "tools_fallback.json"
  91. Source: "idf_cmd_init.bat"; DestDir: "{app}"
  92. Source: "idf_cmd_init.ps1"; DestDir: "{app}"
  93. Source: "dist\*"; DestDir: "{app}\dist"; Flags: skipifsourcedoesntexist;
  94. ; esp-idf-bundle - bundle only in case it exists, it's used only in offline installer
  95. Source: "releases\esp-idf-bundle\*"; DestDir: "{code:GetIDFPath}"; Flags: recursesubdirs skipifsourcedoesntexist;
  96. Source: "tools\idf-python\*"; DestDir: "{app}\tools\idf-python\"; Flags: recursesubdirs;
  97. Source: "tools\idf-python-wheels\*"; DestDir: "{app}\tools\idf-python-wheels\"; Flags: recursesubdirs skipifsourcedoesntexist;
  98. ; Helper Python files for sanity check of Python environment - used by system_check_page
  99. Source: "system_check\system_check_download.py"; Flags: dontcopy
  100. Source: "system_check\system_check_subprocess.py"; Flags: dontcopy
  101. Source: "system_check\system_check_virtualenv.py"; Flags: dontcopy
  102. ; Helper PowerShell scripts for managing exceptions in Windows Defender
  103. Source: "tools_WD_excl.ps1"; DestDir: "{app}\dist"
  104. Source: "tools_WD_clean.ps1"; DestDir: "{app}\dist"
  105. [UninstallDelete]
  106. Type: filesandordirs; Name: "{app}\dist"
  107. Type: filesandordirs; Name: "{app}\releases"
  108. Type: filesandordirs; Name: "{app}\tools"
  109. Type: filesandordirs; Name: "{app}\python_env"
  110. Type: files; Name: "{group}\{#IDFCmdExeShortcutFile}"
  111. Type: files; Name: "{group}\{#IDFPsShortcutFile}"
  112. Type: files; Name: "{autodesktop}\{#IDFCmdExeShortcutFile}"
  113. Type: files; Name: "{autodesktop}\{#IDFPsShortcutFile}"
  114. [Tasks]
  115. Name: CreateLinkStartPowerShell; GroupDescription: "{cm:CreateShortcutPowerShell}"; Description: "{cm:CreateShortcutStartMenu}";
  116. Name: CreateLinkDeskPowerShell; GroupDescription: "{cm:CreateShortcutPowerShell}"; Description: "{cm:CreateShortcutDesktop}";
  117. Name: CreateLinkStartCmd; GroupDescription: "{cm:CreateShortcutCMD}"; Description: "{cm:CreateShortcutStartMenu}";
  118. Name: CreateLinkDeskCmd; GroupDescription: "{cm:CreateShortcutCMD}"; Description: "{cm:CreateShortcutDesktop}";
  119. ; Optimization for Online mode
  120. Name: UseMirror; GroupDescription:"{cm:OptimizationTitle}"; Description: "{cm:OptimizationDownloadMirror}"; Flags: unchecked; Check: IsOnlineMode
  121. [Run]
  122. Filename: "{app}\dist\{#GitInstallerName}"; Parameters: "/silent /tasks="""" /norestart"; Description: "Installing Git"; Check: GitInstallRequired
  123. Filename: "{group}\{#IDFPsShortcutFile}"; Flags: postinstall shellexec unchecked; Description: "Run ESP-IDF PowerShell Environment"; Check: IsPowerShellInstalled
  124. Filename: "{group}\{#IDFCmdExeShortcutFile}"; Flags: postinstall shellexec unchecked; Description: "Run ESP-IDF Command Prompt Environment"; Check: IsCmdInstalled
  125. ; WD registration checkbox is identified by 'Windows Defender' substring anywhere in its caption, not by the position index in WizardForm.TasksList.Items
  126. ; Please, keep this in mind when making changes to the item's description - WD checkbox is to be disabled on systems without the Windows Defender installed
  127. Filename: "powershell"; Parameters: "-ExecutionPolicy ByPass -File ""{app}\dist\tools_WD_excl.ps1"" -AddExclPath ""{app}\*.exe"""; Flags: postinstall shellexec runhidden; Description: "{cm:OptimizationWindowsDefender}"; Check: GetIsWindowsDefenderEnabled
  128. [UninstallRun]
  129. Filename: "powershell.exe"; \
  130. Parameters: "-ExecutionPolicy Bypass -File ""{app}\dist\tools_WD_clean.ps1"" -RmExclPath ""{app}"""; \
  131. WorkingDir: {app}; Flags: runhidden
  132. [Registry]
  133. Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "IDF_TOOLS_PATH"; \
  134. ValueData: "{app}"; Flags: preservestringtype createvalueifdoesntexist uninsdeletevalue deletevalue;
  135. [Code]
  136. #include "configuration.iss.inc"
  137. #include "utils.iss.inc"
  138. #include "choice_page.iss.inc"
  139. #include "cmdline_page.iss.inc"
  140. #include "idf_page.iss.inc"
  141. #include "git_page.iss.inc"
  142. #include "python_page.iss.inc"
  143. #include "system_check_page.iss.inc"
  144. #include "idf_download_page.iss.inc"
  145. #include "idf_setup.iss.inc"
  146. #include "summary.iss.inc"
  147. #include "main.iss.inc"