idf_tool_setup.iss 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.4"
  7. #define MyAppPublisher "Espressif Systems (Shanghai) Co. Ltd."
  8. #define MyAppURL "https://github.com/espressif/esp-idf"
  9. #define PythonVersion "3.9.1"
  10. #define PythonInstallerName "idf-python-3.9.1-embed-win64.zip"
  11. #define PythonInstallerDownloadURL "https://dl.espressif.com/dl/idf-python/idf-python-3.9.1-embed-win64.zip"
  12. #define GitVersion "2.28.0"
  13. #define GitInstallerName "Git-2.28.0-64-bit.exe"
  14. #define GitInstallerDownloadURL "https://github.com/git-for-windows/git/releases/download/v2.28.0.windows.1/Git-2.28.0-64-bit.exe"
  15. #define IDFVersionsURL "https://dl.espressif.com/dl/esp-idf/idf_versions.txt"
  16. #define IDFCmdExeShortcutDescription "Open ESP-IDF Command Prompt (cmd.exe) Environment"
  17. #define IDFCmdExeShortcutFile "ESP-IDF CMD.lnk"
  18. #define IDFPsShortcutDescription "Open ESP-IDF PowerShell Environment"
  19. #define IDFPsShortcutFile "ESP-IDF PowerShell.lnk"
  20. [Setup]
  21. ; NOTE: The value of AppId uniquely identifies this application.
  22. ; Do not use the same AppId value in installers for other applications.
  23. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  24. AppId={{9E068D99-5C4B-4E5F-96A3-B17CF291E6BD}
  25. AppName={#MyAppName}
  26. AppVersion={#MyAppVersion}
  27. AppVerName={#MyAppName} {#MyAppVersion}
  28. AppPublisher={#MyAppPublisher}
  29. AppPublisherURL={#MyAppURL}
  30. AppSupportURL={#MyAppURL}
  31. AppUpdatesURL={#MyAppURL}
  32. DefaultDirName={%USERPROFILE}\.espressif
  33. UsePreviousAppDir=no
  34. DirExistsWarning=no
  35. DefaultGroupName=ESP-IDF
  36. DisableProgramGroupPage=yes
  37. OutputBaseFilename=esp-idf-tools-setup-unsigned
  38. Compression=lzma
  39. SolidCompression=yes
  40. ArchitecturesAllowed=x64
  41. ArchitecturesInstallIn64BitMode=x64
  42. LicenseFile=license.txt
  43. PrivilegesRequired=lowest
  44. SetupLogging=yes
  45. ChangesEnvironment=yes
  46. WizardStyle=modern
  47. [Languages]
  48. Name: "english"; MessagesFile: "compiler:Default.isl,Languages/idf_tool_en-US.islu"
  49. [Dirs]
  50. Name: "{app}\dist"
  51. [Files]
  52. Source: "cmdlinerunner\build\cmdlinerunner.dll"; Flags: dontcopy
  53. Source: "unzip\7za.exe"; Flags: dontcopy
  54. Source: "idf_versions.txt"; Flags: dontcopy
  55. Source: "..\..\idf_tools.py"; DestDir: "{app}"; DestName: "idf_tools_fallback.py"
  56. ; Note: this tools.json matches the requirements of IDF v3.x versions.
  57. Source: "tools_fallback.json"; DestDir: "{app}"; DestName: "tools_fallback.json"
  58. Source: "idf_cmd_init.bat"; DestDir: "{app}"
  59. Source: "idf_cmd_init.ps1"; DestDir: "{app}"
  60. Source: "dist\*"; DestDir: "{app}\dist"
  61. ; Helper Python files for sanity check of Python environment - used by system_check_page
  62. Source: "system_check\system_check_download.py"; Flags: dontcopy
  63. Source: "system_check\system_check_subprocess.py"; Flags: dontcopy
  64. Source: "system_check\system_check_virtualenv.py"; Flags: dontcopy
  65. ; Helper PowerShell scripts for managing exceptions in Windows Defender
  66. Source: "tools_WD_excl.ps1"; DestDir: "{app}\dist"
  67. Source: "tools_WD_clean.ps1"; DestDir: "{app}\dist"
  68. [UninstallDelete]
  69. Type: filesandordirs; Name: "{app}\dist"
  70. Type: filesandordirs; Name: "{app}\releases"
  71. Type: filesandordirs; Name: "{app}\tools"
  72. Type: filesandordirs; Name: "{app}\python_env"
  73. Type: files; Name: "{group}\{#IDFCmdExeShortcutFile}"
  74. Type: files; Name: "{group}\{#IDFPsShortcutFile}"
  75. Type: files; Name: "{autodesktop}\{#IDFCmdExeShortcutFile}"
  76. Type: files; Name: "{autodesktop}\{#IDFPsShortcutFile}"
  77. [Tasks]
  78. Name: CreateLnkStartCmd; Description: "Create Start Menu shortcut for the ESP-IDF Tools Command Prompt Environment";
  79. Name: CreateLnkStartPs; Description: "Create Start Menu shortcut for the ESP-IDF Tools Powershell Environment";
  80. Name: CreateLnkDeskCmd; Description: "Create Desktop shortcut for the ESP-IDF Tools Command Prompt Environment";
  81. Name: CreateLnkDeskPs; Description: "Create Desktop shortcut for the ESP-IDF Tools Powershell Environment";
  82. ; WD registration checkbox is identified by 'Windows Defender' substring anywhere in its caption, not by the position index in WizardForm.TasksList.Items
  83. ; 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
  84. Name: wdexcl; Description: "Register the ESP-IDF Tools executables as Windows Defender exclusions (improves compilation speed, requires elevation)";
  85. Name: idf_tools_use_mirror; Description: "Use Espressif download server instead of downloading tool packages from Github"; Flags: unchecked;
  86. [Run]
  87. Filename: "{app}\dist\{#GitInstallerName}"; Parameters: "/silent /tasks="""" /norestart"; Description: "Installing Git"; Check: GitInstallRequired
  88. Filename: "{group}\{#IDFPsShortcutFile}"; Flags: postinstall shellexec unchecked; Description: "Run ESP-IDF PowerShell Environment"; Check: IsPowerShellInstalled
  89. Filename: "{group}\{#IDFCmdExeShortcutFile}"; Flags: postinstall shellexec unchecked; Description: "Run ESP-IDF Command Prompt Environment"; Check: IsCmdInstalled
  90. [UninstallRun]
  91. Filename: "powershell.exe"; \
  92. Parameters: "-ExecutionPolicy Bypass -File ""{app}\dist\tools_WD_clean.ps1"" -RmExclPath ""{app}"""; \
  93. WorkingDir: {app}; Flags: runhidden
  94. [Registry]
  95. Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "IDF_TOOLS_PATH"; \
  96. ValueData: "{app}"; Flags: preservestringtype createvalueifdoesntexist uninsdeletevalue deletevalue;
  97. [Code]
  98. #include "utils.iss.inc"
  99. #include "choice_page.iss.inc"
  100. #include "cmdline_page.iss.inc"
  101. #include "idf_page.iss.inc"
  102. #include "git_page.iss.inc"
  103. #include "python_page.iss.inc"
  104. #include "system_check_page.iss.inc"
  105. #include "idf_download_page.iss.inc"
  106. #include "idf_setup.iss.inc"
  107. #include "summary.iss.inc"
  108. #include "main.iss.inc"