<# Ask Atlas — one-click installer for Word, Excel, PowerPoint and Outlook (Windows). irm https://atlas-office-plugin.infinialabs.ai/install.ps1 | iex Windows sideloads add-ins from a trusted *folder catalog* rather than a per-app folder: this creates a local catalog directory, drops the manifest in it, and registers it in HKCU so Office trusts it. No admin rights and no runtime are needed — the add-in itself is hosted. Options (when run as a file, not piped): -Uninstall remove the add-in and the catalog registration -Origin use a different deployment #> [CmdletBinding()] param( [switch]$Uninstall, [string]$Origin = $(if ($env:ATLAS_OFFICE_ORIGIN) { $env:ATLAS_OFFICE_ORIGIN } else { "https://atlas-office-plugin.infinialabs.ai" }) ) $ErrorActionPreference = "Stop" $Origin = $Origin.TrimEnd('/') $Catalog = Join-Path $env:LOCALAPPDATA "AtlasOffice\Catalog" $Manifest = Join-Path $Catalog "atlas-office.xml" # Outlook needs its own manifest: a legacy XML manifest declares one xsi:type, # so Mailbox cannot share a file with the Word/Excel/PowerPoint hosts. Both sit # in the same catalog folder; Office shows each add-in in its own hosts. $ManifestOutlook = Join-Path $Catalog "atlas-outlook.xml" $WefKey = "HKCU:\Software\Microsoft\Office\16.0\WEF\TrustedCatalogs" function Ok($m) { Write-Host " [ok] $m" -ForegroundColor Green } function Warn($m) { Write-Host " [!] $m" -ForegroundColor Yellow } function Fail($m) { Write-Host " [x] $m" -ForegroundColor Red; exit 1 } function Step($m) { Write-Host ""; Write-Host $m -ForegroundColor White } Write-Host "" Write-Host "Ask Atlas for Microsoft Office" -ForegroundColor White Write-Host $Origin -ForegroundColor DarkGray # ------------------------------------------------------------------ uninstall if ($Uninstall) { Step "Removing Ask Atlas" foreach ($m in @($Manifest, $ManifestOutlook)) { if (Test-Path $m) { Remove-Item $m -Force; Ok "$(Split-Path $m -Leaf) removed" } } if (Test-Path $WefKey) { Get-ChildItem $WefKey | ForEach-Object { $url = (Get-ItemProperty $_.PSPath -Name Url -ErrorAction SilentlyContinue).Url if ($url -and $url -eq $Catalog) { Remove-Item $_.PSPath -Recurse -Force; Ok "catalog unregistered" } } } Write-Host "" Write-Host " Restart any open Office apps to finish removing it." exit 0 } # ------------------------------------------------------------------- install Step "Checking the service" function Get-Manifest($name) { try { $r = Invoke-WebRequest -Uri "$Origin/$name" -UseBasicParsing -TimeoutSec 20 } catch { Fail "Cannot reach $Origin/$name - check your network or VPN, then run this again." } if ($r.StatusCode -ne 200) { Fail "Unexpected response for $name (HTTP $($r.StatusCode))." } # Validate before writing anywhere Office reads. try { $x = [xml]$r.Content } catch { Fail "$name is not valid XML." } if (-not $x.OfficeApp) { Fail "$name is not an Office add-in manifest." } Ok "$name v$($x.OfficeApp.Version) verified" return $r.Content } $officeContent = Get-Manifest "manifest.xml" $outlookContent = Get-Manifest "manifest.outlook.xml" Step "Installing" New-Item -ItemType Directory -Force -Path $Catalog | Out-Null [System.IO.File]::WriteAllText($Manifest, $officeContent) [System.IO.File]::WriteAllText($ManifestOutlook, $outlookContent) Ok "manifests placed in $Catalog" # Register the folder as a trusted catalog (per-user, no admin needed). if (-not (Test-Path $WefKey)) { New-Item -Path $WefKey -Force | Out-Null } $existing = Get-ChildItem $WefKey -ErrorAction SilentlyContinue | Where-Object { (Get-ItemProperty $_.PSPath -Name Url -ErrorAction SilentlyContinue).Url -eq $Catalog } if ($existing) { Ok "catalog already registered" $key = $existing[0].PSPath } else { $guid = [guid]::NewGuid().ToString("B") $key = Join-Path $WefKey $guid New-Item -Path $key -Force | Out-Null Ok "catalog registered" } Set-ItemProperty -Path $key -Name "Id" -Value (Split-Path $key -Leaf) Set-ItemProperty -Path $key -Name "Url" -Value $Catalog Set-ItemProperty -Path $key -Name "Flags" -Value "1" # 1 = show in menu Set-ItemProperty -Path $key -Name "SkipCatalogUpdate" -Value "0" $running = @("WINWORD", "EXCEL", "POWERPNT", "OUTLOOK") | ForEach-Object { Get-Process -Name $_ -ErrorAction SilentlyContinue } if ($running) { Step "Restart needed" Write-Host " Quit and reopen Word / Excel / PowerPoint / Outlook to finish." } Step "Installed" Write-Host "" Write-Host " In Word, Excel or PowerPoint: Insert -> My Add-ins -> SHARED FOLDER -> Ask Atlas" Write-Host " After the first insert, the button stays on the Home tab." Write-Host " In Outlook: open a message -> All Apps / Add-ins -> Ask Atlas" Write-Host "" Write-Host " Sign in with your Atlas account in the pane, then ask about your document." Write-Host "" Write-Host " To remove: irm $Origin/install.ps1 -OutFile i.ps1; ./i.ps1 -Uninstall" Write-Host ""