11using Microsoft . Extensions . Logging ;
22using Remotely . Shared . Models ;
3- using Remotely . Shared . Services ;
43using Remotely . Shared . Utilities ;
54using System ;
65using System . Collections . Generic ;
7- using System . Diagnostics ;
86using System . IO ;
97using System . Linq ;
108using System . Runtime . InteropServices ;
11- using System . Text ;
12- using System . Threading . Tasks ;
139
1410namespace Remotely . Agent . Services
1511{
@@ -22,7 +18,7 @@ public DeviceInfoGeneratorBase(ILogger<DeviceInfoGeneratorBase> logger)
2218 _logger = logger ;
2319 }
2420
25- public Device GetDeviceBase ( string deviceID , string orgID )
21+ protected Device GetDeviceBase ( string deviceID , string orgID )
2622 {
2723
2824 return new Device ( )
@@ -35,11 +31,12 @@ public Device GetDeviceBase(string deviceID, string orgID)
3531 OSDescription = RuntimeInformation . OSDescription ,
3632 Is64Bit = Environment . Is64BitOperatingSystem ,
3733 IsOnline = true ,
38- OrganizationID = orgID
39- } ;
34+ OrganizationID = orgID ,
35+ AgentVersion = AppVersionHelper . GetAppVersion ( )
36+ } ;
4037 }
4138
42- public ( double usedStorage , double totalStorage ) GetSystemDriveInfo ( )
39+ protected ( double usedStorage , double totalStorage ) GetSystemDriveInfo ( )
4340 {
4441 try
4542 {
@@ -77,24 +74,7 @@ public Device GetDeviceBase(string deviceID, string orgID)
7774 return ( 0 , 0 ) ;
7875 }
7976
80- public string GetAgentVersion ( )
81- {
82- try
83- {
84- if ( File . Exists ( "Remotely_Agent.dll" ) )
85- {
86- return FileVersionInfo . GetVersionInfo ( "Remotely_Agent.dll" ) . FileVersion . ToString ( ) . Trim ( ) ;
87- }
88- }
89- catch ( Exception ex )
90- {
91- _logger . LogError ( ex , "Error getting agent version." ) ;
92- }
93-
94- return "0.0.0.0" ;
95- }
96-
97- public List < Drive > GetAllDrives ( )
77+ protected List < Drive > GetAllDrives ( )
9878 {
9979 try
10080 {
0 commit comments