Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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

Powered by TurnKey Linux.