# 01-Setup-CMM.ps1 — CMM-specific setup (runs after Shopfloor baseline) # Installs Hexagon CLM Tools, PC-DMIS 2016, and PC-DMIS 2019 R2 Write-Host "=== CMM Setup ===" $hexDir = "C:\Enrollment\shopfloor-setup\CMM\hexagon" if (-not (Test-Path $hexDir)) { Write-Warning "Hexagon folder not found at $hexDir — skipping CMM installs." exit 0 } # --- Find installers --- $clm = Get-ChildItem -Path $hexDir -Filter "CLM_*.exe" | Select-Object -First 1 $pcdmis16 = Get-ChildItem -Path $hexDir -Filter "Pcdmis2016*x64.exe" | Select-Object -First 1 $pcdmis19 = Get-ChildItem -Path $hexDir -Filter "Pcdmis2019*x64.exe" | Select-Object -First 1 # --- 1. Install CLM Tools (license manager — must be first) --- if ($clm) { Write-Host "Installing CLM Tools: $($clm.Name)..." $p = Start-Process -FilePath $clm.FullName -ArgumentList "-q -norestart" -Wait -PassThru Write-Host " CLM Tools exit code: $($p.ExitCode)" } else { Write-Warning "CLM Tools installer not found in $hexDir (expected CLM_*.exe)" } # --- 2. Install PC-DMIS 2016 --- if ($pcdmis16) { Write-Host "Installing PC-DMIS 2016: $($pcdmis16.Name)..." $p = Start-Process -FilePath $pcdmis16.FullName -ArgumentList "-q INSTALLPDFCONVERTER=0 INSTALLOFFLINEHELP=0 HEIP=0 -norestart" -Wait -PassThru Write-Host " PC-DMIS 2016 exit code: $($p.ExitCode)" } else { Write-Warning "PC-DMIS 2016 installer not found in $hexDir (expected Pcdmis2016*x64.exe)" } # --- 3. Install PC-DMIS 2019 R2 --- if ($pcdmis19) { Write-Host "Installing PC-DMIS 2019 R2: $($pcdmis19.Name)..." $p = Start-Process -FilePath $pcdmis19.FullName -ArgumentList "-q INSTALLPDFCONVERTER=0 INSTALLOFFLINEHELP=0 HEIP=0 -norestart" -Wait -PassThru Write-Host " PC-DMIS 2019 exit code: $($p.ExitCode)" } else { Write-Warning "PC-DMIS 2019 installer not found in $hexDir (expected Pcdmis2019*x64.exe)" } Write-Host "=== CMM Setup Complete ==="