rename regAcad.go -> acadlib.go

This commit is contained in:
softland 2018-10-17 21:23:16 +03:00
Родитель 3760b5cfc1
Коммит b2063516df
1 изменённых файлов: 20 добавлений и 16 удалений

Просмотреть файл

@ -41,36 +41,40 @@ func RegPathAutocadLogFile() string {
return ""
}
path := _RegPathAcad
/* 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()
if s == "" {
return ""
}
path := _RegPathAcad + "\\" + s // s like "Software\Autodesk\AutoCAD\R19.0"
key, err := registry.OpenKey(registry.CURRENT_USER, path, registry.QUERY_VALUE)
defer key.Close()
if err != nil {
return ""
}
s, _, err := key.GetStringValue("CurVer")
s, _, err = key.GetStringValue("CurVer") // s like "ACAD-B001:409"
if err != nil {
return ""
}
path = path + "\\" + s
path = path + "\\" + s // s like "Software\Autodesk\AutoCAD\R19.0\ACAD-B001:409\Profiles\<<Unnamed Profile>>\Editor Configuration"
key, err = registry.OpenKey(registry.CURRENT_USER, path, registry.QUERY_VALUE)
if err != nil {
return ""
}
s, _, err = key.GetStringValue("CurVer")
if err != nil {
return ""
}
path = path + "\\" + s
key, err = registry.OpenKey(registry.CURRENT_USER, path, registry.QUERY_VALUE)
if err != nil {
return ""
}
return path + _RegPathAcadEditor
return path + _RegPathAcadEditor // s like "Software\Autodesk\AutoCAD\R19.0\ACAD-B001:409\"
}
//PathAutocadLogFile - return path to folder where AutoCAD store log file