Skip to content

Commit 7e5b368

Browse files
committed
fix: report installer progress immediately
1 parent f4e49bc commit 7e5b368

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

install.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,11 +525,13 @@ function Invoke-ContexaInstaller {
525525
throw ((Select-InstallerText 'Unsupported CONTEXA_INSTALL_ACTION' '7KeA7JuQ7ZWY7KeAIOyViuuKlCBDT05URVhBX0lOU1RBTExfQUNUSU9O') + ': ' + $action)
526526
}
527527

528+
Write-Host (' ' + (Select-InstallerText 'Starting Contexa CLI installation.' 'Q29udGV4YSBDTEkg7ISk7LmY66W8IOyLnOyeke2VqeuLiOuLpC4='))
528529
$downloadBase = if ([string]::IsNullOrWhiteSpace($env:CONTEXA_RELEASE_DOWNLOAD_BASE)) { $script:DefaultDownloadBase } else { $env:CONTEXA_RELEASE_DOWNLOAD_BASE.TrimEnd('/') }
529530
$targetRelease = Get-TargetRelease $downloadBase
530531
$version = $targetRelease.ReleaseTag
531532
$expectedCliVersion = $targetRelease.CliVersion
532533
$releaseBase = $downloadBase + '/' + $version
534+
Write-Host (' ' + ((Select-InstallerText 'Release {0} found. Checking authenticity...' '66a066as7IqkIHswfeydhCDtmZXsnbjtlojsirXri4jri6QuIOyLoOuisOyEseydhCDqsoDspp3tlZjripQg7KSR7J6F64uI64ukLi4u') -f $version))
533535

534536
$manifestBytes = Invoke-BoundedDownload ($releaseBase + '/release-manifest.json')
535537
$signatureBytes = Invoke-BoundedDownload ($releaseBase + '/release-manifest.json.sig')
@@ -591,6 +593,7 @@ function Invoke-ContexaInstaller {
591593
$hadOriginal = Test-Path -LiteralPath $finalPath -PathType Leaf
592594
$replacementStarted = $false
593595
try {
596+
Write-Host (' ' + (Select-InstallerText 'Downloading Contexa CLI and verifying the file...' 'Q29udGV4YSBDTEnrpbwg64uk7Jq066Gc65Oc7ZWY6rOgIO2MjOydvCDrrLTqsrDshLHsnYQg6rKA7Kad7ZWY64qUIOykkeyeheuLiOuLpC4uLg=='))
594597
$binaryBytes = Invoke-BoundedDownload ($releaseBase + '/' + $asset.file)
595598
[System.IO.File]::WriteAllBytes($temporaryPath, $binaryBytes)
596599
Write-InstallerTransaction $markerPath 'DOWNLOADED' $finalPath $backupPath $temporaryPath $expectedCliVersion $hadOriginal

test/installer-runtime.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ function windowsInstallerEnv(base, installDir, version, keyXml, action = 'instal
205205
CONTEXA_INSTALL_DIR: installDir,
206206
CONTEXA_INSTALL_ACTION: action,
207207
CONTEXA_SKIP_PATH_UPDATE: '1',
208+
CONTEXA_LANG: 'en',
208209
CONTEXA_HTTP_CONNECT_TIMEOUT_SEC: '1',
209210
CONTEXA_HTTP_TOTAL_TIMEOUT_SEC: '2',
210211
CONTEXA_HTTP_RETRIES: '1',
@@ -394,6 +395,9 @@ test('PowerShell installer performs install, no-op, update, rollback and uninsta
394395
const installDir = path.join(temp, `설치 경로 with space ${iteration}`);
395396
const first = await runWindowsInstaller(windowsInstallerEnv(base, installDir, '9.9.1-test', xml));
396397
assert.equal(first.code, 0, first.stderr || first.stdout);
398+
assert.match(first.stdout, /Starting Contexa CLI installation/);
399+
assert.match(first.stdout, /Release v9\.9\.1-test found\. Checking authenticity/);
400+
assert.match(first.stdout, /Downloading Contexa CLI and verifying the file/);
397401
const installed = path.join(installDir, 'contexa.exe');
398402
assert.equal(spawnSync(installed, ['--version'], { encoding: 'utf8' }).stdout.trim(), '9.9.1-test');
399403
const originalTime = fs.statSync(installed).mtimeMs;

test/installers.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ test('install.ps1 enforces the signed, bounded and atomic installation contract'
5353
assert.match(src, /Test-BinarySmoke \$temporaryPath/);
5454
assert.match(src, /Ensure-CommandPath/);
5555
assert.match(src, /was not deleted/);
56+
const startProgress = src.indexOf('Starting Contexa CLI installation.');
57+
const releaseLookup = src.indexOf('$targetRelease = Get-TargetRelease');
58+
assert.ok(startProgress >= 0 && startProgress < releaseLookup,
59+
'installer must report progress before the first release lookup');
60+
assert.match(src, /Release \{0\} found\. Checking authenticity/);
61+
assert.match(src, /Downloading Contexa CLI and verifying the file/);
5662
for (const command of ['contexa init', 'contexa reset', 'contexa init --simulate', 'contexa reset --simulate']) {
5763
assert.ok(src.includes(command), `missing primary command: ${command}`);
5864
}

0 commit comments

Comments
 (0)