mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-07 14:44:32 +02:00
Merge branch 'bugfix/win_tools_installer_fixes' into 'master'
tools: Windows tools installer release v2.3 Closes IDFGH-2670 and IDFGH-1929 See merge request espressif/esp-idf!7550
This commit is contained in:
@@ -28,7 +28,7 @@ ESP-IDF Tools Installer
|
|||||||
|
|
||||||
The easiest way to install ESP-IDF's prerequisites is to download the ESP-IDF Tools installer from this URL:
|
The easiest way to install ESP-IDF's prerequisites is to download the ESP-IDF Tools installer from this URL:
|
||||||
|
|
||||||
https://dl.espressif.com/dl/esp-idf-tools-setup-2.2.exe
|
https://dl.espressif.com/dl/esp-idf-tools-setup-2.3.exe
|
||||||
|
|
||||||
The installer includes the cross-compilers, OpenOCD, cmake_ and Ninja_ build tool. The installer can also download and run installers for Python_ 3.7 and `Git For Windows`_ if they are not already installed on the computer.
|
The installer includes the cross-compilers, OpenOCD, cmake_ and Ninja_ build tool. The installer can also download and run installers for Python_ 3.7 and `Git For Windows`_ if they are not already installed on the computer.
|
||||||
|
|
||||||
|
@@ -28,7 +28,7 @@ ESP-IDF 工具安装器
|
|||||||
|
|
||||||
要安装 ESP-IDF 必备工具,最简易的方式是下载 ESP-IDF 工具安装器,地址如下:
|
要安装 ESP-IDF 必备工具,最简易的方式是下载 ESP-IDF 工具安装器,地址如下:
|
||||||
|
|
||||||
https://dl.espressif.com/dl/esp-idf-tools-setup-2.2.exe
|
https://dl.espressif.com/dl/esp-idf-tools-setup-2.3.exe
|
||||||
|
|
||||||
本安装器可为您安装所需的交叉编译器、OpenOCD、cmake_ 和 Ninja_ 编译工具,以及一款 mconf-idf_ 配置工具。此外,本安装器还可在有需要时下载、运行 Python_ 3.7 和 `Git For Windows` 的安装器。
|
本安装器可为您安装所需的交叉编译器、OpenOCD、cmake_ 和 Ninja_ 编译工具,以及一款 mconf-idf_ 配置工具。此外,本安装器还可在有需要时下载、运行 Python_ 3.7 和 `Git For Windows` 的安装器。
|
||||||
|
|
||||||
|
@@ -87,7 +87,7 @@ begin
|
|||||||
CmdLine := GitExecutablePath + ' -C ' + Path + ' submodule foreach git repack -d -a'
|
CmdLine := GitExecutablePath + ' -C ' + Path + ' submodule foreach git repack -d -a'
|
||||||
DoCmdlineInstall('Finishing ESP-IDF installation', 'Re-packing the submodules', CmdLine);
|
DoCmdlineInstall('Finishing ESP-IDF installation', 'Re-packing the submodules', CmdLine);
|
||||||
|
|
||||||
FindFileRecusive(Path + '\.git', 'alternates', @RemoveAlternatesFile);
|
FindFileRecursive(Path + '\.git', 'alternates', @RemoveAlternatesFile);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Run git reset --hard in the repo and in the submodules, to fix the newlines. }
|
{ Run git reset --hard in the repo and in the submodules, to fix the newlines. }
|
||||||
@@ -122,7 +122,6 @@ var
|
|||||||
IDFTempPath: String;
|
IDFTempPath: String;
|
||||||
IDFPath: String;
|
IDFPath: String;
|
||||||
NeedToClone: Boolean;
|
NeedToClone: Boolean;
|
||||||
Res: Boolean;
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
IDFPath := IDFDownloadPath;
|
IDFPath := IDFDownloadPath;
|
||||||
@@ -168,7 +167,7 @@ begin
|
|||||||
GitRepoDissociate(IDFPath);
|
GitRepoDissociate(IDFPath);
|
||||||
|
|
||||||
end else begin
|
end else begin
|
||||||
Log('Moving ' + IDFTempPath + ' to ' + IDFPath);
|
Log('Copying ' + IDFTempPath + ' to ' + IDFPath);
|
||||||
if DirExists(IDFPath) then
|
if DirExists(IDFPath) then
|
||||||
begin
|
begin
|
||||||
if not DirIsEmpty(IDFPath) then
|
if not DirIsEmpty(IDFPath) then
|
||||||
@@ -176,47 +175,69 @@ begin
|
|||||||
MsgBox('Destination directory exists and is not empty: ' + IDFPath, mbError, MB_OK);
|
MsgBox('Destination directory exists and is not empty: ' + IDFPath, mbError, MB_OK);
|
||||||
RaiseException('Failed to copy ESP-IDF')
|
RaiseException('Failed to copy ESP-IDF')
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Res := RemoveDir(IDFPath);
|
|
||||||
if not Res then
|
|
||||||
begin
|
|
||||||
MsgBox('Failed to remove destination directory: ' + IDFPath, mbError, MB_OK);
|
|
||||||
RaiseException('Failed to copy ESP-IDF')
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
Res := RenameFile(IDFTempPath, IDFPath);
|
|
||||||
if not Res then
|
|
||||||
begin
|
|
||||||
MsgBox('Failed to copy ESP-IDF to the destination directory: ' + IDFPath, mbError, MB_OK);
|
|
||||||
RaiseException('Failed to copy ESP-IDF');
|
|
||||||
end;
|
end;
|
||||||
|
{ If cmd.exe command argument starts with a quote, the first and last quote chars in the command
|
||||||
|
will be removed by cmd.exe.
|
||||||
|
Keys explanation: /s+/e includes all subdirectories, /i assumes that destination is a directory,
|
||||||
|
/h copies hidden files, /q disables file name logging (making copying faster!)
|
||||||
|
}
|
||||||
|
CmdLine := ExpandConstant('cmd.exe /c ""xcopy" /s /e /i /h /q "' + IDFTempPath + '" "' + IDFPath + '""');
|
||||||
|
DoCmdlineInstall('Extracting ESP-IDF', 'Copying ESP-IDF into the destination directory', CmdLine);
|
||||||
GitRepoFixNewlines(IDFPath);
|
GitRepoFixNewlines(IDFPath);
|
||||||
|
DelTree(IDFTempPath, True, True, True);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ ------------------------------ IDF Tools setup, Python environment setup ------------------------------ }
|
{ ------------------------------ IDF Tools setup, Python environment setup ------------------------------ }
|
||||||
|
|
||||||
|
function UseBundledIDFToolsPy(Version: String) : Boolean;
|
||||||
|
begin
|
||||||
|
Result := False;
|
||||||
|
{ Use bundled copy of idf_tools.py, as the copy shipped with these IDF versions can not work due to
|
||||||
|
the --no-site-packages bug.
|
||||||
|
}
|
||||||
|
if (Version = 'v4.0') or (Version = 'v3.3.1') then
|
||||||
|
begin
|
||||||
|
Log('UseBundledIDFToolsPy: version=' + Version + ', using bundled idf_tools.py');
|
||||||
|
Result := True;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure IDFToolsSetup();
|
procedure IDFToolsSetup();
|
||||||
var
|
var
|
||||||
CmdLine: String;
|
CmdLine: String;
|
||||||
IDFPath: String;
|
IDFPath: String;
|
||||||
IDFToolsPyPath: String;
|
IDFToolsPyPath: String;
|
||||||
IDFToolsPyCmd: String;
|
IDFToolsPyCmd: String;
|
||||||
|
BundledIDFToolsPyPath: String;
|
||||||
|
JSONArg: String;
|
||||||
begin
|
begin
|
||||||
IDFPath := GetIDFPath('');
|
IDFPath := GetIDFPath('');
|
||||||
IDFToolsPyPath := IDFPath + '\tools\idf_tools.py';
|
IDFToolsPyPath := IDFPath + '\tools\idf_tools.py';
|
||||||
|
BundledIDFToolsPyPath := ExpandConstant('{app}\idf_tools_fallback.py');
|
||||||
|
JSONArg := '';
|
||||||
|
|
||||||
if FileExists(IDFToolsPyPath) then
|
if FileExists(IDFToolsPyPath) then
|
||||||
begin
|
begin
|
||||||
Log('idf_tools.py exists in IDF directory');
|
Log('idf_tools.py exists in IDF directory');
|
||||||
IDFToolsPyCmd := PythonExecutablePath + ' ' + IDFToolsPyPath;
|
if UseBundledIDFToolsPy(IDFDownloadVersion) then
|
||||||
|
begin
|
||||||
|
Log('Using the bundled idf_tools.py copy');
|
||||||
|
IDFToolsPyCmd := BundledIDFToolsPyPath;
|
||||||
|
end else begin
|
||||||
|
IDFToolsPyCmd := IDFToolsPyPath;
|
||||||
|
end;
|
||||||
end else begin
|
end else begin
|
||||||
Log('idf_tools.py does not exist in IDF directory, using a fallback version');
|
Log('idf_tools.py does not exist in IDF directory, using a fallback version');
|
||||||
IDFToolsPyCmd := ExpandConstant(PythonExecutablePath
|
IDFToolsPyCmd := BundledIDFToolsPyPath;
|
||||||
+ ' "{app}\idf_tools_fallback.py"'
|
JSONArg := ExpandConstant('--tools "{app}\tools_fallback.json"');
|
||||||
+ ' --idf-path ' + IDFPath
|
|
||||||
+ ' --tools "{app}\tools_fallback.json"');
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ IDFPath not quoted, as it can not contain spaces }
|
||||||
|
IDFToolsPyCmd := PythonExecutablePath + ' "' + IDFToolsPyCmd + '" --idf-path ' + IDFPath + JSONArg;
|
||||||
|
|
||||||
|
SetEnvironmentVariable('PYTHONUNBUFFERED', '1')
|
||||||
|
|
||||||
Log('idf_tools.py command: ' + IDFToolsPyCmd);
|
Log('idf_tools.py command: ' + IDFToolsPyCmd);
|
||||||
CmdLine := IDFToolsPyCmd + ' install';
|
CmdLine := IDFToolsPyCmd + ' install';
|
||||||
Log('Installing tools:' + CmdLine);
|
Log('Installing tools:' + CmdLine);
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
#include <idp.iss>
|
#include <idp.iss>
|
||||||
|
|
||||||
#define MyAppName "ESP-IDF Tools"
|
#define MyAppName "ESP-IDF Tools"
|
||||||
#define MyAppVersion "2.2"
|
#define MyAppVersion "2.3"
|
||||||
#define MyAppPublisher "Espressif Systems (Shanghai) Co. Ltd."
|
#define MyAppPublisher "Espressif Systems (Shanghai) Co. Ltd."
|
||||||
#define MyAppURL "https://github.com/espressif/esp-idf"
|
#define MyAppURL "https://github.com/espressif/esp-idf"
|
||||||
|
|
||||||
|
@@ -92,7 +92,7 @@ end;
|
|||||||
type
|
type
|
||||||
TFindFileCallback = procedure(Filename: String);
|
TFindFileCallback = procedure(Filename: String);
|
||||||
|
|
||||||
procedure FindFileRecusive(Directory: string; FileName: string; Callback: TFindFileCallback);
|
procedure FindFileRecursive(Directory: string; FileName: string; Callback: TFindFileCallback);
|
||||||
var
|
var
|
||||||
FindRec: TFindRec;
|
FindRec: TFindRec;
|
||||||
FilePath: string;
|
FilePath: string;
|
||||||
@@ -107,7 +107,7 @@ begin
|
|||||||
FilePath := Directory + '\' + FindRec.Name;
|
FilePath := Directory + '\' + FindRec.Name;
|
||||||
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then
|
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then
|
||||||
begin
|
begin
|
||||||
FindFileRecusive(FilePath, FileName, Callback);
|
FindFileRecursive(FilePath, FileName, Callback);
|
||||||
end else if CompareText(FindRec.Name, FileName) = 0 then
|
end else if CompareText(FindRec.Name, FileName) = 0 then
|
||||||
begin
|
begin
|
||||||
Callback(FilePath);
|
Callback(FilePath);
|
||||||
|
Reference in New Issue
Block a user