testing and generate
This commit is contained in:
parent
9743d7ee22
commit
3841aee4b2
24 changed files with 1087 additions and 610 deletions
|
|
@ -297,3 +297,19 @@ func EditService(name, startupType string) WinSvcResp {
|
|||
|
||||
return WinSvcResp{Success: true, ErrorMsg: ""}
|
||||
}
|
||||
|
||||
func ServiceExists(name string) (bool, error) {
|
||||
conn, err := mgr.Connect()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
defer conn.Disconnect()
|
||||
srv, err := conn.OpenService(name)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
defer srv.Close()
|
||||
return true, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue