From 0b472512ed046508d7ffbe9acd5bda298830a61f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 4 Dec 2018 14:57:18 +0100 Subject: [PATCH] Set SMARTGIT_JAVA_HOME environment variable --- CHANGELOG.md | 6 ++++++ main.go | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cc39c4..28a8695 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 18.2.0-3 (2018/12/04) + +* SmartGit 18.2 works only on 64-bits systems +* Set `SMARTGIT_JAVA_HOME` environment variable +* Include our own jre + ## 18.2.0-2 (2018/12/01) * Upgrade to SmartGit 18.2.0 diff --git a/main.go b/main.go index ff5317b..416e8f4 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,6 @@ package main import ( "os" - "runtime" "strings" . "github.com/portapps/portapps" @@ -17,14 +16,9 @@ func init() { } func main() { - smartgitExe := "smartgit32.exe" - if runtime.GOARCH == "amd64" { - smartgitExe = "smartgit.exe" - } - Papp.AppPath = AppPathJoin("app") Papp.DataPath = CreateFolder(AppPathJoin("data")) - Papp.Process = PathJoin(Papp.AppPath, "bin", smartgitExe) + Papp.Process = PathJoin(Papp.AppPath, "bin", "smartgit.exe") Papp.Args = nil Papp.WorkingDir = PathJoin(Papp.AppPath, "bin") @@ -54,5 +48,8 @@ func main() { Log.Errorf("Cannot write system smartgit.vmoptions: %s", err) } + // set JAVA_HOME + OverrideEnv("SMARTGIT_JAVA_HOME", PathJoin(Papp.AppPath, "jre")) + Launch(os.Args[1:]) }