v2.0.0
This commit is contained in:
commit
e455af7f1f
33 changed files with 8471 additions and 0 deletions
43
agent/software_windows_amd64.go
Normal file
43
agent/software_windows_amd64.go
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
Copyright 2022 AmidaWare LLC.
|
||||
|
||||
Licensed under the Tactical RMM License Version 1.0 (the “License”).
|
||||
You may only use the Licensed Software in accordance with the License.
|
||||
A copy of the License is available at:
|
||||
|
||||
https://license.tacticalrmm.com
|
||||
|
||||
*/
|
||||
|
||||
package agent
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
wapi "github.com/iamacarpet/go-win64api"
|
||||
trmm "github.com/wh1te909/trmm-shared"
|
||||
)
|
||||
|
||||
func (a *Agent) GetInstalledSoftware() []trmm.WinSoftwareList {
|
||||
ret := make([]trmm.WinSoftwareList, 0)
|
||||
|
||||
sw, err := wapi.InstalledSoftwareList()
|
||||
if err != nil {
|
||||
return ret
|
||||
}
|
||||
|
||||
for _, s := range sw {
|
||||
t := s.InstallDate
|
||||
ret = append(ret, trmm.WinSoftwareList{
|
||||
Name: CleanString(s.Name()),
|
||||
Version: CleanString(s.Version()),
|
||||
Publisher: CleanString(s.Publisher),
|
||||
InstallDate: fmt.Sprintf("%02d-%d-%02d", t.Year(), t.Month(), t.Day()),
|
||||
Size: ByteCountSI(s.EstimatedSize * 1024),
|
||||
Source: CleanString(s.InstallSource),
|
||||
Location: CleanString(s.InstallLocation),
|
||||
Uninstall: CleanString(s.UninstallString),
|
||||
})
|
||||
}
|
||||
return ret
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue