Open-source Revit MCP server: let Claude and other AI assistants read and edit BIM models, with human approval on every change.
Python aecai-agentsautodeskautomationbimclaudeifcmcpmcp-servermodel-context-protocolnavisworksrevitrevit-addinrevit-apirhino
feat(release): one-click Windows installer attached to every release
sammohammad5788f43b776e0c6
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 4dd5ebb..fccaea3 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -18,6 +18,15 @@ on:description: Revit version to package, or All for 2024-2027required: truedefault: "All"+ dry_run:+ description: Build and test everything, but do not create or update the GitHub release or start the registry publish. Artifacts are attached to the run instead.+ type: boolean+ required: false+ default: false+ ref:+ description: Git ref to build instead of the tag, for testing a branch. Only allowed together with dry_run.+ required: false+ default: ""jobs:release:@@ -33,6 +42,7 @@ jobs:run: |$tag = if ($env:GITHUB_EVENT_NAME -eq 'push') { $env:GITHUB_REF_NAME } else { '${{ inputs.tag }}' }if ($tag -notmatch '^v\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$') { throw "Tag '$tag' is not vMAJOR.MINOR.PATCH[-prerelease]" }+ if ('${{ inputs.ref }}' -ne '' -and '${{ inputs.dry_run }}' -ne 'true') { throw "The ref input is only allowed together with dry_run, so a release is never built from an untagged ref." }"tag=$tag" >> $env:GITHUB_OUTPUT"version=$($tag.Substring(1))" >> $env:GITHUB_OUTPUT"prerelease=$($tag.Contains('-').ToString().ToLower())" >> $env:GITHUB_OUTPUT@@ -40,7 +50,7 @@ jobs:- name: Checkout codeuses: actions/checkout@v7with:- ref: ${{ steps.tag.outputs.tag }}+ ref: ${{ inputs.ref || steps.tag.outputs.tag }}- name: Set up Pythonuses: actions/setup-python@v7@@ -96,11 +106,56 @@ jobs:-RevitVersion "${{ inputs.revit_version || 'All' }}"-VSCodePackage "extensions/vscode/aec-model-bridge-${{ steps.tag.outputs.version }}.vsix"+ # The double-click installer carries all four Revit years, so it needs the full package.+ - name: Install Inno Setup+ if: ${{ (inputs.revit_version || 'All') == 'All' }}+ shell: pwsh+ run: |+ choco install innosetup -y --no-progress+ if ($LASTEXITCODE -ne 0) { throw "Inno Setup installation failed" }++ - name: Build Windows installer+ if: ${{ (inputs.revit_version || 'All') == 'All' }}+ shell: pwsh+ run: >+ ./scripts/build-installer.ps1+ -Version "${{ steps.tag.outputs.version }}"+ -SkipPackage+ -OutputDir dist/release+ -UpdateChecksums++ - name: Smoke-test the installer (silent install, upgrade, failure, uninstall)+ if: ${{ (inputs.revit_version || 'All') == 'All' }}+ shell: pwsh+ run: >+ ./scripts/test-installer.ps1+ -Installer "dist/release/AECModelBridge-Setup-${{ steps.tag.outputs.version }}.exe"+ -AllowOverwrite+- name: Write release notes from CHANGELOGshell: pwsh- run: python scripts/version.py notes "${{ steps.tag.outputs.version }}" | Out-File -Encoding utf8 release-notes.md+ run: |+ $version = '${{ steps.tag.outputs.version }}'+ python scripts/version.py notes $version | Out-File -Encoding utf8 release-notes.md+ if (Test-Path "dist/release/AECModelBridge-Setup-$version.exe") {+ Add-Content -Encoding utf8 release-notes.md @"++ **Easiest install:** download ``AECModelBridge-Setup-$version.exe`` below, double-click it and follow the wizard. It detects your Revit versions and sets everything up. Checksums are in ``SHA256SUMS.txt``.+ "@+ }++ - name: Upload artifacts (dry run)+ if: ${{ inputs.dry_run }}+ uses: actions/upload-artifact@v4+ with:+ name: release-dry-run-${{ steps.tag.outputs.version }}+ path: |+ dist/release/*+ release-notes.md+ if-no-files-found: error- name: Create or update GitHub release+ if: ${{ !inputs.dry_run }}shell: pwshenv:GH_TOKEN: ${{ github.token }}@@ -118,7 +173,7 @@ jobs:}- name: Publish to the MCP Registry- if: steps.tag.outputs.prerelease == 'false'+ if: ${{ steps.tag.outputs.prerelease == 'false' && !inputs.dry_run }}shell: pwshenv:GH_TOKEN: ${{ github.token }}diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f1659cd..3dfcec8 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -2,6 +2,7 @@## Unreleased+- Release: every stable release now also attaches a double-click Windows installer, `AECModelBridge-Setup-<version>.exe` (listed in `SHA256SUMS.txt`). It picks the installed Revit years, needs no admin rights, can set up Claude Desktop and VS Code (with a backup first) and uninstalls cleanly. The release workflow builds it with Inno Setup, smoke-tests a silent install, upgrade, failure and uninstall, and has a new `dry_run` input that builds everything without publishing. The old `AECModelBridge.iss` copied the package onto itself, always installed every year and ran the client setup without asking; it was reworked. `configure-mcp-clients.ps1` now backs up each config, writes UTF-8 and leaves a commented VS Code `settings.json` alone.- VS Code: add the local MCP extension, connection status, mock mode and Revit year selection. Correct local-host execution, settings overrides and auto-approval warnings; add provider/command regression tests. Marketplace publishing and live app verification remain pending.- Release: build and test the VS Code package before attaching its `.vsix` to future GitHub releases, include it in checksums, and synchronize extension manifest and lockfile versions.- README: lead with BIM coordinator workflows, simplify badges and licensing text, remove endorsement boilerplate and ecosystem artwork, and use local paths for technical diagrams. Document the snapshot handoff limitation and coordinator adoption priorities.diff --git a/docs/build-and-install-scripts.md b/docs/build-and-install-scripts.mdindex 6015933..4c42948 100644--- a/docs/build-and-install-scripts.md+++ b/docs/build-and-install-scripts.md@@ -33,9 +33,18 @@ Builds the double-click Windows installer.Key behavior:-- runs `package.ps1` first, so the payload is current-- locates Inno Setup (`ISCC.exe`) or installs it if missing+- runs `package.ps1` for all Revit years first (skip with `-SkipPackage` when `dist\AECModelBridge` is current)+- refuses to build if the payload is incomplete or contains Autodesk assemblies (`assert-no-autodesk-assemblies.ps1`)+- locates Inno Setup (`ISCC.exe`); outside CI it tries `winget` if missing+- writes `AECModelBridge-Setup-<version>.exe` to `dist\` (or `-OutputDir`); `-UpdateChecksums` adds it to `SHA256SUMS.txt`- uses the wizard images and app icon from `assets/`, generated by `scripts/make_brand_assets.py`+- the installer script is `scripts/installer/AECModelBridge.iss`; its `AppVersion` line is kept in sync by `scripts/version.py`++### `scripts/test-installer.ps1`++Silent install, upgrade, failure and uninstall smoke test for the built installer. It+changes `C:\ProgramData\AECModelBridge` and `%APPDATA%`, so it only runs with+`-AllowOverwrite`; use a throw-away machine. The release workflow runs it before publishing.### `scripts/install.ps1`diff --git a/docs/install.md b/docs/install.mdindex e5f11fb..915b4f5 100644--- a/docs/install.md+++ b/docs/install.md@@ -25,6 +25,39 @@ General requirements:- Git- A licensed Revit installation for live bridge mode+## Download the installer++The easiest way to install on Windows. No Python, Git or build tools needed.++1. Open the [latest release](https://github.com/Sam-AEC/aec-model-bridge/releases/latest)+ and download `AECModelBridge-Setup-<version>.exe`.+2. Close Revit, then double-click the file. Windows SmartScreen may warn that the+ publisher is unknown, because the installer is not code-signed yet. Choose+ **More info**, then **Run anyway**. The checksum is in `SHA256SUMS.txt` on the+ same page.+3. On the *Revit versions* page, the Revit years found on your computer are already+ ticked. Change them if you like. Optionally tick *Set up Claude Desktop and VS Code*;+ your current settings are copied to a `.aec-backup-<date>` file first.+4. Start Revit and look for the **AEC Bridge** tab.++The installer needs no administrator rights. It puts the add-in in+`C:\ProgramData\AECModelBridge\bin\<year>`, the bundled Python and MCP server in+`C:\ProgramData\AECModelBridge\python`, and a per-user manifest in+`%APPDATA%\Autodesk\Revit\Addins\<year>`. Installing again upgrades in place.+To remove everything, use *Apps > Installed apps > AEC Model Bridge > Uninstall*.+Close Revit first; both Setup and the uninstaller stop if Revit is running.++For a silent install (IT deployment):++```powershell+.\AECModelBridge-Setup-<version>.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /COMPONENTS="y2025,y2026"+```++`/COMPONENTS` takes `y2024`, `y2025`, `y2026`, `y2027`; leave it out to use the+detected Revit versions. Add `/TASKS="mcpclients"` to set up Claude Desktop and VS Code,+and `/LOG="setup.log"` to keep a log. To build the installer yourself, see+[build and install scripts](build-and-install-scripts.md).+## Install From SourceClone the repository and create a virtual environment:diff --git a/scripts/assert-no-autodesk-assemblies.ps1 b/scripts/assert-no-autodesk-assemblies.ps1new file mode 100644index 0000000..1c65d80--- /dev/null+++ b/scripts/assert-no-autodesk-assemblies.ps1@@ -0,0 +1,22 @@+# Fails when a folder contains Autodesk assemblies, which must never be redistributed.+# Used by build-release.ps1 (the packaged dist) and build-installer.ps1 (the installer payload).+param(+ [Parameter(Mandatory = $true)]+ [string]$Path+)++$ErrorActionPreference = "Stop"++$prohibitedNames = @(+ "RevitAPI.dll",+ "RevitAPIUI.dll",+ "AdWindows.dll",+ "AdskLicensingSDK_*.dll"+)+$prohibitedFiles = foreach ($pattern in $prohibitedNames) {+ Get-ChildItem -Path $Path -Recurse -File -Filter $pattern -ErrorAction SilentlyContinue+}+if ($prohibitedFiles) {+ $paths = ($prohibitedFiles.FullName | Sort-Object -Unique) -join [Environment]::NewLine+ throw "Release contains Autodesk assemblies and cannot be published:$([Environment]::NewLine)$paths"+}diff --git a/scripts/build-installer.ps1 b/scripts/build-installer.ps1index f69655d..2da8761 100644--- a/scripts/build-installer.ps1+++ b/scripts/build-installer.ps1@@ -1,74 +1,110 @@param(- [string]$RevitVersion = "All"+ [string]$Version = (Get-Content (Join-Path $PSScriptRoot '..\VERSION') -Raw).Trim(),+ # Use the dist\AECModelBridge folder as it is (CI builds it with build-release.ps1 first).+ [switch]$SkipPackage,+ # Where AECModelBridge-Setup-<version>.exe is written. Default: dist\+ [string]$OutputDir,+ # Add the installer to SHA256SUMS.txt in OutputDir (rewrites the whole file).+ [switch]$UpdateChecksums)$ErrorActionPreference = "Stop"-Write-Host "Building AEC Model Bridge Double-Click Installer..." -ForegroundColor Cyan+$repoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScriptRoot ".."))+$distDir = Join-Path $repoRoot "dist\AECModelBridge"+$issPath = Join-Path $PSScriptRoot "installer\AECModelBridge.iss"+if (-not $OutputDir) { $OutputDir = Join-Path $repoRoot "dist" }+New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null+$OutputDir = (Resolve-Path -LiteralPath $OutputDir).Path+$years = @("2024", "2025", "2026", "2027")++Write-Host "Building AEC Model Bridge installer $Version..." -ForegroundColor Cyan-# 1. Ensure package is built-$distDir = Join-Path $PSScriptRoot "..\dist\AECModelBridge"-Write-Host "`nRunning package script for Revit $RevitVersion..." -ForegroundColor Yellow-& "$PSScriptRoot\package.ps1" -RevitVersion $RevitVersion+# 0. The script is the single place the installer version lives next to VERSION.+$issVersion = [regex]::Match((Get-Content -LiteralPath $issPath -Raw), '(?m)^AppVersion=(.+?)\s*$').Groups[1].Value+if ($issVersion -ne $Version) {+ throw "AECModelBridge.iss has AppVersion=$issVersion but the version is $Version. Run: python scripts/version.py set $Version"+}++# 1. Make sure the package exists. The installer always carries every supported Revit year.+if (-not $SkipPackage) {+ Write-Host "`nRunning package script for all Revit years..." -ForegroundColor Yellow+ & "$PSScriptRoot\package.ps1" -Version $Version -RevitVersion All+ if ($LASTEXITCODE -ne 0) { throw "package.ps1 failed with exit code $LASTEXITCODE" }+}-if (-not (Test-Path $distDir)) {- Write-Error "Packaging failed - dist folder $distDir does not exist."- exit 1+if (-not (Test-Path -LiteralPath $distDir)) {+ throw "Package folder not found: $distDir. Run scripts\package.ps1 or omit -SkipPackage."}+$required = @("python\python.exe", "addin\AECModelBridge.addin", "config\default.json", "LICENSE", "NOTICE", "LICENSING.md") ++ ($years | ForEach-Object { "bin\$_\AECModelBridge.dll" })+foreach ($rel in $required) {+ if (-not (Test-Path -LiteralPath (Join-Path $distDir $rel))) {+ throw "Installer payload is incomplete, missing dist\AECModelBridge\$rel (the installer needs the full package for 2024-2027, built with -RevitVersion All)."+ }+}+$sitePackages = Join-Path $distDir "python\Lib\site-packages"+if (-not (Get-ChildItem -LiteralPath $sitePackages -Directory -Filter "revit_mcp_server" -ErrorAction SilentlyContinue)) {+ throw "The bundled Python has no revit_mcp_server package: $sitePackages"+}++# 2. Never ship Autodesk assemblies.+& "$PSScriptRoot\assert-no-autodesk-assemblies.ps1" -Path $distDir-# 2. Locate or install Inno Setup (ISCC.exe)+# 3. Locate Inno Setup (ISCC.exe).function Get-ISCCCompiler {$cmd = Get-Command iscc -ErrorAction SilentlyContinueif ($cmd) { return $cmd.Source }- $candidatePaths = @(- "${env:LOCALAPPDATA}\Programs\Inno Setup 6\ISCC.exe",- "${env:LOCALAPPDATA}\Programs\Inno Setup 7\ISCC.exe",- "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe",- "${env:ProgramFiles}\Inno Setup 6\ISCC.exe"- )+ $candidatePaths = @()+ foreach ($major in @("6", "7")) {+ $candidatePaths += "${env:LOCALAPPDATA}\Programs\Inno Setup $major\ISCC.exe"+ $candidatePaths += "${env:ProgramFiles(x86)}\Inno Setup $major\ISCC.exe"+ $candidatePaths += "${env:ProgramFiles}\Inno Setup $major\ISCC.exe"+ }foreach ($path in $candidatePaths) {- if ($path -and (Test-Path -LiteralPath $path)) {- return $path- }+ if ($path -and (Test-Path -LiteralPath $path)) { return $path }}return $null}$isccPath = Get-ISCCCompiler--if (-not $isccPath) {- Write-Host "`nInno Setup (ISCC.exe) not found. Attempting auto-installation via winget..." -ForegroundColor Yellow+if (-not $isccPath -and -not $env:CI) {+ Write-Host "`nInno Setup (ISCC.exe) not found. Attempting installation via winget..." -ForegroundColor Yellow$winget = Get-Command winget -ErrorAction SilentlyContinueif ($winget) {& winget install --id JRSoftware.InnoSetup -e --accept-source-agreements --accept-package-agreements --silent$isccPath = Get-ISCCCompiler}}-if (-not $isccPath) {- Write-Error "Inno Setup compiler (ISCC.exe) could not be located or installed. Please install Inno Setup 6."- exit 1+ throw "Inno Setup compiler (ISCC.exe) not found. Install Inno Setup 6 (choco install innosetup, or winget install JRSoftware.InnoSetup)."}-# 3. Compile Inno Setup Script-$issPath = Join-Path $PSScriptRoot "installer\AECModelBridge.iss"-Write-Host "`nCompiling Inno Setup script: $issPath..." -ForegroundColor Yellow+# 4. Compile.+Write-Host "`nCompiling $issPath..." -ForegroundColor YellowWrite-Host " Using ISCC compiler: $isccPath" -ForegroundColor Gray+& $isccPath "/O$OutputDir" $issPath+if ($LASTEXITCODE -ne 0) { throw "Inno Setup compilation failed with exit code $LASTEXITCODE" }-& "$isccPath" "$issPath"--if ($LASTEXITCODE -ne 0) {- Write-Error "Inno Setup compilation failed with exit code $LASTEXITCODE"- exit $LASTEXITCODE+$installer = Join-Path $OutputDir "AECModelBridge-Setup-$Version.exe"+if (-not (Test-Path -LiteralPath $installer)) {+ throw "Installer build finished, but $installer was not found."}-$outputInstaller = Join-Path $PSScriptRoot "..\dist\AECModelBridgeSetup.exe"-if (Test-Path $outputInstaller) {- Write-Host "`nDouble-click installer successfully built!" -ForegroundColor Green- Write-Host "Location: $outputInstaller" -ForegroundColor Cyan- Write-Host "Size: $([math]::Round((Get-Item $outputInstaller).Length / 1MB, 2)) MB" -ForegroundColor Gray-} else {- Write-Error "Installer build finished, but output installer was not found at $outputInstaller"- exit 1+# 5. Optionally add it to SHA256SUMS.txt.+if ($UpdateChecksums) {+ $checksums = Get-ChildItem -Path $OutputDir -File |+ Where-Object Name -ne "SHA256SUMS.txt" |+ Sort-Object Name |+ ForEach-Object {+ $hash = (Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256).Hash.ToLowerInvariant()+ "$hash $($_.Name)"+ }+ $checksums | Set-Content -LiteralPath (Join-Path $OutputDir "SHA256SUMS.txt") -Encoding ascii+ Write-Host " Updated SHA256SUMS.txt" -ForegroundColor Gray}++Write-Host "`nInstaller built: $installer" -ForegroundColor Green+Write-Host "Size: $([math]::Round((Get-Item $installer).Length / 1MB, 2)) MB" -ForegroundColor Gray+Write-Host "SHA256: $((Get-FileHash -LiteralPath $installer -Algorithm SHA256).Hash.ToLowerInvariant())" -ForegroundColor Graydiff --git a/scripts/build-release.ps1 b/scripts/build-release.ps1index 56672f1..36dfaca 100644--- a/scripts/build-release.ps1+++ b/scripts/build-release.ps1@@ -54,19 +54,8 @@ foreach ($year in $years) {}}-$prohibitedNames = @(- "RevitAPI.dll",- "RevitAPIUI.dll",- "AdWindows.dll",- "AdskLicensingSDK_*.dll"-)-$prohibitedFiles = foreach ($pattern in $prohibitedNames) {- Get-ChildItem -Path $packageDir -Recurse -File -Filter $pattern -ErrorAction SilentlyContinue-}-if ($prohibitedFiles) {- $paths = ($prohibitedFiles.FullName | Sort-Object -Unique) -join [Environment]::NewLine- throw "Release contains Autodesk assemblies and cannot be published:$([Environment]::NewLine)$paths"-}+# Shared with build-installer.ps1 so the zips and the installer use the same check.+& (Join-Path $PSScriptRoot "assert-no-autodesk-assemblies.ps1") -Path $packageDir# One zip per Revit year: everything in the package except the other years' binaries,# so each user downloads only the build that matches their Revit.diff --git a/scripts/configure-mcp-clients.ps1 b/scripts/configure-mcp-clients.ps1index 78c1c5b..069c41c 100644--- a/scripts/configure-mcp-clients.ps1+++ b/scripts/configure-mcp-clients.ps1@@ -49,6 +49,45 @@ function Add-RevitServers {}}+# Writes a config file safely: skips the write when nothing changes, keeps a timestamped+# backup of the existing file next to it, writes UTF-8 without BOM, and replaces the file+# in one step (temp file + move) so a crash never leaves a half-written config.+function Write-ConfigFile {+ param(+ [Parameter(Mandatory = $true)][string]$Path,+ [Parameter(Mandatory = $true)]$Object+ )++ # Depth 100 so nested values in an existing file (for example VS Code settings) are not flattened.+ $json = ($Object | ConvertTo-Json -Depth 100) + [Environment]::NewLine+ $utf8NoBom = New-Object System.Text.UTF8Encoding($false)++ if (Test-Path -LiteralPath $Path) {+ $current = [System.IO.File]::ReadAllText($Path)+ if ($current -eq $json) {+ Write-Host " Already up to date: $Path" -ForegroundColor Gray+ return+ }+ $backup = "$Path.aec-backup-$(Get-Date -Format 'yyyyMMdd-HHmmss')"+ Copy-Item -LiteralPath $Path -Destination $backup -Force+ Write-Host " Backup: $backup" -ForegroundColor Gray+ }++ $temp = "$Path.aec-tmp"+ try {+ [System.IO.File]::WriteAllText($temp, $json, $utf8NoBom)+ Move-Item -LiteralPath $temp -Destination $Path -Force+ }+ finally {+ if (Test-Path -LiteralPath $temp) { Remove-Item -LiteralPath $temp -Force -ErrorAction SilentlyContinue }+ }+}++if (-not (Test-Path -LiteralPath $PythonPath)) {+ Write-Warning "Python not found at $PythonPath. No client configuration was changed."+ exit 1+}+# 1. Configure Claude Desktop (%APPDATA%\Claude\claude_desktop_config.json)$claudeDir = Join-Path $env:APPDATA "Claude"$claudeConfigFile = Join-Path $claudeDir "claude_desktop_config.json"@@ -81,7 +120,7 @@ try {}Add-RevitServers -Servers $claudeConfig["mcpServers"]- $claudeConfig | ConvertTo-Json -Depth 10 | Set-Content -LiteralPath $claudeConfigFile -Force+ Write-ConfigFile -Path $claudeConfigFile -Object $claudeConfigWrite-Host " Configured Claude Desktop: $claudeConfigFile" -ForegroundColor Green}catch {@@ -112,7 +151,7 @@ if (Test-Path $codeUserDir) {}}Add-RevitServers -Servers $vscConfig["servers"] -VSCode- $vscConfig | ConvertTo-Json -Depth 10 | Set-Content -LiteralPath $vscMcpFile -Force+ Write-ConfigFile -Path $vscMcpFile -Object $vscConfigWrite-Host " Configured VS Code MCP file: $vscMcpFile" -ForegroundColor Green}catch {@@ -137,7 +176,7 @@ if (Test-Path $codeUserDir) {}}Add-RevitServers -Servers $userConfig["servers"] -VSCode- $userConfig | ConvertTo-Json -Depth 10 | Set-Content -LiteralPath $userMcpFile -Force+ Write-ConfigFile -Path $userMcpFile -Object $userConfigWrite-Host " Configured VS Code User mcp.json: $userMcpFile" -ForegroundColor Green}catch {@@ -152,6 +191,11 @@ if (Test-Path $codeUserDir) {$raw = Get-Content -LiteralPath $settingsFile -Raw -ErrorAction SilentlyContinueif ($raw) {$cleanRaw = ($raw -split "`r?`n" | Where-Object { $_ -notmatch '^\s*//' }) -join "`n"+ # settings.json is JSON with comments. Rewriting it would drop the comments,+ # so leave a commented file alone (the other MCP files above are enough).+ if ($cleanRaw -ne $raw -or $raw -match '/\*') {+ throw "settings.json contains comments; not rewriting it (add the servers by hand if you need them there)."+ }$parsed = $cleanRaw | ConvertFrom-Jsonif ($parsed) {foreach ($prop in $parsed.PSObject.Properties) {@@ -168,7 +212,7 @@ if (Test-Path $codeUserDir) {}Add-RevitServers -Servers $mcpServersObj$settingsConfig["mcp.servers"] = $mcpServersObj- $settingsConfig | ConvertTo-Json -Depth 10 | Set-Content -LiteralPath $settingsFile -Force+ Write-ConfigFile -Path $settingsFile -Object $settingsConfigWrite-Host " Configured VS Code settings.json: $settingsFile" -ForegroundColor Green}catch {diff --git a/scripts/installer/AECModelBridge.iss b/scripts/installer/AECModelBridge.issindex 201fd11..f4c6fd0 100644--- a/scripts/installer/AECModelBridge.iss+++ b/scripts/installer/AECModelBridge.iss@@ -1,5 +1,21 @@-; AEC Model Bridge — Inno Setup Installer Script-; Compiles to AECModelBridgeSetup.exe+; AEC Model Bridge - Inno Setup installer script.+;+; Built by scripts/build-installer.ps1 from the package that scripts/package.ps1 writes to+; dist\AECModelBridge (all four Revit years). Output: AECModelBridge-Setup-<AppVersion>.exe.+;+; What it installs (mirrors scripts/install.ps1):+; C:\ProgramData\AECModelBridge\bin\<year> add-in binaries, one folder per Revit year+; C:\ProgramData\AECModelBridge\python bundled Python with the MCP server+; C:\ProgramData\AECModelBridge\config default.json+; %APPDATA%\Autodesk\Revit\Addins\<year>\AECModelBridge.addin per-user manifest+;+; The installer never ships Autodesk assemblies (the Excludes below are a second line of+; defence behind the check in scripts/assert-no-autodesk-assemblies.ps1).+;+; Silent install: AECModelBridge-Setup-<version>.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART+; optional: /COMPONENTS="y2025,y2026" /TASKS="mcpclients" /SKIPWEBVIEW2=1 /LOG="setup.log"++#define Dist "..\..\dist\AECModelBridge"[Setup]AppId={{D41A24F3-87B1-4A51-9F31-30919E371C25}@@ -7,27 +23,389 @@ AppName=AEC Model BridgeAppVersion=1.3.3AppPublisher=Sam-AECAppPublisherURL=https://github.com/Sam-AEC/aec-model-bridge+AppSupportURL=https://github.com/Sam-AEC/aec-model-bridge/issues+AppUpdatesURL=https://github.com/Sam-AEC/aec-model-bridge/releases+; The add-in and the bundled-Python lookup hard-code C:\ProgramData\AECModelBridge, so the+; install folder is fixed. Per-user install: no admin rights needed, and the manifest lands+; in the profile of the person who is actually running Setup (not an elevating admin).DefaultDirName=C:\ProgramData\AECModelBridge+DisableDirPage=yesDefaultGroupName=AEC Model BridgeDisableProgramGroupPage=yes-OutputBaseFilename=AECModelBridgeSetup+PrivilegesRequired=lowest+MinVersion=10.0+OutputBaseFilename=AECModelBridge-Setup-{#SetupSetting("AppVersion")}OutputDir=..\..\distCompression=lzma2/maxSolidCompression=yesArchitecturesAllowed=x64compatibleArchitecturesInstallIn64BitMode=x64compatible-PrivilegesRequired=adminSetupIconFile=..\..\assets\icon.icoUninstallDisplayIcon={app}\assets\icon.ico+UninstallDisplayName=AEC Model BridgeWizardImageFile=..\..\assets\installer\wizard-large.bmpWizardSmallImageFile=..\..\assets\installer\wizard-small.bmpWizardStyle=modern+SetupLogging=yes+; Revit is checked explicitly in PrepareToInstall; never let Restart Manager close it.+CloseApplications=yes+RestartApplications=no++[Messages]+WelcomeLabel2=This installs [name/ver] for Autodesk Revit on your computer.%n%nClose Revit before you continue.+WizardSelectComponents=Revit versions+SelectComponentsDesc=Which Revit versions should AEC Model Bridge be installed for?+SelectComponentsLabel2=Versions of Revit found on this computer are already ticked. Change the selection if needed, then click Next.+FinishedLabelNoIcons=Setup has finished installing [name] on your computer.%n%nStart Revit and look for the AEC Bridge tab.+FinishedLabel=Setup has finished installing [name] on your computer.%n%nStart Revit and look for the AEC Bridge tab.++[Types]+Name: "full"; Description: "All supported Revit versions (2024 to 2027)"+Name: "custom"; Description: "Choose Revit versions"; Flags: iscustom++[Components]+Name: "y2024"; Description: "Revit 2024"; Types: full+Name: "y2025"; Description: "Revit 2025"; Types: full+Name: "y2026"; Description: "Revit 2026"; Types: full+Name: "y2027"; Description: "Revit 2027"; Types: full++[Tasks]+Name: "mcpclients"; Description: "Set up Claude Desktop and VS Code to use AEC Model Bridge (your current settings are backed up first)"; GroupDescription: "AI clients:"; Flags: unchecked++[InstallDelete]+; Start each Revit year from a clean folder so old and new DLLs are never mixed.+Type: filesandordirs; Name: "{app}\bin\2024"; Components: y2024+Type: filesandordirs; Name: "{app}\bin\2025"; Components: y2025+Type: filesandordirs; Name: "{app}\bin\2026"; Components: y2026+Type: filesandordirs; Name: "{app}\bin\2027"; Components: y2027+; Drop the previous server package before the new one is copied. Copying over the top leaves+; old aec_model_bridge-<version>.dist-info folders behind, and Python then reports the+; oldest one as the installed version (same fix as scripts/install.ps1).+Type: filesandordirs; Name: "{app}\python\Lib\site-packages\aec_model_bridge-*.dist-info"+Type: filesandordirs; Name: "{app}\python\Lib\site-packages\revit_mcp_server-*.dist-info"+Type: filesandordirs; Name: "{app}\python\Lib\site-packages\revit_mcp_server"[Files]Source: "..\..\assets\icon.ico"; DestDir: "{app}\assets"; Flags: ignoreversion-Source: "..\..\dist\AECModelBridge\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs++; Add-in binaries, one folder per Revit year.+Source: "{#Dist}\bin\2024\*"; DestDir: "{app}\bin\2024"; Components: y2024; Excludes: "RevitAPI.dll,RevitAPIUI.dll,AdWindows.dll,AdskLicensingSDK_*.dll"; Flags: ignoreversion recursesubdirs createallsubdirs+Source: "{#Dist}\bin\2025\*"; DestDir: "{app}\bin\2025"; Components: y2025; Excludes: "RevitAPI.dll,RevitAPIUI.dll,AdWindows.dll,AdskLicensingSDK_*.dll"; Flags: ignoreversion recursesubdirs createallsubdirs+Source: "{#Dist}\bin\2026\*"; DestDir: "{app}\bin\2026"; Components: y2026; Excludes: "RevitAPI.dll,RevitAPIUI.dll,AdWindows.dll,AdskLicensingSDK_*.dll"; Flags: ignoreversion recursesubdirs createallsubdirs+Source: "{#Dist}\bin\2027\*"; DestDir: "{app}\bin\2027"; Components: y2027; Excludes: "RevitAPI.dll,RevitAPIUI.dll,AdWindows.dll,AdskLicensingSDK_*.dll"; Flags: ignoreversion recursesubdirs createallsubdirs++; Manifest template. The per-user manifests are written from it in [Code] (InstallManifests).+Source: "{#Dist}\addin\AECModelBridge.addin"; DestDir: "{app}\addin"; Flags: ignoreversion+Source: "{#Dist}\config\default.json"; DestDir: "{app}\config"; Flags: ignoreversion++; Bundled Python runtime with the MCP server already installed in Lib\site-packages.+Source: "{#Dist}\python\*"; DestDir: "{app}\python"; Excludes: "__pycache__"; Flags: ignoreversion recursesubdirs createallsubdirs++; Helper scripts used by [Run].+Source: "..\..\scripts\ensure-webview2.ps1"; DestDir: "{app}\scripts"; Flags: ignoreversion+Source: "..\..\scripts\configure-mcp-clients.ps1"; DestDir: "{app}\scripts"; Flags: ignoreversion++; Licence texts.+Source: "{#Dist}\LICENSE"; DestDir: "{app}"; Flags: ignoreversion+Source: "{#Dist}\NOTICE"; DestDir: "{app}"; Flags: ignoreversion+Source: "{#Dist}\LICENSING.md"; DestDir: "{app}"; Flags: ignoreversion+Source: "{#Dist}\LICENSES\*"; DestDir: "{app}\LICENSES"; Flags: ignoreversion recursesubdirs createallsubdirs[Run]-Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{app}\scripts\ensure-webview2.ps1"""; StatusMsg: "Checking WebView2 Runtime..."; Flags: runhidden waituntilterminated-Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{app}\install.ps1"" -RevitVersion All -DistPath ""{app}"""; StatusMsg: "Installing AEC Model Bridge components..."; Flags: runhidden waituntilterminated-Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{app}\scripts\configure-mcp-clients.ps1"" -PythonPath ""{app}\python\python.exe"""; StatusMsg: "Configuring MCP clients (Claude Desktop / VS Code)..."; Flags: runhidden waituntilterminated+Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -File ""{app}\scripts\ensure-webview2.ps1"""; StatusMsg: "Checking the WebView2 runtime..."; Flags: runhidden waituntilterminated; Check: WantWebView2+Filename: "{sys}\WindowsPowerShell\v1.0\powershell.exe"; Parameters: "-NoProfile -ExecutionPolicy Bypass -File ""{app}\scripts\configure-mcp-clients.ps1"" -PythonPath ""{app}\python\python.exe"""; StatusMsg: "Setting up Claude Desktop and VS Code..."; Flags: runhidden waituntilterminated; Tasks: mcpclients++[UninstallDelete]+; The manifests are written by [Code], so Setup does not track them. The trailing * also+; removes any leftover .new or .bak file from an interrupted install.+Type: files; Name: "{userappdata}\Autodesk\Revit\Addins\2024\AECModelBridge.addin*"+Type: files; Name: "{userappdata}\Autodesk\Revit\Addins\2025\AECModelBridge.addin*"+Type: files; Name: "{userappdata}\Autodesk\Revit\Addins\2026\AECModelBridge.addin*"+Type: files; Name: "{userappdata}\Autodesk\Revit\Addins\2027\AECModelBridge.addin*"+; Remove everything else under the install folder (runtime caches, pyc files, logs).+Type: filesandordirs; Name: "{app}"++[Code]+const+ YearCount = 4;+ FirstYear = 2024;+ MOVEFILE_REPLACE_EXISTING = 1;++function MoveFileExW(lpExistingFileName, lpNewFileName: String; dwFlags: Cardinal): Integer;+ external '[email protected] stdcall';++function YearAt(Index: Integer): String;+begin+ Result := IntToStr(FirstYear + Index);+end;++function UserAddinDir(const Year: String): String;+begin+ Result := ExpandConstant('{userappdata}') + '\Autodesk\Revit\Addins\' + Year;+end;++function CommonAddinDir(const Year: String): String;+begin+ Result := ExpandConstant('{commonappdata}') + '\Autodesk\Revit\Addins\' + Year;+end;++// A Revit year counts as installed when its program folder or one of its Addins folders exists.+function RevitDetected(const Year: String): Boolean;+begin+ Result :=+ DirExists(ExpandConstant('{commonpf64}') + '\Autodesk\Revit ' + Year) or+ DirExists(UserAddinDir(Year)) or+ DirExists(CommonAddinDir(Year));+end;++function IsRevitRunning: Boolean;+var+ Tmp: String;+ Output: AnsiString;+ ResultCode: Integer;+begin+ Result := False;+ Tmp := ExpandConstant('{tmp}') + '\aecmb-revit-check.txt';+ DeleteFile(Tmp);+ if Exec(ExpandConstant('{cmd}'),+ '/C tasklist /FI "IMAGENAME eq Revit.exe" /NH /FO CSV > "' + Tmp + '"',+ '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then+ begin+ if LoadStringFromFile(Tmp, Output) then+ Result := Pos('revit.exe', Lowercase(Output)) > 0;+ end;+ DeleteFile(Tmp);+end;++function WantWebView2: Boolean;+begin+ Result := ExpandConstant('{param:SKIPWEBVIEW2|0}') <> '1';+end;++// Preselect the Revit years found on this computer. An explicit /COMPONENTS= always wins,+// and when no Revit is found every year stays selected.+procedure InitializeWizard;+var+ I: Integer;+ Found: Boolean;+ Selection: String;+begin+ if ExpandConstant('{param:COMPONENTS|}') <> '' then+ Exit;++ Found := False;+ Selection := '';+ for I := 0 to YearCount - 1 do+ begin+ if RevitDetected(YearAt(I)) then+ begin+ Found := True;+ Selection := Selection + ',y' + YearAt(I);+ end+ else+ Selection := Selection + ',!y' + YearAt(I);+ end;++ if Found then+ begin+ Delete(Selection, 1, 1);+ WizardSelectComponents(Selection);+ end;+end;++function NextButtonClick(CurPageID: Integer): Boolean;+var+ I: Integer;+ Any: Boolean;+begin+ Result := True;+ if CurPageID = wpSelectComponents then+ begin+ Any := False;+ for I := 0 to YearCount - 1 do+ if WizardIsComponentSelected('y' + YearAt(I)) then+ Any := True;+ if not Any then+ begin+ MsgBox('Select at least one Revit version.', mbInformation, MB_OK);+ Result := False;+ end;+ end;+end;++// Runs for silent installs too. A non-empty result aborts Setup before any file is written.+function PrepareToInstall(var NeedsRestart: Boolean): String;+var+ I: Integer;+ Any: Boolean;+begin+ Result := '';+ Any := False;+ for I := 0 to YearCount - 1 do+ if IsComponentSelected('y' + YearAt(I)) then+ Any := True;+ if not Any then+ Result := 'No Revit version is selected. Select at least one Revit version.'+ else if IsRevitRunning then+ Result := 'Revit is running. Close Revit, then run Setup again.';+end;++// Replace the text between <Assembly> and </Assembly> in the manifest template.+function RewriteAssembly(const Xml, AssemblyPath: String; var NewXml: String): Boolean;+var+ OpenPos, ClosePos: Integer;+begin+ OpenPos := Pos('<Assembly>', Xml);+ ClosePos := Pos('</Assembly>', Xml);+ Result := (OpenPos > 0) and (ClosePos > OpenPos);+ if Result then+ NewXml := Copy(Xml, 1, OpenPos + Length('<Assembly>') - 1) + AssemblyPath ++ Copy(Xml, ClosePos, Length(Xml));+end;++// Writes the per-user manifest for every selected year. Each manifest is written to+// <name>.new first and then moved over the real file in one step, so Revit only ever sees+// the old complete file or the new complete file. If any step fails, manifests already+// switched are put back and the function reports the error; the caller then fails the+// install and Setup rolls the copied files back.+function InstallManifests(var ErrorMsg: String): Boolean;+var+ I, J, Done: Integer;+ Year, Dir, Final, Xml, NewXml: String;+ Raw: AnsiString;+ Temps, Finals, Backups: TStringList;+begin+ Result := False;+ ErrorMsg := '';+ Done := 0;++ if not LoadStringFromFile(ExpandConstant('{app}') + '\addin\AECModelBridge.addin', Raw) then+ begin+ ErrorMsg := 'The add-in manifest template is missing from the installed files.';+ Exit;+ end;+ Xml := Raw;++ Temps := TStringList.Create;+ Finals := TStringList.Create;+ Backups := TStringList.Create;+ try+ // 1. Stage a complete new manifest for every selected year.+ for I := 0 to YearCount - 1 do+ begin+ Year := YearAt(I);+ if (ErrorMsg = '') and IsComponentSelected('y' + Year) then+ begin+ Dir := UserAddinDir(Year);+ Final := Dir + '\AECModelBridge.addin';+ if not ForceDirectories(Dir) then+ ErrorMsg := 'Could not create ' + Dir+ else if not RewriteAssembly(Xml,+ ExpandConstant('{app}') + '\bin\' + Year + '\AECModelBridge.dll', NewXml) then+ ErrorMsg := 'The add-in manifest template has no Assembly element.'+ else if not SaveStringToFile(Final + '.new', NewXml, False) then+ ErrorMsg := 'Could not write ' + Final + '.new'+ else+ begin+ Temps.Add(Final + '.new');+ Finals.Add(Final);+ end;+ end;+ end;++ // 2. Keep a copy of every manifest that is about to be replaced.+ if ErrorMsg = '' then+ begin+ for I := 0 to Finals.Count - 1 do+ begin+ if FileExists(Finals[I]) then+ begin+ if FileCopy(Finals[I], Finals[I] + '.bak', False) then+ Backups.Add(Finals[I] + '.bak')+ else+ begin+ Backups.Add('');+ ErrorMsg := 'Could not back up ' + Finals[I];+ end;+ end+ else+ Backups.Add('');+ end;+ end;++ // 3. Switch the new manifests in.+ if ErrorMsg = '' then+ begin+ for I := 0 to Finals.Count - 1 do+ begin+ if ErrorMsg = '' then+ begin+ if MoveFileExW(Temps[I], Finals[I], MOVEFILE_REPLACE_EXISTING) = 0 then+ ErrorMsg := 'Could not replace ' + Finals[I]+ else+ Done := Done + 1;+ end;+ end;+ end;++ // 4. On failure put the previous state back for everything already switched.+ if ErrorMsg <> '' then+ begin+ for J := 0 to Done - 1 do+ begin+ if (J < Backups.Count) and (Backups[J] <> '') then+ MoveFileExW(Backups[J], Finals[J], MOVEFILE_REPLACE_EXISTING)+ else+ DeleteFile(Finals[J]);+ end;+ end;++ // 5. Remove leftovers (staged files that were never switched in, and backups).+ for I := 0 to Temps.Count - 1 do+ DeleteFile(Temps[I]);+ for I := 0 to Backups.Count - 1 do+ if Backups[I] <> '' then+ DeleteFile(Backups[I]);++ Result := (ErrorMsg = '');++ // 6. Old layouts: remove the legacy manifest name and duplicates in the all-users folder+ // (same clean-up as scripts/install.ps1). Failures here are not fatal.+ if Result then+ begin+ for I := 0 to Finals.Count - 1 do+ begin+ Year := ExtractFileName(ExtractFileDir(Finals[I]));+ DeleteFile(UserAddinDir(Year) + '\RevitBridge.addin');+ DeleteFile(CommonAddinDir(Year) + '\AECModelBridge.addin');+ DeleteFile(CommonAddinDir(Year) + '\RevitBridge.addin');+ end;+ end;+ finally+ Temps.Free;+ Finals.Free;+ Backups.Free;+ end;+end;++procedure CurStepChanged(CurStep: TSetupStep);+var+ Msg: String;+begin+ if CurStep = ssPostInstall then+ begin+ if not InstallManifests(Msg) then+ RaiseException('AEC Model Bridge could not write the Revit add-in manifest. ' + Msg ++ ' Nothing was changed in your Revit Addins folder.');+ end;+end;++function InitializeUninstall: Boolean;+begin+ Result := True;+ if IsRevitRunning then+ begin+ MsgBox('Revit is running. Close Revit, then run the uninstaller again.', mbInformation, MB_OK);+ Result := False;+ end;+end;diff --git a/scripts/test-installer.ps1 b/scripts/test-installer.ps1new file mode 100644index 0000000..d1bb4f4--- /dev/null+++ b/scripts/test-installer.ps1@@ -0,0 +1,93 @@+# Smoke test for AECModelBridge-Setup-<version>.exe: silent install, upgrade, failure and uninstall.+#+# DESTRUCTIVE: it installs into C:\ProgramData\AECModelBridge and writes a Revit manifest in+# %APPDATA%, then uninstalls. It refuses to run when an install already exists unless+# -AllowOverwrite is given. Meant for CI runners and throw-away VMs, not a working machine.+param(+ [Parameter(Mandatory = $true)]+ [string]$Installer,+ [string]$Year = "2026",+ [switch]$AllowOverwrite+)++$ErrorActionPreference = "Stop"++$Installer = (Resolve-Path -LiteralPath $Installer).Path+$appDir = "C:\ProgramData\AECModelBridge"+$addinDir = Join-Path $env:APPDATA "Autodesk\Revit\Addins\$Year"+$manifest = Join-Path $addinDir "AECModelBridge.addin"+$logDir = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { $env:TEMP }++if (-not $AllowOverwrite -and ((Test-Path -LiteralPath $appDir) -or (Test-Path -LiteralPath $manifest))) {+ throw "An AEC Model Bridge install already exists on this machine. Re-run with -AllowOverwrite only on a throw-away machine."+}++function Assert-That {+ param([bool]$Condition, [string]$Message)+ if (-not $Condition) { throw "FAILED: $Message" }+ Write-Host " ok: $Message" -ForegroundColor Green+}++function Invoke-Setup {+ param([string]$Name)+ $log = Join-Path $logDir "aecmb-setup-$Name.log"+ $setupArgs = @("/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART", "/SP-", "/COMPONENTS=y$Year", "/SKIPWEBVIEW2=1", "/LOG=`"$log`"")+ $p = Start-Process -FilePath $Installer -ArgumentList $setupArgs -Wait -PassThru+ Write-Host " setup log: $log (exit code $($p.ExitCode))"+ return $p.ExitCode+}++# --- 1. A failure while writing the manifest must not leave a manifest behind. ---------------+Write-Host "`n[1] Failure injection" -ForegroundColor Cyan+New-Item -ItemType Directory -Path $addinDir -Force | Out-Null+$blocker = "$manifest.new"+New-Item -ItemType Directory -Path $blocker -Force | Out-Null # SaveStringToFile cannot write over a folder+$code = Invoke-Setup "failure"+Assert-That ($code -ne 0) "setup reports failure when the manifest cannot be written (exit code $code)"+Assert-That (-not (Test-Path -LiteralPath $manifest -PathType Leaf)) "no manifest was left behind"+Remove-Item -LiteralPath $blocker -Recurse -Force+Write-Host " leftover install folder after the failed run: $(Test-Path -LiteralPath $appDir)"++# --- 2. Clean install -------------------------------------------------------------------------+Write-Host "`n[2] Silent install for Revit $Year" -ForegroundColor Cyan+$code = Invoke-Setup "install"+Assert-That ($code -eq 0) "setup exits with 0 (got $code)"+$dll = Join-Path $appDir "bin\$Year\AECModelBridge.dll"+Assert-That (Test-Path -LiteralPath $dll) "bridge DLL installed: $dll"+foreach ($other in @("2024", "2025", "2026", "2027") | Where-Object { $_ -ne $Year }) {+ Assert-That (-not (Test-Path -LiteralPath (Join-Path $appDir "bin\$other"))) "year $other was not installed"+}+Assert-That (Test-Path -LiteralPath $manifest -PathType Leaf) "manifest written: $manifest"+[xml]$xml = Get-Content -LiteralPath $manifest -Raw+Assert-That ($xml.RevitAddIns.AddIn.Assembly -eq $dll) "manifest Assembly points to $dll"+Assert-That (-not (Test-Path -LiteralPath "$manifest.new")) "no temporary manifest left"+Assert-That (Test-Path -LiteralPath (Join-Path $appDir "config\default.json")) "default.json installed"+$python = Join-Path $appDir "python\python.exe"+Assert-That (Test-Path -LiteralPath $python) "bundled Python installed"+& $python -c "import revit_mcp_server"+Assert-That ($LASTEXITCODE -eq 0) "bundled Python imports revit_mcp_server"+$autodesk = Get-ChildItem -Path $appDir -Recurse -File -ErrorAction SilentlyContinue |+ Where-Object { $_.Name -in @("RevitAPI.dll", "RevitAPIUI.dll", "AdWindows.dll") -or $_.Name -like "AdskLicensingSDK_*.dll" }+Assert-That (-not $autodesk) "no Autodesk assemblies in the install folder"++# --- 3. Upgrade removes stale server metadata -------------------------------------------------+Write-Host "`n[3] Upgrade over the top" -ForegroundColor Cyan+$site = Join-Path $appDir "python\Lib\site-packages"+$stale = Join-Path $site "aec_model_bridge-0.0.1.dist-info"+New-Item -ItemType Directory -Path $stale -Force | Out-Null+$code = Invoke-Setup "upgrade"+Assert-That ($code -eq 0) "second setup exits with 0 (got $code)"+Assert-That (-not (Test-Path -LiteralPath $stale)) "stale aec_model_bridge dist-info was removed"+$distInfo = @(Get-ChildItem -LiteralPath $site -Directory -Filter "aec_model_bridge-*.dist-info")+Assert-That ($distInfo.Count -eq 1) "exactly one aec_model_bridge dist-info remains ($($distInfo.Name -join ', '))"++# --- 4. Uninstall -----------------------------------------------------------------------------+Write-Host "`n[4] Silent uninstall" -ForegroundColor Cyan+$uninstaller = Get-ChildItem -LiteralPath $appDir -Filter "unins*.exe" | Select-Object -First 1+Assert-That ($null -ne $uninstaller) "uninstaller exists"+Start-Process -FilePath $uninstaller.FullName -ArgumentList @("/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART") -Wait | Out-Null+for ($i = 0; $i -lt 60 -and (Test-Path -LiteralPath $appDir); $i++) { Start-Sleep -Seconds 1 }+Assert-That (-not (Test-Path -LiteralPath $manifest)) "manifest removed"+Assert-That (-not (Test-Path -LiteralPath $appDir)) "$appDir removed"++Write-Host "`nInstaller smoke test passed." -ForegroundColor Green