Skip to content

Commit 7fa1ce1

Browse files
authored
tools: add Windows Terminal dropdown menu registration for ESP-IDF (#22)
1 parent 1409236 commit 7fa1ce1

File tree

6 files changed

+31
-4
lines changed

6 files changed

+31
-4
lines changed

.github/workflows/test-offline-installer-dispatch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
components:
1919
description: 'Comma separated list of installer components from IdfToolsSetup.iss'
2020
required: true
21-
default: ide/powershell/desktop,ide/cmd/desktop
21+
default: ide/powershell/windowsterminal,ide/powershell/desktop,ide/cmd/desktop
2222

2323
jobs:
2424
check-requirements:

.github/workflows/test-online-installer-dispatch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
components:
1919
description: 'Comma separated list of installer components from IdfToolsSetup.iss'
2020
required: true
21-
default: ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs
21+
default: ide/powershell/windowsterminal,ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs
2222

2323
jobs:
2424
check-requirements:

.github/workflows/test-online-installer-scheduled.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
run: Invoke-WebRequest https://github.com/espressif/idf-installer/releases/download/online-2.8-beta-06/esp-idf-tools-setup-online-2.8-beta-06.exe -OutFile installer.exe
1616
shell: pwsh
1717
- name: Run installer
18-
run: ./src/PowerShell/Install-Idf.ps1 -IdfVersion "master" -Components "ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs"
18+
run: ./src/PowerShell/Install-Idf.ps1 -IdfVersion "master" -Components "ide/powershell/windowsterminal,ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs"
1919
shell: pwsh
2020
- name: Build blink
2121
run: ./src/PowerShell/Test-IdfCmd.ps1 -IdfShortVersion "4.4" -IdfPath "C:/Users/runneradmin/Desktop/esp-idf"

Build-Installer.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function PrepareIdf7za {
9696
function PrepareIdfEnv {
9797
PrepareIdfFile -BasePath build\$InstallerType\lib `
9898
-FilePath idf-env.exe `
99-
-DownloadUrl https://github.com/espressif/idf-env/releases/download/v1.1.4.1/idf-env.exe
99+
-DownloadUrl https://github.com/espressif/idf-env/releases/download/v1.1.7.0/win64.idf-env.exe
100100
}
101101

102102
function PrepareIdfGit {

src/InnoSetup/IdfToolsSetup.iss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
#define COMPONENT_ECLIPSE = 'ide/eclipse'
8383
#define COMPONENT_ECLIPSE_DESKTOP = 'ide/eclipse/desktop'
8484
#define COMPONENT_POWERSHELL = 'ide/powershell'
85+
#define COMPONENT_POWERSHELL_WINDOWS_TERMINAL = 'ide/powershell/windowsterminal'
8586
#define COMPONENT_POWERSHELL_DESKTOP = 'ide/powershell/desktop'
8687
#define COMPONENT_POWERSHELL_STARTMENU = 'ide/powershell/startmenu'
8788
#define COMPONENT_CMD = 'ide/cmd'
@@ -176,6 +177,7 @@ Name: "ide"; Description: "IDE support"; Types: full custom; Flags: fixed
176177
Name: "{#COMPONENT_ECLIPSE}"; Description: "Eclipse"; Types: full; Flags: checkablealone
177178
Name: "{#COMPONENT_ECLIPSE_DESKTOP}"; Description: "Desktop shortcut"; Types: full custom
178179
Name: "{#COMPONENT_POWERSHELL}"; Description: "PowerShell"; Types: full custom; Flags: checkablealone
180+
Name: "{#COMPONENT_POWERSHELL_WINDOWS_TERMINAL}"; Description: "Windows Terminal Dropdown Menu"; Types: full custom
179181
Name: "{#COMPONENT_POWERSHELL_DESKTOP}"; Description: "Desktop shortcut"; Types: full custom minimal
180182
Name: "{#COMPONENT_POWERSHELL_STARTMENU}"; Description: "Start Menu shortcut"; Types: full
181183
Name: "{#COMPONENT_CMD}"; Description: "Command Prompt"; Types: full; Flags: checkablealone

src/InnoSetup/PostInstall.iss

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ begin
2626
Result := ExpandConstant(LinkString) + '\{#IDF_SHORTCUT_PREFIX} ' + GetIDFShortVersion() + ' ' + Title + '.lnk';
2727
end;
2828
29+
procedure CreateIDFWindowsTerminalShortcut();
30+
var
31+
Command: String;
32+
IdfPathWithForwardSlashes: String;
33+
ResultCode: Integer;
34+
begin
35+
IdfPathWithForwardSlashes := GetPathWithForwardSlashes(GetIDFPath(''));
36+
37+
Command := 'launcher add --shell powershell --to windows-terminal';
38+
Command := Command + ' --title "ESP-IDF ' + GetIDFVersionFromHeaderFile() + '"';
39+
Command := Command + ' --idf-path "' + IdfPathWithForwardSlashes + '"';
40+
41+
Log(ExpandConstant('{app}\{#IDF_ENV}') + ' ' + Command);
42+
if Exec(ExpandConstant('{app}\{#IDF_ENV}'), Command, '', SW_SHOW,
43+
ewWaitUntilTerminated, ResultCode) then begin
44+
Log('{#IDF_ENV} success');
45+
end else begin
46+
Log('{#IDF_ENV} failed');
47+
end;
48+
end;
49+
2950
procedure CreateIDFCommandPromptShortcut(LinkString: String);
3051
var
3152
Description: String;
@@ -184,6 +205,10 @@ begin
184205
IDFToolsSetup();
185206
SaveIdfConfiguration(ExpandConstant('{app}\esp_idf.json'));
186207
208+
if (WizardIsComponentSelected('{#COMPONENT_POWERSHELL_WINDOWS_TERMINAL}')) then begin
209+
CreateIDFWindowsTerminalShortcut();
210+
end;
211+
187212
if (WizardIsComponentSelected('{#COMPONENT_CMD_STARTMENU}')) then begin
188213
CreateIDFCommandPromptShortcut('{autostartmenu}\Programs\ESP-IDF');
189214
end;

0 commit comments

Comments
 (0)