Windows needs txt suffix

This commit is contained in:
Michal Horejsek
2020-12-11 09:44:05 +00:00
committed by Jakub Cuth
parent f59f68f894
commit e3332d1cb6

View File

@ -231,11 +231,15 @@ func (c *Config) getLicenseFilePath() string {
}
return "/Applications/" + appName + "/Contents/Resources/LICENSE"
case "windows":
path := filepath.Join(filepath.Dir(os.Args[0]), "LICENSE.txt")
if _, err := os.Stat(path); err == nil {
return path
}
// This should not happen, Windows should be handled by relative
// location to the binary above. This is just fallback which may
// or may not work, depends where user installed the app and how
// user started the app.
return filepath.FromSlash("C:/Program Files/Proton Technologies AG/ProtonMail Bridge/LICENSE")
return filepath.FromSlash("C:/Program Files/Proton Technologies AG/ProtonMail Bridge/LICENSE.txt")
}
return ""
}