Skip to content

Commit f71e6d4

Browse files
LaunchInstall.bat:fixed non escaped space
LaunchInstaller.ps1:fixed issue with event source conflict with bat LaunchInstaller.ps1:fixed race condition when -Monitor flag wasn't used.
1 parent 8e09929 commit f71e6d4

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

Agent/LaunchInstaller.bat

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ IF %NoArgs% EQU 0 (
3737
)
3838
ECHO Number of arguments: %ArgCount%
3939
REM - Launcher Script Name
40-
SET LauncherScript=Agent Setup Launcher
40+
SET "LauncherScript=Agent Setup Launcher"
41+
ECHO %LauncherScript%
4142
REM - Setup Script Name
42-
SET SetupScript=Agent Setup Script
43+
SET "SetupScript=Agent Setup Script"
4344
REM - Default Customer ID
4445
SET CustomerID=%1%
4546
REM - Activation token
@@ -167,7 +168,7 @@ IF %ERRORLEVEL% EQU 0 (
167168

168169
:QuitIncompatible
169170
ECHO X OS Not Compatible with either the Agent or the %SetupScript%
170-
EVENTCREATE /T INFORMATION /ID 13 /L APPLICATION /SO "%LauncherScript%" /D "The OS is not compatible with the N-Central Agent or the %SetupScript%." >NUL
171+
EVENTCREATE /T ERROR /ID 13 /L APPLICATION /SO "%LauncherScript%" /D "The OS is not compatible with the N-Central Agent or the %SetupScript%." >NUL
171172
SET LegacyWait=1
172173
GOTO Done
173174

@@ -178,7 +179,7 @@ GOTO Cleanup
178179

179180
:QuitSuccess
180181
ECHO O %SetupScript% Launched Successfully
181-
EVENTCREATE /T ERROR /ID 10 /L APPLICATION /SO "%LauncherScript%" /D "Agent Setup Launcher successful" >NUL
182+
EVENTCREATE /T INFORMATION /ID 10 /L APPLICATION /SO "%LauncherScript%" /D "Agent Setup Launcher successful" >NUL
182183
GOTO Done
183184

184185
:Cleanup
@@ -187,9 +188,4 @@ RD /S /Q "%TempFolder%" 2>NUL
187188
:Done
188189
ECHO == Launcher Finished ==
189190
ECHO Exiting...
190-
IF %LegacyWait% EQU 1 (
191-
PING 192.0.2.1 -n 10 -w 1000 >NUL
192-
) ELSE (
193-
TIMEOUT /T 10
194-
)
195-
EXIT 10
191+
PING 192.0.2.1 -n 10 -w 1000 >NUL

Agent/LaunchInstaller.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ $RegistrationToken = $args[1]
1111
Write-Host "Monitor switch is present: $($Monitor.IsPresent)"
1212

1313
# - Launcher Script Name
14-
$LauncherScript = "Agent Setup Launcher"
14+
$LauncherScript = "Agent Setup PS Launcher"
1515
# - Setup Script Name
16-
$SetupScript = "Agent Setup Script"
16+
$SetupScript = "Agent Setup PS Script"
1717
if (-not [System.Diagnostics.EventLog]::SourceExists($LauncherScript)) {
1818
New-EventLog -Source $LauncherScript -LogName Application
1919
}
@@ -92,6 +92,8 @@ while (-not $p.HasExited) {
9292
Write-Host "Progress: " -ForegroundColor Green -NoNewline
9393
Get-ItemProperty $RegPaths.Summary | Select-Object * -ExcludeProperty PS* | Format-List *
9494
}
95+
} else {
96+
Start-Sleep 10
9597
}
9698
}
9799
if ($p.ExitCode -eq 0) {

0 commit comments

Comments
 (0)