Commit 32d876f0 authored by Amos Wenger's avatar Amos Wenger

windows: Add winox.FolderTypePrograms

parent df307352
Pipeline #14905 passed with stage
in 1 minute and 10 seconds
......@@ -18,6 +18,7 @@ const (
CSIDL_PROFILE = 0x0028
CSIDL_LOCAL_APPDATA = 0x001c
CSIDL_STARTMENU = 0x000b
CSIDL_PROGRAMS = 0x0002
)
const MAX_PATH = 260
......
......@@ -17,6 +17,7 @@ const (
FolderTypeAppData
FolderTypeLocalAppData
FolderTypeStartMenu
FolderTypePrograms
)
func GetFolderPath(folderType FolderType) (string, error) {
......@@ -30,6 +31,8 @@ func GetFolderPath(folderType FolderType) (string, error) {
csidl = syscallex.CSIDL_LOCAL_APPDATA
case FolderTypeStartMenu:
csidl = syscallex.CSIDL_STARTMENU
case FolderTypePrograms:
csidl = syscallex.CSIDL_PROGRAMS
default:
return "", errors.Errorf("Unknown folder type: %d", folderType)
}
......
......@@ -18,6 +18,7 @@ func Test_GetFolderPath(t *testing.T) {
tcase{name: "localAppData", typ: winox.FolderTypeLocalAppData},
tcase{name: "profile", typ: winox.FolderTypeProfile},
tcase{name: "startMenu", typ: winox.FolderTypeStartMenu},
tcase{name: "programs", typ: winox.FolderTypePrograms},
}
for _, cas := range cases {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment