forked from espressif/esp-idf
tools: installer: allow changing installation path
Installation path can now be changed in a subsequent install, without uninstalling and logging out. The default value of the installation path is set to IDF_TOOLS_PATH environment variable, if it was already set by the previous installation, or by the user. Closes https://github.com/espressif/esp-idf/issues/3806
This commit is contained in:
@ -35,6 +35,7 @@ AppPublisherURL={#MyAppURL}
|
|||||||
AppSupportURL={#MyAppURL}
|
AppSupportURL={#MyAppURL}
|
||||||
AppUpdatesURL={#MyAppURL}
|
AppUpdatesURL={#MyAppURL}
|
||||||
DefaultDirName={%USERPROFILE}\.espressif
|
DefaultDirName={%USERPROFILE}\.espressif
|
||||||
|
UsePreviousAppDir=no
|
||||||
DirExistsWarning=no
|
DirExistsWarning=no
|
||||||
DefaultGroupName=ESP-IDF
|
DefaultGroupName=ESP-IDF
|
||||||
DisableProgramGroupPage=yes
|
DisableProgramGroupPage=yes
|
||||||
@ -78,7 +79,7 @@ Filename: "{group}\{#IDFCmdExeShortcutFile}"; Flags: postinstall shellexec; Desc
|
|||||||
|
|
||||||
[Registry]
|
[Registry]
|
||||||
Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "IDF_TOOLS_PATH"; \
|
Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "IDF_TOOLS_PATH"; \
|
||||||
ValueData: "{app}"; Flags: preservestringtype createvalueifdoesntexist;
|
ValueData: "{app}"; Flags: preservestringtype createvalueifdoesntexist uninsdeletevalue deletevalue;
|
||||||
|
|
||||||
[Code]
|
[Code]
|
||||||
|
|
||||||
|
@ -17,6 +17,23 @@ begin
|
|||||||
idpDownloadAfter(wpReady);
|
idpDownloadAfter(wpReady);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ If IDF_TOOLS_PATH is set in the environment,
|
||||||
|
set the default installation directory accordingly.
|
||||||
|
Note: here we read IDF_TOOLS_PATH using GetEnv rather than
|
||||||
|
by getting it from registry, in case the user has set
|
||||||
|
IDF_TOOLS_PATH as a system environment variable manually. }
|
||||||
|
<event('InitializeWizard')>
|
||||||
|
procedure UpdateInstallDir();
|
||||||
|
var
|
||||||
|
EnvToolsPath: String;
|
||||||
|
begin
|
||||||
|
EnvToolsPath := GetEnv('IDF_TOOLS_PATH');
|
||||||
|
if EnvToolsPath <> '' then
|
||||||
|
begin
|
||||||
|
WizardForm.DirEdit.Text := EnvToolsPath;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
<event('NextButtonClick')>
|
<event('NextButtonClick')>
|
||||||
function PreInstallSteps(CurPageID: Integer): Boolean;
|
function PreInstallSteps(CurPageID: Integer): Boolean;
|
||||||
var
|
var
|
||||||
@ -75,6 +92,11 @@ begin
|
|||||||
Log('Setting PATH for this process: ' + EnvPath);
|
Log('Setting PATH for this process: ' + EnvPath);
|
||||||
SetEnvironmentVariable('PATH', EnvPath);
|
SetEnvironmentVariable('PATH', EnvPath);
|
||||||
|
|
||||||
|
{ Set IDF_TOOLS_PATH variable, in case it was set to a different value in the environment.
|
||||||
|
The installer will set the variable to the new value in the registry, but we also need the
|
||||||
|
new value to be visible to this process. }
|
||||||
|
SetEnvironmentVariable('IDF_TOOLS_PATH', ExpandConstant('{app}'))
|
||||||
|
|
||||||
{ Log and clear PYTHONPATH variable, as it might point to libraries of another Python version}
|
{ Log and clear PYTHONPATH variable, as it might point to libraries of another Python version}
|
||||||
PythonLibPath := GetEnv('PYTHONPATH')
|
PythonLibPath := GetEnv('PYTHONPATH')
|
||||||
Log('PYTHONPATH=' + PythonLibPath)
|
Log('PYTHONPATH=' + PythonLibPath)
|
||||||
|
Reference in New Issue
Block a user