tools: IDF Windows installer offline mode support

This commit is contained in:
Juraj Michalek
2020-08-28 12:33:48 +02:00
committed by Juraj Michálek
parent 67ba80f2ec
commit 70e06a46ba
29 changed files with 830 additions and 241 deletions

View File

@@ -4,12 +4,21 @@ param (
[string]$IdfVersion = "v4.1"
)
$Installer
$IdfPath
$IdfVersion
"Configuration:"
"* Installer = $Installer"
"* IdfPath = $IdfPath"
"* IdfVersion = $IdfVersion"
$ProcessName = (Get-Item $Installer).Basename
"Waiting for process: $ProcessName"
# Set PYTHONHOME and PYTHONPATH to some directory which is not on the system to test process of creating venv
# The Installer and IDF shell wrappers contains clearing of variables
$env:PYTHONPATH="C:\Hvannadalshnúkur"
$env:PYTHONHOME="C:\Hvannadalshnúkur"
mkdir C:\Temp
C:\Output\esp-idf-tools-setup-unsigned.exe /VERYSILENT /LOG=C:\Temp\install.txt /SUPPRESSMSGBOXES /SP- /NOCANCEL /NORESTART /IDFVERSION=${IdfVersion}
$InstallerProcess = Get-Process esp-idf-tools-setup-unsigned
&$Installer /VERYSILENT /LOG=C:\Temp\install.txt /SUPPRESSMSGBOXES /SP- /NOCANCEL /NORESTART /IDFVERSION=${IdfVersion}
$InstallerProcess = Get-Process $ProcessName
Wait-Process -Id $InstallerProcess.id
Get-Content C:\Temp\install.txt
Get-Content -Tail 80 C:\Temp\install.txt

View File

@@ -1,28 +0,0 @@
param (
[string]$PythonPath = "C:\Python38\",
[string]$IdfPath = "C:\Users\ContainerAdministrator\Desktop\esp-idf"
)
$env:PATH+=";${PythonPath}"
Set-Location "${IdfPath}"
#.\export.ps1
$env:PYTHONPATH="C:\Users\ContainerAdministrator\Desktop\esp-idf\tools\"
# Append build script and launch via link
#Add-Content -Path ${IdfPath}\export.bat -Value ${BuildCommands}
# timeout is necessary to fix the problem when installer is writing some final files
# it seems that installer exits, but locks were not released yet
Start-Sleep -s 5
$WSShell = New-Object -comObject WScript.Shell
$Shortcut = $WSShell.CreateShortcut('C:\Users\ContainerAdministrator\Desktop\ESP-IDF Command Prompt (cmd.exe).lnk')
$Arguments = $Shortcut.Arguments -replace "/k ", "/c '"
$Command = $Shortcut.TargetPath + ' ' + $Arguments -replace '""', '"'
$Command += " && cd examples\get-started\blink\ && idf.py build'"
Invoke-Expression -Command $Command
#powershell.exe
#C:\Windows\system32\cmd.exe /c '"C:\Users\ContainerAdministrator\.espressif\idf_cmd_init.bat" "C:\Users\ContainerAdministrator\.espressif\python_env\idf4.1_py3.7_env\Scripts" "C:\Program Files\Git\cmd\" && cd examples\get-started\blink\ && idf.py build'
#cmd /c "ping -n 4 127.0.0.1 && .\export.bat && cd examples\get-started\blink\ && idf.py build"
#cmd /c "ping -n 4 127.0.0.1 && .\export.bat && cd examples\get-started\blink\ && idf.py build"
#cmd /c "timeout 4 && C:\Users\ContainerAdministrator\.espressif\idf_cmd_init.bat 'C:\' && cd examples\get-started\blink\ && idf.py build"
#& "C:\Users\ContainerAdministrator\Desktop\esp-idf\Run ESP-IDF Command Prompt (cmd.exe).lnk"

View File

@@ -0,0 +1,19 @@
param (
[string]$PythonPath = "C:\Python38\",
[string]$IdfPath = "C:\Users\ContainerAdministrator\Desktop\esp-idf"
)
$env:PATH+=";${PythonPath}"
Set-Location "${IdfPath}"
$env:PYTHONPATH="C:\Users\ContainerAdministrator\Desktop\esp-idf\tools\"
# Timeout is necessary to fix the problem when installer is writing some final files
# it seems that installer exits, but locks were not released yet
Start-Sleep -s 5
$WSShell = New-Object -comObject WScript.Shell
$Shortcut = $WSShell.CreateShortcut('C:\Users\ContainerAdministrator\Desktop\ESP-IDF Command Prompt (cmd.exe).lnk')
$Arguments = $Shortcut.Arguments -replace "/k ", "/c '"
$Command = $Shortcut.TargetPath + ' ' + $Arguments -replace '""', '"'
$Command += " && cd examples\get-started\blink\ && idf.py build'"
Invoke-Expression -Command $Command

View File

@@ -0,0 +1,31 @@
param (
[string]$PythonPath = "C:\Python38\",
[string]$IdfPath = "C:\Users\ContainerAdministrator\Desktop\esp-idf"
)
$env:PATH+=";${PythonPath}"
Set-Location "${IdfPath}"
$env:PYTHONPATH="C:\Users\ContainerAdministrator\Desktop\esp-idf\tools\"
# Timeout is necessary to fix the problem when installer is writing some final files
# it seems that installer exits, but locks were not released yet
Start-Sleep -s 5
$WSShell = New-Object -comObject WScript.Shell
$Shortcut = $WSShell.CreateShortcut('C:\Users\ContainerAdministrator\Desktop\ESP-IDF PowerShell.lnk')
$Command = '. ' + $Shortcut.Arguments -replace '""', '"'
$Command = $Command -replace " -ExecutionPolicy Bypass -NoExit -File", ""
$Command
Invoke-Expression -Command $Command
cd examples\get-started\blink\
idf.py build
# Check whether the repository is clean
$GitChanges=(git status -s).Lenght
if ($GitChanges -gt 0) {
"* Warning! Git repository dirty."
$GitChanges
} else {
"Git repository clean."
}