Skip to content

wails3 mac 构建 windows .exe #4276

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

Open
f1748x opened this issue May 13, 2025 · 1 comment
Open

wails3 mac 构建 windows .exe #4276

f1748x opened this issue May 13, 2025 · 1 comment
Labels
Bug Something isn't working

Comments

@f1748x
Copy link

f1748x commented May 13, 2025

Description

错误:

Image

To Reproduce

1.执行task windows:package
2.修改文件
build/windows/Taskfile.yml

create:nsis:installer:
    summary: Creates an NSIS installer
    dir: build/windows/nsis
    deps:
      - task: build
        vars:
          PRODUCTION: "true"
    cmds:
      # Create the Microsoft WebView2 bootstrapper if it doesn't exist
      - wails3 generate webview2bootstrapper -dir "{{.ROOT_DIR}}/build/windows/nsis"
      - makensis -DARG_WAILS_{{.ARG_FLAG}}_BINARY="{{.ROOT_DIR}}/{{.BIN_DIR}}/{{.APP_NAME}}.exe" project.nsi
    vars:
      ARCH: '{{.ARCH | default ARCH}}'
      ARG_FLAG: '{{if eq .ARCH "amd64"}}AMD64{{else}}ARM64{{end}}'

  run:
    cmds:
      - '{{.BIN_DIR}}/{{.APP_NAME}}.exe'

Expected behaviour

尝试多次打包,去windows电脑打开应用提示:

Image

Screenshots

No response

Attempted Fixes

No response

System Details

# System 

┌─────────────────────────────────────────────────┐
| Name          | MacOS                           |
| Version       | 15.2                            |
| ID            | 24C101                          |
| Branding      | MacOS 15.2                      |
| Platform      | darwin                          |
| Architecture  | arm64                           |
| Apple Silicon | true                            |
| CPU           | Apple M1                        |
| CPU 1         | Apple M1                        |
| CPU 2         | Apple M1                        |
| GPU           | 8 cores, Metal Support: Metal 3 |
| Memory        | 16 GB                           |
└─────────────────────────────────────────────────┘

# Build Environment 

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
| Wails CLI      | v3.0.0-alpha.9                                                                                                            |
| Go Version     | go1.23.5                                                                                                                  |
| -buildmode     | exe                                                                                                                       |
| -compiler      | gc                                                                                                                        |
| CGO_CFLAGS     |                                                                                                                           |
| CGO_CPPFLAGS   |                                                                                                                           |
| CGO_CXXFLAGS   |                                                                                                                           |
| CGO_ENABLED    | 1                                                                                                                         |
| CGO_LDFLAGS    |                                                                                                                           |
| DefaultGODEBUG | asynctimerchan=1,gotypesalias=0,httpservecontentkeepheaders=1,tls3des=1,tlskyber=0,x509keypairleaf=0,x509negativeserial=1 |
| GOARCH         | arm64                                                                                                                     |
| GOARM64        | v8.0                                                                                                                      |
| GOOS           | darwin                                                                                                                    |
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

# Dependencies 

┌───────────────────────────┐
| npm             | 10.7.0  |
| *NSIS           | v3.11   |
| Xcode cli tools | 2409    |
└─ * - Optional Dependency ─┘

# Diagnosis 

 SUCCESS  Your system is ready for Wails development!

Additional context

No response

@f1748x f1748x added the Bug Something isn't working label May 13, 2025
@lysShub
Copy link

lysShub commented May 16, 2025

跨平台编译,肯定要指定目标系统和架构啊

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