Skip to content

Commit

Permalink
1.打包名称修改
Browse files Browse the repository at this point in the history
  • Loading branch information
pwh-pwh committed Jul 29, 2024
1 parent 4334b41 commit 56f3565
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:
- name: 'App'
platform: 'linux/amd64'
os: 'ubuntu-latest'
- name: 'App.exe'
- name: 'ai-gui.exe'
platform: 'windows/amd64'
os: 'windows-latest'
- name: 'wailsdemo'
- name: 'ai-gui'
platform: 'darwin/universal'
os: 'macos-latest'

Expand Down
2 changes: 1 addition & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func NewApp() *App {
// so we can call the runtime methods
func (a *App) startup(ctx context.Context) {
a.ctx = ctx
InitWithApp()
utils.InitConfigPath()
fullFilePath := filepath.Join(utils.GetConfigPath(), CONFIG_FILE_NAME)
exists := utils.FileExists(fullFilePath)
Expand All @@ -51,7 +52,6 @@ func (a *App) startup(ctx context.Context) {
}
}
a.chat = service.GetChatByConfig(conf)
InitWithApp()
}

// 对接 /loadconf
Expand Down
31 changes: 9 additions & 22 deletions build/windows/installer/wails_tools.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
!include "FileFunc.nsh"

!ifndef INFO_PROJECTNAME
!define INFO_PROJECTNAME "{{.Name}}"
!define INFO_PROJECTNAME "ai-gui"
!endif
!ifndef INFO_COMPANYNAME
!define INFO_COMPANYNAME "{{.Info.CompanyName}}"
!define INFO_COMPANYNAME "ai-gui"
!endif
!ifndef INFO_PRODUCTNAME
!define INFO_PRODUCTNAME "{{.Info.ProductName}}"
!define INFO_PRODUCTNAME "ai-gui"
!endif
!ifndef INFO_PRODUCTVERSION
!define INFO_PRODUCTVERSION "{{.Info.ProductVersion}}"
!define INFO_PRODUCTVERSION "1.0.0"
!endif
!ifndef INFO_COPYRIGHT
!define INFO_COPYRIGHT "{{.Info.Copyright}}"
!define INFO_COPYRIGHT "Copyright........."
!endif
!ifndef PRODUCT_EXECUTABLE
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
Expand Down Expand Up @@ -203,20 +203,12 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"

!macro wails.associateFiles
; Create file associations
{{range .Info.FileAssociations}}
!insertmacro APP_ASSOCIATE "{{.Ext}}" "{{.Name}}" "{{.Description}}" "$INSTDIR\{{.IconName}}.ico" "Open with ${INFO_PRODUCTNAME}" "$INSTDIR\${PRODUCT_EXECUTABLE} $\"%1$\""

File "..\{{.IconName}}.ico"
{{end}}

!macroend

!macro wails.unassociateFiles
; Delete app associations
{{range .Info.FileAssociations}}
!insertmacro APP_UNASSOCIATE "{{.Ext}}" "{{.Name}}"

Delete "$INSTDIR\{{.IconName}}.ico"
{{end}}

!macroend

!macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND
Expand All @@ -235,15 +227,10 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"

!macro wails.associateCustomProtocols
; Create custom protocols associations
{{range .Info.Protocols}}
!insertmacro CUSTOM_PROTOCOL_ASSOCIATE "{{.Scheme}}" "{{.Description}}" "$INSTDIR\${PRODUCT_EXECUTABLE},0" "$INSTDIR\${PRODUCT_EXECUTABLE} $\"%1$\""

{{end}}

!macroend

!macro wails.unassociateCustomProtocols
; Delete app custom protocol associations
{{range .Info.Protocols}}
!insertmacro CUSTOM_PROTOCOL_UNASSOCIATE "{{.Scheme}}"
{{end}}

!macroend
2 changes: 1 addition & 1 deletion frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>wailsdemo</title>
<title>Ai-Gui</title>
</head>
<body>
<div id="app"></div>
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {

// Create application with options
err := wails.Run(&options.App{
Title: "wailsdemo",
Title: "Ai-Gui",
Width: 500,
Height: 668,
AssetServer: &assetserver.Options{
Expand Down
4 changes: 2 additions & 2 deletions wails.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://wails.io/schemas/config.v2.json",
"name": "wailsdemo",
"outputfilename": "wailsdemo",
"name": "ai-gui",
"outputfilename": "ai-gui",
"frontend:install": "npm install",
"frontend:build": "npm run build",
"frontend:dev:watcher": "npm run dev",
Expand Down
2 changes: 1 addition & 1 deletion windows_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func InitWithApp() {
wn, _ := syscall.UTF16PtrFromString("wailsdemo")
wn, _ := syscall.UTF16PtrFromString("Ai-Gui")
hwnd := win.FindWindow(nil, wn)
win.SetWindowLong(hwnd, win.GWL_EXSTYLE, win.GetWindowLong(hwnd, win.GWL_EXSTYLE)|win.WS_EX_LAYERED)
}

0 comments on commit 56f3565

Please sign in to comment.