feat(controller): intial build functions setup in go and service building
This commit is contained in:
@@ -11,17 +11,16 @@ param (
|
||||
)
|
||||
|
||||
# Example string to run with the parameters in it.
|
||||
# .\scripts\services.ps1 -serviceName "LST_ctl" -option "install" -appPath "E:\LST" -description "Logistics Support Tool controller" -command "E:\LST\controller\lst_app.exe"
|
||||
# .C:\scripts\services.ps1 -serviceName "LST_ctl" -option "install" -appPath "E:\LST" -description "Logistics Support Tool controller" -command "E:\LST\controller\lst_ctl.exe"
|
||||
# .\scripts\services.ps1 -serviceName "LST_app" -option "install" -appPath "E:\LST" -description "Logistics Support Tool" -command "run start"
|
||||
|
||||
$nssmPath = $AppPath + "\nssm.exe"
|
||||
$npmPath = "C:\Program Files\nodejs\npm.cmd" # Path to npm.cmd
|
||||
|
||||
# Convert the plain-text password to a SecureString
|
||||
$securePass = ConvertTo-SecureString $admpass -AsPlainText -Force
|
||||
$credentials = New-Object System.Management.Automation.PSCredential($username, $securePass)
|
||||
|
||||
if($remote -eq "true"){
|
||||
# Convert the plain-text password to a SecureString
|
||||
$securePass = ConvertTo-SecureString $admpass -AsPlainText -Force
|
||||
$credentials = New-Object System.Management.Automation.PSCredential($username, $securePass)
|
||||
|
||||
# if(-not $username -or -not $admpass){
|
||||
# Write-host "Missing adm account info please try again."
|
||||
@@ -179,9 +178,9 @@ if($remote -eq "true"){
|
||||
|
||||
|
||||
& $nssmPath set $serviceName Description $description
|
||||
& $nssmPath set $serviceName AppStdout "E:\LST\logs\service.log"
|
||||
& $nssmPath set $serviceName AppStderr "E:\LST\logs\service-error.log"
|
||||
& $nssmPath set $serviceName DependOnService "MSSQLSERVER"
|
||||
& $nssmPath set $serviceName AppStdout "$($appPath)\logs\service.log"
|
||||
& $nssmPath set $serviceName AppStderr "$($appPath)\logs\service-error.log"
|
||||
#& $nssmPath set $serviceName DependOnService "MSSQLSERVER"
|
||||
# Set recovery options
|
||||
sc.exe failure $serviceName reset= 0 actions= restart/5000/restart/5000/restart/5000
|
||||
& $nssmPath start $serviceName
|
||||
|
||||
Reference in New Issue
Block a user