|
|
@ -135,7 +135,7 @@ Function Nssm-Install
|
|
|
|
|
|
|
|
|
|
|
|
if (!(Service-Exists -name $name))
|
|
|
|
if (!(Service-Exists -name $name))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$results = Nssm-Invoke "install ""$name"" $application"
|
|
|
|
$results = Nssm-Invoke "install ""$name"" ""$application"""
|
|
|
|
|
|
|
|
|
|
|
|
if ($LastExitCode -ne 0)
|
|
|
|
if ($LastExitCode -ne 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -159,7 +159,7 @@ Function Nssm-Install
|
|
|
|
|
|
|
|
|
|
|
|
if ($results -cnotlike $application)
|
|
|
|
if ($results -cnotlike $application)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$cmd = "set ""$name"" Application $application"
|
|
|
|
$cmd = "set ""$name"" Application ""$application"""
|
|
|
|
|
|
|
|
|
|
|
|
$results = Nssm-Invoke $cmd
|
|
|
|
$results = Nssm-Invoke $cmd
|
|
|
|
|
|
|
|
|
|
|
@ -179,7 +179,7 @@ Function Nssm-Install
|
|
|
|
if ($result.changed)
|
|
|
|
if ($result.changed)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$applicationPath = (Get-Item $application).DirectoryName
|
|
|
|
$applicationPath = (Get-Item $application).DirectoryName
|
|
|
|
$cmd = "nssm set ""$name"" AppDirectory $applicationPath"
|
|
|
|
$cmd = "nssm set ""$name"" AppDirectory ""$applicationPath"""
|
|
|
|
|
|
|
|
|
|
|
|
$results = invoke-expression $cmd
|
|
|
|
$results = invoke-expression $cmd
|
|
|
|
|
|
|
|
|
|
|
|