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.

36 line
1.2KB

  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\Router.wsc'),
  15. (Join-Path $ProjectRoot 'Framework\ViewRenderer.wsc'),
  16. (Join-Path $ProjectRoot 'Framework\Database.wsc'),
  17. (Join-Path $ProjectRoot 'Framework\Application.wsc'),
  18. (Join-Path $ProjectRoot 'Controllers\HomeController.wsc'),
  19. (Join-Path $ProjectRoot 'test-app\Controllers\SelfTestController.wsc')
  20. )
  21. foreach ($path in $components) {
  22. if (-not (Test-Path $path)) {
  23. throw "Component not found: $path"
  24. }
  25. Write-Output "Registering $path"
  26. $proc = Start-Process -FilePath 'regsvr32.exe' -ArgumentList "/s `"$path`"" -PassThru -Wait -WindowStyle Hidden
  27. if ($proc.ExitCode -ne 0) {
  28. throw "regsvr32 failed for $path (exit $($proc.ExitCode))"
  29. }
  30. }
  31. Write-Output "All WSC-MVC components registered."

Powered by TurnKey Linux.