Skip to content

Commit

Permalink
tools: add Windows Terminal dropdown menu registration for ESP-IDF (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgik authored May 31, 2021
1 parent 1409236 commit 7fa1ce1
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-offline-installer-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
components:
description: 'Comma separated list of installer components from IdfToolsSetup.iss'
required: true
default: ide/powershell/desktop,ide/cmd/desktop
default: ide/powershell/windowsterminal,ide/powershell/desktop,ide/cmd/desktop

jobs:
check-requirements:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-online-installer-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
components:
description: 'Comma separated list of installer components from IdfToolsSetup.iss'
required: true
default: ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs
default: ide/powershell/windowsterminal,ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs

jobs:
check-requirements:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-online-installer-scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
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
shell: pwsh
- name: Run installer
run: ./src/PowerShell/Install-Idf.ps1 -IdfVersion "master" -Components "ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs"
run: ./src/PowerShell/Install-Idf.ps1 -IdfVersion "master" -Components "ide/powershell/windowsterminal,ide/powershell/desktop,ide/cmd/desktop,driver/ftdi,driver/silabs"
shell: pwsh
- name: Build blink
run: ./src/PowerShell/Test-IdfCmd.ps1 -IdfShortVersion "4.4" -IdfPath "C:/Users/runneradmin/Desktop/esp-idf"
Expand Down
2 changes: 1 addition & 1 deletion Build-Installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function PrepareIdf7za {
function PrepareIdfEnv {
PrepareIdfFile -BasePath build\$InstallerType\lib `
-FilePath idf-env.exe `
-DownloadUrl https://github.com/espressif/idf-env/releases/download/v1.1.4.1/idf-env.exe
-DownloadUrl https://github.com/espressif/idf-env/releases/download/v1.1.7.0/win64.idf-env.exe
}

function PrepareIdfGit {
Expand Down
2 changes: 2 additions & 0 deletions src/InnoSetup/IdfToolsSetup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
#define COMPONENT_ECLIPSE = 'ide/eclipse'
#define COMPONENT_ECLIPSE_DESKTOP = 'ide/eclipse/desktop'
#define COMPONENT_POWERSHELL = 'ide/powershell'
#define COMPONENT_POWERSHELL_WINDOWS_TERMINAL = 'ide/powershell/windowsterminal'
#define COMPONENT_POWERSHELL_DESKTOP = 'ide/powershell/desktop'
#define COMPONENT_POWERSHELL_STARTMENU = 'ide/powershell/startmenu'
#define COMPONENT_CMD = 'ide/cmd'
Expand Down Expand Up @@ -176,6 +177,7 @@ Name: "ide"; Description: "IDE support"; Types: full custom; Flags: fixed
Name: "{#COMPONENT_ECLIPSE}"; Description: "Eclipse"; Types: full; Flags: checkablealone
Name: "{#COMPONENT_ECLIPSE_DESKTOP}"; Description: "Desktop shortcut"; Types: full custom
Name: "{#COMPONENT_POWERSHELL}"; Description: "PowerShell"; Types: full custom; Flags: checkablealone
Name: "{#COMPONENT_POWERSHELL_WINDOWS_TERMINAL}"; Description: "Windows Terminal Dropdown Menu"; Types: full custom
Name: "{#COMPONENT_POWERSHELL_DESKTOP}"; Description: "Desktop shortcut"; Types: full custom minimal
Name: "{#COMPONENT_POWERSHELL_STARTMENU}"; Description: "Start Menu shortcut"; Types: full
Name: "{#COMPONENT_CMD}"; Description: "Command Prompt"; Types: full; Flags: checkablealone
Expand Down
25 changes: 25 additions & 0 deletions src/InnoSetup/PostInstall.iss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ begin
Result := ExpandConstant(LinkString) + '\{#IDF_SHORTCUT_PREFIX} ' + GetIDFShortVersion() + ' ' + Title + '.lnk';
end;
procedure CreateIDFWindowsTerminalShortcut();
var
Command: String;
IdfPathWithForwardSlashes: String;
ResultCode: Integer;
begin
IdfPathWithForwardSlashes := GetPathWithForwardSlashes(GetIDFPath(''));
Command := 'launcher add --shell powershell --to windows-terminal';
Command := Command + ' --title "ESP-IDF ' + GetIDFVersionFromHeaderFile() + '"';
Command := Command + ' --idf-path "' + IdfPathWithForwardSlashes + '"';
Log(ExpandConstant('{app}\{#IDF_ENV}') + ' ' + Command);
if Exec(ExpandConstant('{app}\{#IDF_ENV}'), Command, '', SW_SHOW,
ewWaitUntilTerminated, ResultCode) then begin
Log('{#IDF_ENV} success');
end else begin
Log('{#IDF_ENV} failed');
end;
end;
procedure CreateIDFCommandPromptShortcut(LinkString: String);
var
Description: String;
Expand Down Expand Up @@ -184,6 +205,10 @@ begin
IDFToolsSetup();
SaveIdfConfiguration(ExpandConstant('{app}\esp_idf.json'));
if (WizardIsComponentSelected('{#COMPONENT_POWERSHELL_WINDOWS_TERMINAL}')) then begin
CreateIDFWindowsTerminalShortcut();
end;
if (WizardIsComponentSelected('{#COMPONENT_CMD_STARTMENU}')) then begin
CreateIDFCommandPromptShortcut('{autostartmenu}\Programs\ESP-IDF');
end;
Expand Down

0 comments on commit 7fa1ce1

Please sign in to comment.