-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallCommand_ServiceUI.txt
More file actions
69 lines (50 loc) · 2.56 KB
/
InstallCommand_ServiceUI.txt
File metadata and controls
69 lines (50 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\ServiceUI.exe" `
-ArgumentList "-Process:explorer.exe `"$($adtSession.DirFiles)\TSScan_server.exe`"" `
-WindowStyle 'Normal' `
-WaitForChildProcesses
#Batch Method
@echo off
"%~dp0TSScan_server.exe"
## <Perform Installation tasks here>
Write-ADTLogEntry -Message "[v4.0.2] Launching TSScan Server interactive installer via ServiceUI + bat."
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\ServiceUI_x64.exe" `
-ArgumentList "-Process:explorer.exe `"$($adtSession.DirFiles)\Launch-TSScan.bat`"" `
-CreateNoWindow `
-WaitForChildProcesses
#VBS Method
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """" & CreateObject("Scripting.FileSystemObject").GetParentFolderName(WScript.ScriptFullName) & "\TSScan_server.exe""", 1, True
Set shell = Nothing
## <Perform Installation tasks here>
Write-ADTLogEntry -Message "[v4.0.2] Launching TSScan Server interactive installer via ServiceUI + vbs."
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\ServiceUI_x64.exe" `
-ArgumentList "-Process:explorer.exe wscript.exe `"$($adtSession.DirFiles)\Launch-TSScan.vbs`"" `
-CreateNoWindow `
-WaitForChildProcesses
#Session Method
## <Perform Installation tasks here>
# Get the active user's session ID dynamically
$activeSession = $adtSession.GetRunAsActiveUser().SessionId
Write-ADTLogEntry -Message "[v4.0.2] Active user session ID: $activeSession. Launching TSScan installer via ServiceUI -session."
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\ServiceUI_x64.exe" `
-ArgumentList "-session:$activeSession `"$($adtSession.DirFiles)\Launch-TSScan.bat`"" `
-WindowStyle 'Hidden' `
-WaitForChildProcesses
#GetADTLoggedonUser
## <Perform Installation tasks here>
# Get the active user's session ID dynamically
$activeSession = (Get-ADTLoggedOnUser | Where-Object { $_.IsActiveUserSession } | Select-Object -First 1).SessionId
Write-ADTLogEntry -Message "[v4.0.2] Active user session ID: $activeSession. Launching TSScan installer via ServiceUI -session."
Start-ADTProcess -FilePath "$($adtSession.DirFiles)\ServiceUI_x64.exe" `
-ArgumentList "-session:$activeSession `"$($adtSession.DirFiles)\Launch-TSScan.bat`"" `
-WindowStyle 'Hidden' `
-WaitForChildProcesses
#VBS Install
Dim fso, shell, installerPath
Set fso = CreateObject("Scripting.FileSystemObject")
Set shell = CreateObject("WScript.Shell")
installerPath = fso.GetParentFolderName(WScript.ScriptFullName) & "\TSScan_server.exe"
shell.Run Chr(34) & installerPath & Chr(34), 1, True
Set shell = Nothing
Set fso = Nothing