# Install-DODA.ps1 - Extract DODA zip to C:\Apps\DODA\. # # Called by Install-FromManifest as a Type=PS1 entry. The zip is staged # alongside this script in C:\CMM-Install\ by startnet.cmd. $ErrorActionPreference = 'Continue' $installDir = 'C:\Apps\DODA' $zipPattern = 'doda_build*.zip' $stagingRoot = Split-Path $PSScriptRoot -ErrorAction SilentlyContinue if (-not $stagingRoot) { $stagingRoot = 'C:\CMM-Install' } $zip = Get-ChildItem -Path $stagingRoot -Filter $zipPattern -File -ErrorAction SilentlyContinue | Select-Object -First 1 if (-not $zip) { Write-Host "DODA zip not found in $stagingRoot (pattern: $zipPattern)" exit 1 } if (-not (Test-Path $installDir)) { New-Item -Path $installDir -ItemType Directory -Force | Out-Null } Write-Host "Extracting $($zip.Name) to $installDir..." try { Expand-Archive -LiteralPath $zip.FullName -DestinationPath $installDir -Force -ErrorAction Stop Write-Host "DODA extracted to $installDir" } catch { Write-Host "ERROR: Extract failed - $_" exit 1 } # MergeFiles.exe (cmm-utilities toolchain) reads C:\Apps\DODA\PreProcess\ as # its working dir. The DODA zip extracts flat without it, so create it here - # a missing PreProcess dir is the known cause of MergeFiles.GetDoDAFolder # throwing DirectoryNotFoundException (see cmm-utilities dotNET event.txt). $preProcess = Join-Path $installDir 'PreProcess' if (-not (Test-Path $preProcess)) { New-Item -Path $preProcess -ItemType Directory -Force | Out-Null Write-Host "Created $preProcess" } if (Test-Path (Join-Path $installDir 'DovetailAnalysis.exe')) { Write-Host "DovetailAnalysis.exe verified present" exit 0 } else { Write-Host "ERROR: DovetailAnalysis.exe not found after extract" exit 1 }