| 1 | package appidentity |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "path/filepath" |
| 6 | "strings" |
| 7 | ) |
| 8 | |
| 9 | func validateShortcutPaths(root string, paths []string) error { |
| 10 | if !filepath.IsAbs(root) { |
| 11 | return fmt.Errorf("shortcut repair requires an absolute install root") |
| 12 | } |
| 13 | for _, path := range paths { |
| 14 | if !filepath.IsAbs(path) || !strings.EqualFold(filepath.Ext(path), ".lnk") { |
| 15 | return fmt.Errorf("shortcut repair requires absolute .lnk paths: %q", path) |
| 16 | } |
| 17 | } |
| 18 | return nil |
| 19 | } |
| 20 |