asticode / go-astilectron-demo

Discover the power of Astilectron through a demo app
MIT License
404 stars 83 forks source link

Windows 10 resources #40

Open exgolang opened 6 years ago

exgolang commented 6 years ago

Hello!. I compile the application on Linux Mint, the compilation was successful.

DEBU[0000] Creating /home/dev/go/src/github.com/unigreen/coin/output DEBU[0000] Bundling for environment linux/amd64
DEBU[0000] Binding data
DEBU[0000] Removing /tmp/astibundler/bind
DEBU[0000] Creating /tmp/astibundler/bind
DEBU[0000] Creating /tmp/astibundler/bind/vendor_astilectron_bundler DEBU[0000] Creating /tmp/astibundler/cache
DEBU[0000] /tmp/astibundler/cache/astilectron-0.29.0.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.29.0.zip DEBU[0000] Copying /tmp/astibundler/cache/astilectron-0.29.0.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/astilectron.zip DEBU[0000] /tmp/astibundler/cache/electron-linux-amd64-1.8.1.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-linux-x64.zip DEBU[0000] Copying /tmp/astibundler/cache/electron-linux-amd64-1.8.1.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/electron.zip DEBU[0000] Creating /tmp/astibundler/bind/resources
DEBU[0000] Copying /home/dev/go/src/github.com/unigreen/coin/resources to /tmp/astibundler/bind/resources DEBU[0000] Generating /home/dev/go/src/github.com/unigreen/coin/bind_linux_amd64.go DEBU[0005] Removing /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64 DEBU[0005] Creating /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64 DEBU[0005] Building for os linux and arch amd64
DEBU[0005] Executing go build -ldflags -s -X "main.AppName=unigreen" -X "main.BuiltAt=2018-10-23 00:15:44.239658681 +0300 EEST m=+5.759142607" -o /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64/binary github.com/unigreen/coin DEBU[0024] Moving /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64/binary to /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64/unigreen DEBU[0025] Bundling for environment windows/amd64
DEBU[0025] Binding data
DEBU[0025] Removing /tmp/astibundler/bind
DEBU[0025] Creating /tmp/astibundler/bind
DEBU[0025] Creating /tmp/astibundler/bind/vendor_astilectron_bundler DEBU[0025] Creating /tmp/astibundler/cache
DEBU[0025] /tmp/astibundler/cache/astilectron-0.29.0.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.29.0.zip DEBU[0025] Copying /tmp/astibundler/cache/astilectron-0.29.0.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/astilectron.zip DEBU[0025] /tmp/astibundler/cache/electron-windows-amd64-1.8.1.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-win32-x64.zip DEBU[0025] Copying /tmp/astibundler/cache/electron-windows-amd64-1.8.1.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/electron.zip DEBU[0025] Creating /tmp/astibundler/bind/resources
DEBU[0025] Copying /home/dev/go/src/github.com/unigreen/coin/resources to /tmp/astibundler/bind/resources DEBU[0025] Generating /home/dev/go/src/github.com/unigreen/coin/bind_windows_amd64.go DEBU[0033] Running rsrc for icon /home/dev/go/src/github.com/unigreen/coin/resources/icon.ico into /home/dev/go/src/github.com/unigreen/coin/windows.syso DEBU[0033] Removing /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64 DEBU[0033] Creating /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64 DEBU[0033] Building for os windows and arch amd64
DEBU[0033] Executing go build -ldflags -s -X "main.AppName=unigreen" -X "main.BuiltAt=2018-10-23 00:16:11.669579004 +0300 EEST m=+33.189062863" -H windowsgui -o /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64/binary github.com/unigreen/coin DEBU[0067] Moving /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64/binary to /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64/unigreen.exe

But when I test он that Windows 10, I get an Error

but if i add a folder C:\Users\admin\AppData\Roaming\unigreen\ +(resources), then the application starts normally, why the application does not transfer the folder resources at AppData?

What could be the reason? Thanks in advance for your reply.

asticode commented 6 years ago

Could you execute your application with the -v flag ? this will enable logs and show me how your app is provisioned.

exgolang commented 6 years ago

DEBU[0000] Creating /home/dev/go/src/github.com/unigreen/coin/output DEBU[0000] Bundling for environment linux/amd64 DEBU[0000] Binding data DEBU[0000] Removing /tmp/astibundler/bind DEBU[0000] Creating /tmp/astibundler/bind DEBU[0000] Creating /tmp/astibundler/bind/vendor_astilectron_bundler DEBU[0000] Creating /tmp/astibundler/cache DEBU[0000] /tmp/astibundler/cache/astilectron-0.29.0.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.29.0.zip DEBU[0000] Copying /tmp/astibundler/cache/astilectron-0.29.0.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/astilectron.zip DEBU[0000] /tmp/astibundler/cache/electron-linux-amd64-1.8.1.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-linux-x64.zip DEBU[0000] Copying /tmp/astibundler/cache/electron-linux-amd64-1.8.1.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/electron.zip DEBU[0000] Creating /tmp/astibundler/bind/resources DEBU[0000] Copying /home/dev/go/src/github.com/unigreen/coin/resources to /tmp/astibundler/bind/resources DEBU[0000] Generating /home/dev/go/src/github.com/unigreen/coin/bind_linux_amd64.go DEBU[0005] Removing /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64 DEBU[0005] Creating /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64 DEBU[0005] Building for os linux and arch amd64 DEBU[0005] Executing go build -ldflags -s -X "main.AppName=unigreen" -X "main.BuiltAt=2018-10-23 00:15:44.239658681 +0300 EEST m=+5.759142607" -o /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64/binary github.com/unigreen/coin DEBU[0024] Moving /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64/binary to /home/dev/go/src/github.com/unigreen/coin/output/linux-amd64/unigreen DEBU[0025] Bundling for environment windows/amd64 DEBU[0025] Binding data DEBU[0025] Removing /tmp/astibundler/bind DEBU[0025] Creating /tmp/astibundler/bind DEBU[0025] Creating /tmp/astibundler/bind/vendor_astilectron_bundler DEBU[0025] Creating /tmp/astibundler/cache DEBU[0025] /tmp/astibundler/cache/astilectron-0.29.0.zip already exists, skipping download of https://github.com/asticode/astilectron/archive/v0.29.0.zip DEBU[0025] Copying /tmp/astibundler/cache/astilectron-0.29.0.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/astilectron.zip DEBU[0025] /tmp/astibundler/cache/electron-windows-amd64-1.8.1.zip already exists, skipping download of https://github.com/electron/electron/releases/download/v1.8.1/electron-v1.8.1-win32-x64.zip DEBU[0025] Copying /tmp/astibundler/cache/electron-windows-amd64-1.8.1.zip to /tmp/astibundler/bind/vendor_astilectron_bundler/electron.zip DEBU[0025] Creating /tmp/astibundler/bind/resources DEBU[0025] Copying /home/dev/go/src/github.com/unigreen/coin/resources to /tmp/astibundler/bind/resources DEBU[0025] Generating /home/dev/go/src/github.com/unigreen/coin/bind_windows_amd64.go DEBU[0033] Running rsrc for icon /home/dev/go/src/github.com/unigreen/coin/resources/icon.ico into /home/dev/go/src/github.com/unigreen/coin/windows.syso DEBU[0033] Removing /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64 DEBU[0033] Creating /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64 DEBU[0033] Building for os windows and arch amd64 DEBU[0033] Executing go build -ldflags -s -X "main.AppName=unigreen" -X "main.BuiltAt=2018-10-23 00:16:11.669579004 +0300 EEST m=+33.189062863" -H windowsgui -o /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64/binary github.com/unigreen/coin DEBU[0067] Moving /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64/binary to /home/dev/go/src/github.com/unigreen/coin/output/windows-amd64/unigreen.exe

Running on windows 10. START ERROR

Not found C:\Users\admin\AppData\Roaming\unigreen\ resources folder, in folder project.

asticode commented 6 years ago

Ha sorry, I missed something. Could you also add this at the top of your main function:

flag.Parse()
astilog.FlagInit()

and run your app with the -v flag

This will enable the logging verbose when astilectron will provision your app.

exgolang commented 6 years ago

I'm sorry wrong, not windows 10 on windows 8. added:

flag.Parse()
astilog.FlagInit()

on Linux, when starting "./unigrin -v" (logging is triggered) runs perfectly. on Windows 8 when starting "start unigrin -v" (not logging is triggered)

asticode commented 6 years ago

On windows, could your run the .exe file directly with the -v flag?

DBHeise commented 5 years ago

I am able to reproduce this error exactly, and the output I get when I run the .exe with the "-v" switch is:

DEBU[0000] Running app built at app_name= source="main.go:33" DEBU[0000] Resources folder doesn't exist, restoring resources... app_name= source="run.go:225" DEBU[0000] Removing C:\Users\david\AppData\Roaming\resources app_name= source="run.go:338" DEBU[0000] Restoring resources in C:\Users\david\AppData\Roaming\resources app_name= source="run.go:345" DEBU[0000] Closing... app_name= source="astilectron.go:322" FATA[0000] running bootstrap failed: restoring resources failed: restoring resources failed: creating C:\Users\david\AppData\Roaming\resources\checksums.json failed: open C:\Users\david\AppData\Roaming\resources\checksums.json: The system cannot find the path specified. app_name= source="main.go:88"

It looks like the bootstrapper is defaulting to the "%APPDATA%" folder to look for the resources, when (based on my limited understanding) it should be looking in the local directory?

asticode commented 5 years ago

It seems like you didn't provide an app name 🤔 Could you try providing one in the Options?