/Build Scripts/service-script-pre.ps1
Powershell | 25 lines | 23 code | 2 blank | 0 comment | 5 complexity | ad8af237d3b81608866f9ffe19e19ae4 MD5 | raw file
- $Path = Test-Path C:\Users\Jonathan\Documents\Adrenochrome
- if (-not $Path)
- {
- New-Item C:\Users\Jonathan\Documents\Adrenochrome -type directory
- }
-
- $Path = Test-Path C:\Users\Jonathan\Documents\Adrenochrome\FilterPlugins
- if (-not $Path)
- {
- New-Item C:\Users\Jonathan\Documents\Adrenochrome\FilterPlugins -type directory
- }
-
- $Service = Get-Service -display "AdrenochromeService" -ErrorAction SilentlyContinue
- if (-not $Service)
- {
- exit
- }
- else
- {
- if (get-service "AdrenochromeService" | where-object {$_.status -eq "running"})
- {
- stop-service "AdrenochromeService"
- }
- installutil /u "C:\Users\Jonathan\Documents\Adrenochrome\AdrenochromeService.exe"
- }