Skip to content

Commit

Permalink
Merge branch version/0-47-0-RC1 to adopt changes from PR #3534
Browse files Browse the repository at this point in the history
  • Loading branch information
as-builds committed Oct 9, 2024
2 parents 28d0d68 + d7554e4 commit 792978d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions installers/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ function error([string] $msg)
Write-Host $msg -ForegroundColor Red
}

function setShellOverride {
$parentProcess = Get-WmiObject Win32_Process | Where-Object { $_.ProcessId -eq $PID }
$parentProcessDetails = Get-WmiObject Win32_Process | Where-Object { $_.ProcessId -eq $parentProcess.ParentProcessId }
if ($parentProcessDetails.Name -eq "cmd" -or $parentProcessDetails.Name -eq "cmd.exe") {
[System.Environment]::SetEnvironmentVariable("ACTIVESTATE_CLI_SHELL_OVERRIDE", $parentProcessDetails.Name, "Process")
}
}

$version = $script:VERSION
if (!$version) {
# If the user did not specify a version, formulate a query to fetch the JSON info of the latest
Expand Down Expand Up @@ -248,6 +256,7 @@ $PSDefaultParameterValues['*:Encoding'] = 'utf8'

# Run the installer.
$env:ACTIVESTATE_SESSION_TOKEN = $script:SESSION_TOKEN_VALUE
setShellOverride
& $exePath $args --source-installer="install.ps1"
$success = $?
if (Test-Path env:ACTIVESTATE_SESSION_TOKEN)
Expand Down

0 comments on commit 792978d

Please sign in to comment.