зеркало из https://github.com/softlandia/acadlib.git
0.0.1 minor
This commit is contained in:
Родитель
69a5f9fb9a
Коммит
c7ae6799c2
24
acadlib.go
24
acadlib.go
|
@ -20,39 +20,28 @@ func IsAutocadInstalled() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
//ReleaseAutocadInstalled - return string with release of AutoCAD installer in system
|
//ReleaseAutocadInstalled - return string with release of AutoCAD installer in system
|
||||||
//return "-" if Autocad not installed
|
//return "" if Autocad not installed
|
||||||
func ReleaseAutocadInstalled() string {
|
func ReleaseAutocadInstalled() string {
|
||||||
key, err := registry.OpenKey(registry.CURRENT_USER, _RegPathAcad, registry.QUERY_VALUE)
|
key, err := registry.OpenKey(registry.CURRENT_USER, _RegPathAcad, registry.QUERY_VALUE)
|
||||||
if err != nil {
|
|
||||||
return "-"
|
|
||||||
}
|
|
||||||
defer key.Close()
|
defer key.Close()
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
s, _, err := key.GetStringValue("CurVer")
|
s, _, err := key.GetStringValue("CurVer")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "-"
|
return ""
|
||||||
}
|
}
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
//RegPathAutocadLogFile - return string registry path to key store log file folder
|
//RegPathAutocadLogFile - return string registry path to key store log file folder
|
||||||
|
//on error return ""
|
||||||
func RegPathAutocadLogFile() string {
|
func RegPathAutocadLogFile() string {
|
||||||
if !IsAutocadInstalled() {
|
if !IsAutocadInstalled() {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
/* path := _RegPathAcad
|
|
||||||
key, err := registry.OpenKey(registry.CURRENT_USER, path, registry.QUERY_VALUE)
|
|
||||||
defer key.Close()
|
|
||||||
if err != nil {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
s, _, err := key.GetStringValue("CurVer")
|
|
||||||
if err != nil {
|
|
||||||
return ""
|
|
||||||
}*/
|
|
||||||
|
|
||||||
s := ReleaseAutocadInstalled()
|
s := ReleaseAutocadInstalled()
|
||||||
if s == "" {
|
if s == "" {
|
||||||
return ""
|
return ""
|
||||||
|
@ -78,6 +67,7 @@ func RegPathAutocadLogFile() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
//PathAutocadLogFile - return path to folder where AutoCAD store log file
|
//PathAutocadLogFile - return path to folder where AutoCAD store log file
|
||||||
|
//return "" on error
|
||||||
func PathAutocadLogFile() string {
|
func PathAutocadLogFile() string {
|
||||||
s := RegPathAutocadLogFile()
|
s := RegPathAutocadLogFile()
|
||||||
if s == "" {
|
if s == "" {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче