rename IE app GODT-690

This commit is contained in:
Jakub
2020-09-03 12:07:39 +02:00
parent bc07896436
commit bf6963859f
3 changed files with 60 additions and 51 deletions

View File

@ -37,7 +37,7 @@ import (
const ( const (
appName = "importExport" appName = "importExport"
appNameDash = "import-export" appNameDash = "import-export-app"
) )
var ( var (

View File

@ -830,7 +830,7 @@ Window {
property string bugNotSent property string bugNotSent
property string bugReportSent property string bugReportSent
property string programTitle : "ProtonMail Import-Export App" property string programTitle : "ProtonMail Import-Export app"
property string newversion : "q0.1.0" property string newversion : "q0.1.0"
property string landingPage : "https://landing.page" property string landingPage : "https://landing.page"
property string changelog : "• Lorem ipsum dolor sit amet\n• consetetur sadipscing elitr,\n• sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,\n• sed diam voluptua.\n• At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet." property string changelog : "• Lorem ipsum dolor sit amet\n• consetetur sadipscing elitr,\n• sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat,\n• sed diam voluptua.\n• At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet."

View File

@ -49,12 +49,6 @@ var (
var ( var (
log = logrus.WithField("pkg", "bridgeUtils/updates") //nolint[gochecknoglobals] log = logrus.WithField("pkg", "bridgeUtils/updates") //nolint[gochecknoglobals]
installFileSuffix = map[string]string{ //nolint[gochecknoglobals]
"darwin": ".dmg",
"windows": ".exe",
"linux": ".sh",
}
ErrDownloadFailed = errors.New("error happened during download") //nolint[gochecknoglobals] ErrDownloadFailed = errors.New("error happened during download") //nolint[gochecknoglobals]
ErrUpdateVerifyFailed = errors.New("cannot verify signature") //nolint[gochecknoglobals] ErrUpdateVerifyFailed = errors.New("cannot verify signature") //nolint[gochecknoglobals]
) )
@ -67,7 +61,8 @@ type Updates struct {
releaseFixedBugs string releaseFixedBugs string
updateTempDir string updateTempDir string
landingPagePath string // Based on Host/; default landing page for download. landingPagePath string // Based on Host/; default landing page for download.
installerFileBaseName string // File for initial install or manual reinstall. per goos [exe, dmg, sh]. winInstallerFile string // File for initial install or manual reinstall for windows
macInstallerFile string // File for initial install or manual reinstall for mac
versionFileBaseName string // Text file containing information about current file. per goos [_linux,_darwin,_windows].json (have .sig file). versionFileBaseName string // Text file containing information about current file. per goos [_linux,_darwin,_windows].json (have .sig file).
updateFileBaseName string // File for automatic update. per goos [_linux,_darwin,_windows].tgz (have .sig file). updateFileBaseName string // File for automatic update. per goos [_linux,_darwin,_windows].tgz (have .sig file).
linuxFileBaseName string // Prefix of linux package names. linuxFileBaseName string // Prefix of linux package names.
@ -85,7 +80,8 @@ func NewBridge(updateTempDir string) *Updates {
releaseFixedBugs: bridge.ReleaseFixedBugs, releaseFixedBugs: bridge.ReleaseFixedBugs,
updateTempDir: updateTempDir, updateTempDir: updateTempDir,
landingPagePath: "bridge/download", landingPagePath: "bridge/download",
installerFileBaseName: "Bridge-Installer", macInstallerFile: "Bridge-Installer.dmg",
winInstallerFile: "Bridge-Installer.exe",
versionFileBaseName: "current_version", versionFileBaseName: "current_version",
updateFileBaseName: "bridge_upgrade", updateFileBaseName: "bridge_upgrade",
linuxFileBaseName: "protonmail-bridge", linuxFileBaseName: "protonmail-bridge",
@ -103,11 +99,12 @@ func NewImportExport(updateTempDir string) *Updates {
releaseFixedBugs: importexport.ReleaseFixedBugs, releaseFixedBugs: importexport.ReleaseFixedBugs,
updateTempDir: updateTempDir, updateTempDir: updateTempDir,
landingPagePath: "import-export", landingPagePath: "import-export",
installerFileBaseName: "Import-Export-Installer", winInstallerFile: "ie/Import-Export-app-installer.exe",
macInstallerFile: "ie/Import-Export-app.dmg",
versionFileBaseName: "current_version_ie", versionFileBaseName: "current_version_ie",
updateFileBaseName: "ie_upgrade", updateFileBaseName: "ie/ie_upgrade",
linuxFileBaseName: "protonmail-import-export", linuxFileBaseName: "ie/protonmail-import-export-app",
macAppBundleName: "ProtonMail Import-Export.app", macAppBundleName: "Import-Export app.app",
} }
} }
@ -187,11 +184,15 @@ func (u *Updates) getLocalVersion(goos string) VersionInfo {
if goos == "linux" { if goos == "linux" {
pkgName := u.linuxFileBaseName pkgName := u.linuxFileBaseName
pkgRel := "1" pkgRel := "1"
pkgBase := strings.Join([]string{Host, DownloadPath, pkgName}, "/") pkgBaseFile := strings.Join([]string{Host, DownloadPath, pkgName}, "/")
versionInfo.DebFile = pkgBase + "_" + u.version + "-" + pkgRel + "_amd64.deb" pkgBasePath := DownloadPath + "/" + pkgName // add at least one dir
versionInfo.RpmFile = pkgBase + "-" + u.version + "-" + pkgRel + ".x86_64.rpm" pkgBasePath = filepath.Dir(pkgBasePath) // keep only last dir
versionInfo.PkgFile = strings.Join([]string{Host, DownloadPath, "PKGBUILD"}, "/") pkgBasePath = Host + "/" + pkgBasePath // add host in the end to not strip off double slash in URL
versionInfo.DebFile = pkgBaseFile + "_" + u.version + "-" + pkgRel + "_amd64.deb"
versionInfo.RpmFile = pkgBaseFile + "-" + u.version + "-" + pkgRel + ".x86_64.rpm"
versionInfo.PkgFile = strings.Join([]string{pkgBasePath, "PKGBUILD"}, "/")
} }
return versionInfo return versionInfo
@ -240,7 +241,14 @@ func (u *Updates) versionFileURL(goos string) string {
} }
func (u *Updates) installerFileURL(goos string) string { func (u *Updates) installerFileURL(goos string) string {
return strings.Join([]string{Host, DownloadPath, u.installerFileBaseName + installFileSuffix[goos]}, "/") installerFile := "none"
switch goos {
case "darwin":
installerFile = u.macInstallerFile
case "windows":
installerFile = u.winInstallerFile
}
return strings.Join([]string{Host, DownloadPath, installerFile}, "/")
} }
func (u *Updates) updateFileURL(goos string) string { func (u *Updates) updateFileURL(goos string) string {
@ -299,7 +307,8 @@ func (u *Updates) StartUpgrade(currentStatus chan<- Progress) { // nolint[funlen
status.UpdateDescription(InfoUpgrading) status.UpdateDescription(InfoUpgrading)
switch runtime.GOOS { switch runtime.GOOS {
case "windows": //nolint[goconst] case "windows": //nolint[goconst]
cmd := exec.Command("./" + u.installerFileBaseName) // nolint[gosec] installerFile := strings.Split(u.winInstallerFile, "/")[1]
cmd := exec.Command("./" + installerFile) // nolint[gosec]
cmd.Dir = u.updateTempDir cmd.Dir = u.updateTempDir
status.Err = cmd.Start() status.Err = cmd.Start()
case "darwin": case "darwin":