You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 line
1.1KB

  1. [CmdletBinding()]
  2. param(
  3. [string]$ProjectRoot
  4. )
  5. if (-not $ProjectRoot) {
  6. $ProjectRoot = Split-Path -Parent $PSScriptRoot
  7. }
  8. $components = @(
  9. # Framework/ is the only thing genuinely shared between the production
  10. # and test-app sites. Controllers/ is production's own; SelfTestController
  11. # is test-app-specific and lives under test-app/ instead. See
  12. # docs/ARCHITECTURE.md.
  13. (Join-Path $ProjectRoot 'Framework\RequestContext.wsc'),
  14. (Join-Path $ProjectRoot 'Framework\Application.wsc'),
  15. (Join-Path $ProjectRoot 'Controllers\HomeController.wsc'),
  16. (Join-Path $ProjectRoot 'test-app\Controllers\SelfTestController.wsc')
  17. )
  18. foreach ($path in $components) {
  19. if (-not (Test-Path $path)) {
  20. throw "Component not found: $path"
  21. }
  22. Write-Output "Registering $path"
  23. $proc = Start-Process -FilePath 'regsvr32.exe' -ArgumentList "/s `"$path`"" -PassThru -Wait -WindowStyle Hidden
  24. if ($proc.ExitCode -ne 0) {
  25. throw "regsvr32 failed for $path (exit $($proc.ExitCode))"
  26. }
  27. }
  28. Write-Output "All WSC-MVC components registered."

Powered by TurnKey Linux.