wailsapp / wails

Create beautiful applications using Go
https://wails.io
MIT License
25.04k stars 1.2k forks source link

Compiled App does not work in Windows #2948

Closed StephanMa closed 1 year ago

StephanMa commented 1 year ago

Description

I developed an App which works perfect on Mac. wails dev . and build under Mac works like a charm without any problems. Compiling to windows/arm64 (for testing in Parallels) or windows/amd64 on my notebook works. But the app isn't shown. Window is opening and instantly closed.

// Create an instance of the app structure
    app := NewApp()

    // Create application with options
    err := wails.Run(&options.App{
        Title:  "METS2GO-Frontend",
        Width:  1024,
        Height: 768,
        AssetServer: &assetserver.Options{
            Assets: assets,
        },
        BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
        OnStartup:        app.startup,
        Bind: []interface{}{
            app,
        },
        Windows: &windows.Options{
            WebviewIsTransparent: false,
            WindowIsTranslucent:  false,
        },

        Mac: &mac.Options{
            TitleBar: &mac.TitleBar{
                TitlebarAppearsTransparent: false,
                HideTitle:                  false,
                HideTitleBar:               false,
                FullSizeContent:            false,
                UseToolbar:                 true,
                HideToolbarSeparator:       true,
            },
            Appearance:           mac.NSAppearanceNameDarkAqua,
            WebviewIsTransparent: false,
            WindowIsTranslucent:  false,
            About: &mac.AboutInfo{
                Title:   "testapp",
                Message: "© 2023 Stephan Makowski",
            },
        },
    })

To Reproduce

  1. Create windows app under Mac
  2. Compile app
  3. start to run app on Windows

Expected behaviour

I expect the app to show up or give an error.

Screenshots

No response

Attempted Fixes

wails build -platform windows/amd64 -webview2 embed -clean

Try to change webview2 to browser and enable debug... nothing works

System Details

Wails Doctor          

# Wails
Version | v2.6.0

# System
┌─────────────────────────┐
| OS           | MacOS    |
| Version      | 13.4     |
| ID           | 22F66    |
| Go Version   | go1.21.1 |
| Platform     | darwin   |
| Architecture | arm64    |
└─────────────────────────┘

# Dependencies
┌────────────────────────────────────────────────────────────────┐
| Dependency                | Package Name | Status    | Version |
| Xcode command line tools  | N/A          | Installed | 2397    |
| Nodejs                    | N/A          | Installed | 20.7.0  |
| npm                       | N/A          | Installed | 10.1.0  |
| *Xcode                    | N/A          | Available |         |
| *upx                      | N/A          | Available |         |
| *nsis                     | N/A          | Installed | v3.09   |
└─────────────────── * - Optional Dependency ────────────────────┘

Additional context

Dosen matter if Windows is arm64 or amd64.

stffabi commented 1 year ago

Have you tried a debug build 'wails build -debug -platform windows/arm64'? That should show you a console window with debug output.

StephanMa commented 1 year ago

Yes I tried.... Window pops and closes immediately

stffabi commented 1 year ago

Try starting it from a cmd.exe shell. That prevents closing the console window and loosing the output.

StephanMa commented 1 year ago

okay... 2023/09/27 19:26:11 noindex.htmlcould be found in your Assets fs.FS, please make sure the embedded directory 'frontend/dist' is correct and contains your assets

StephanMa commented 1 year ago
//go:embed all:frontend/dist
var assets embed.FS

is added

StephanMa commented 1 year ago

Allright.. Thanks for helping debugging this thing. I used a skeleton-sveltekit-tailwind-Template. I had to change the path for the build-dir will close

leaanthony commented 1 year ago

Perhaps open an issue for them to improve the docs?