Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wails exe not opening on windows #3182

Closed
riyanswat opened this issue Jan 7, 2024 · 2 comments
Closed

wails exe not opening on windows #3182

riyanswat opened this issue Jan 7, 2024 · 2 comments
Labels
Bug Something isn't working

Comments

@riyanswat
Copy link

riyanswat commented Jan 7, 2024

Description

When I run wails dev, it works fine but when I run wails build and it generates the exe, it just won't even open. I've been trying it for a week. I changed the project structure but still facing the same issue. Here's the source code: https://github.com/riyanswat/wails_pos

(It was actually a password manager... everything is still the same as that but I generated a new wails project and copied the code over to this project.)

When I generate the wails boilerplate code and make an exe out of it using wails build, it works fine but when I add the code, it just won't open.

To Reproduce

Run wails build and try to run the executable in build/bin

Expected behaviour

It should work the same as it does in dev mode (wails dev)

Screenshots

No response

Attempted Fixes

  • I changed the project structure.
  • generated a new wails boilerplate using wails init and copied the code but it won't work.
  • ran wails build with -debug and -windowsconsole but didn't work
  • uninstalled and reinstalled wails, node/npm, Go

System Details

e:\wails_pos\POS>wails doctor


          Wails Doctor



# Wails
Version | v2.7.0

# System
┌─────────────────────────────────────────────────────────────────────────────────────┐
| OS           | Windows 10 Pro                                                       |
| Version      | 2009 (Build: 19045)                                                  |
| ID           | 22H2                                                                 |
| Go Version   | go1.21.2                                                             |
| Platform     | windows                                                              |
| Architecture | amd64                                                                |
| CPU          | Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz                             |
| GPU          | Intel(R) HD Graphics 3000 (Intel Corporation) - Driver: 9.17.10.4459 |
| Memory       | 6GB                                                                  |
└─────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies
┌───────────────────────────────────────────────────────┐
| Dependency | Package Name | Status    | Version       |
| WebView2   | N/A          | Installed | 120.0.2210.91 |
| Nodejs     | N/A          | Installed | 21.4.0        |
| npm        | N/A          | Installed | 10.2.4        |
| *upx       | N/A          | Available |               |
| *nsis      | N/A          | Available |               |
└─────────────── * - Optional Dependency ───────────────┘

# Diagnosis
Optional package(s) installation details:
  - upx : Available at https://upx.github.io/
  - nsis : More info at https://wails.io/docs/guides/windows-installer/

 SUCCESS  Your system is ready for Wails development!

 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Additional context

When I run wails build on the boilerplate (auto generated) code and run the exe, it works fine. Also, in dev mode, my app works as expected but the issue is with the exe file.

@riyanswat riyanswat added the Bug Something isn't working label Jan 7, 2024
@leaanthony
Copy link
Member

main.go:13 - you removed the embed comment so Go isn't embedding your files

https://pkg.go.dev/embed

@riyanswat
Copy link
Author

main.go:13 - you removed the embed comment so Go isn't embedding your files

https://pkg.go.dev/embed

Thanks! It worked. I had deleted this comment, thinking it was unnecessary: //go:embed frontend/dist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants