From e3332d1cb669cf04596ae02a90257d91a04b7096 Mon Sep 17 00:00:00 2001 From: Michal Horejsek Date: Fri, 11 Dec 2020 09:44:05 +0000 Subject: [PATCH] Windows needs txt suffix --- pkg/config/config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 9d7fe942..f89b2c82 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -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 "" }