-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_plugin_windows.bat
65 lines (54 loc) · 1.51 KB
/
install_plugin_windows.bat
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
:: Copyright © 2024 Seagate Technology LLC and/or its Affiliates
@echo off
:: Check / get privileges
net file 1>NUL 2>NUL
if not '%errorlevel%' == '0' (
powershell Start-Process -FilePath "%0" -verb runas >NUL 2>&1
exit /b
) else (
:: If we just got privileges, drill back into the directory where the script is
cd /d %~dp0
)
:: Find the installer file
for %%I in (cloudfuse*.exe) do (
set "installer=%%I"
break
)
:: Check if the installer file exists and if so install it
if exist "%installer%" (
echo Installing Cloudfuse
"%installer%" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
) else (
echo Installer file not found
pause
exit /b
)
echo Installing plugin
:: Stop the VMS server
set serviceName="metavmsMediaServer"
echo Attempting to stop %serviceName%
net stop %serviceName% >NUL 2>&1
echo Service stopped successfully.
:: Copy the plugin file
echo Attempting to copy the plugin file
copy ".\cloudfuse_plugin.dll" "C:\Program Files\Network Optix\Nx Meta\MediaServer\plugins\"
set copyError=%errorlevel%
if %copyError% neq 0 (
echo Failed to copy the plugin file
)
:: Restart the VMS
echo Attempting to start %serviceName%
net start %serviceName% >NUL 2>&1
if %errorlevel% neq 0 (
echo Installation failed: Unable to restart %serviceName%. It must be restarted manually.
pause
exit /b
)
if %copyError% neq 0 (
echo Installation failed: Unable to copy plugin file
pause
exit /b
)
echo Service started successfully.
echo Finished installing Cloudfuse plugin
pause