| 1 | //go:build windows |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import ( |
| 6 | "os" |
| 7 | |
| 8 | "reasonix/internal/appidentity" |
| 9 | "reasonix/internal/installlayout" |
| 10 | ) |
| 11 | |
| 12 | func init() { |
| 13 | if err := appidentity.ApplyToCurrentProcess(); err != nil { |
| 14 | println("Warning: apply Windows app identity:", err.Error()) |
| 15 | } |
| 16 | executable, err := os.Executable() |
| 17 | if err != nil { |
| 18 | return |
| 19 | } |
| 20 | installRoot, err := installlayout.ResolveInstallRoot(executable) |
| 21 | if err != nil { |
| 22 | return |
| 23 | } |
| 24 | if err := appidentity.RepairOwnedShortcuts(installRoot); err != nil { |
| 25 | println("Warning: repair Windows shortcut identity:", err.Error()) |
| 26 | } |
| 27 | } |
| 28 |