fix assetPath on windows #354

Merged
sarah merged 4 commits from winassetPath into master 2020-10-28 23:58:16 +00:00
4 changed files with 4 additions and 1 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,6 +25,7 @@ import (
mrand "math/rand"
"os"
"os/user"
"path"
"path/filepath"
"runtime"
"time"
@ -168,8 +169,10 @@ func mainUi(flagLocal bool, flagClientUI bool) {
if runtime.GOOS == "windows" {
dir = "/" + dir
}
gcd.SetAssetPath("file://" + filepath.Join(dir, "assets") + "/")
// QML uses '/' regardless of platform (so we use path.Join here not filepath.Join)
gcd.SetAssetPath("file://" + path.Join(dir, "assets") + "/")
}
log.Infof("gcd.assetPath = '%v'\n", gcd.AssetPath())
if buildVer != "" {
gcd.SetVersion(buildVer)