Skip to content

Commit

Permalink
renamed notification provider in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
F0903 committed Sep 7, 2024
1 parent 85c5b65 commit cfad2b8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion install_service.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Assert-Admin($MyInvocation.MyCommand.Definition)

sc.exe create $ServiceName binPath=$Dir start=auto displayname=$ServiceName
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name $NotifierName -Value $NotifierPath -PropertyType "String" -ErrorAction Stop
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name $ProxyName -Value $ProxyPath -PropertyType "String" -ErrorAction Stop

& "$($PSScriptRoot)\start_service.ps1"

Expand Down
2 changes: 1 addition & 1 deletion start_service.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Assert-Admin($MyInvocation.MyCommand.Definition)

sc.exe start $ServiceName
Start-Process -FilePath $NotifierPath -ErrorAction Stop
Start-Process -FilePath $ProxyPath -ErrorAction Stop
2 changes: 1 addition & 1 deletion stop_service.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Assert-Admin($MyInvocation.MyCommand.Definition)

sc.exe stop $ServiceName
Stop-Process -Name $NotifierName
Stop-Process -Name $ProxyName
2 changes: 1 addition & 1 deletion uninstall_service.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Assert-Admin($MyInvocation.MyCommand.Definition)

sc.exe delete $ServiceName

Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "AutoPower Notification Provider"
Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "AutoPower Proxy"

Remove-Item -LiteralPath "$env:TEMP\autopower" -Force -Recurse
Write-Output "Deleted autopower log directory."
Expand Down
4 changes: 2 additions & 2 deletions variables.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$Global:ServiceName = "AutoPower"
$Global:Dir = "$($PSScriptRoot)\autopower.exe"
$Global:NotifierPath = "$($PSScriptRoot)\autopower_notification_provider.exe"
$Global:NotifierName = "AutoPower Notification Provider"
$Global:ProxyPath = "$($PSScriptRoot)\autopower_proxy.exe"
$Global:ProxyName = "AutoPower Proxy"

function Assert-Admin($script_definition) {
$User = [Security.Principal.WindowsIdentity]::GetCurrent()
Expand Down

0 comments on commit cfad2b8

Please sign in to comment.