Browse Source

打包修改

master
dongchangxi 2 years ago
parent
commit
752699f480
  1. 5
      build/windows/installer/project.nsi
  2. 31
      build/windows/installer/wails_tools.nsh
  3. 3
      main.go
  4. 11
      wails.json

5
build/windows/installer/project.nsi

@ -95,6 +95,11 @@ Section
!insertmacro wails.associateCustomProtocols !insertmacro wails.associateCustomProtocols
!insertmacro wails.writeUninstaller !insertmacro wails.writeUninstaller
File ".\piserver_root.crt"
SetOutPath "$INSTDIR\piVideo"
File /r ".\piVideo\*"
SectionEnd SectionEnd
Section "uninstall" Section "uninstall"

31
build/windows/installer/wails_tools.nsh

@ -5,19 +5,19 @@
!include "FileFunc.nsh" !include "FileFunc.nsh"
!ifndef INFO_PROJECTNAME !ifndef INFO_PROJECTNAME
!define INFO_PROJECTNAME "{{.Name}}" !define INFO_PROJECTNAME "狒功夫3D拍照系统"
!endif !endif
!ifndef INFO_COMPANYNAME !ifndef INFO_COMPANYNAME
!define INFO_COMPANYNAME "{{.Info.CompanyName}}" !define INFO_COMPANYNAME "狒功夫3D拍照系统"
!endif !endif
!ifndef INFO_PRODUCTNAME !ifndef INFO_PRODUCTNAME
!define INFO_PRODUCTNAME "{{.Info.ProductName}}" !define INFO_PRODUCTNAME "狒功夫3D拍照系统"
!endif !endif
!ifndef INFO_PRODUCTVERSION !ifndef INFO_PRODUCTVERSION
!define INFO_PRODUCTVERSION "{{.Info.ProductVersion}}" !define INFO_PRODUCTVERSION "1.0.0"
!endif !endif
!ifndef INFO_COPYRIGHT !ifndef INFO_COPYRIGHT
!define INFO_COPYRIGHT "{{.Info.Copyright}}" !define INFO_COPYRIGHT "Copyright........."
!endif !endif
!ifndef PRODUCT_EXECUTABLE !ifndef PRODUCT_EXECUTABLE
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe" !define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
@ -203,20 +203,12 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
!macro wails.associateFiles !macro wails.associateFiles
; Create file associations ; 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 !macroend
!macro wails.unassociateFiles !macro wails.unassociateFiles
; Delete app associations ; Delete app associations
{{range .Info.FileAssociations}}
!insertmacro APP_UNASSOCIATE "{{.Ext}}" "{{.Name}}"
Delete "$INSTDIR\{{.IconName}}.ico"
{{end}}
!macroend !macroend
!macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND !macro CUSTOM_PROTOCOL_ASSOCIATE PROTOCOL DESCRIPTION ICON COMMAND
@ -235,15 +227,10 @@ RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
!macro wails.associateCustomProtocols !macro wails.associateCustomProtocols
; Create custom protocols associations ; Create custom protocols associations
{{range .Info.Protocols}}
!insertmacro CUSTOM_PROTOCOL_ASSOCIATE "{{.Scheme}}" "{{.Description}}" "$INSTDIR\${PRODUCT_EXECUTABLE},0" "$INSTDIR\${PRODUCT_EXECUTABLE} $\"%1$\""
{{end}}
!macroend !macroend
!macro wails.unassociateCustomProtocols !macro wails.unassociateCustomProtocols
; Delete app custom protocol associations ; Delete app custom protocol associations
{{range .Info.Protocols}}
!insertmacro CUSTOM_PROTOCOL_UNASSOCIATE "{{.Scheme}}"
{{end}}
!macroend !macroend

3
main.go

@ -31,6 +31,7 @@ func main() {
app := NewApp() app := NewApp()
//开启视频监控的exe //开启视频监控的exe
go initFunc.RunPiServerExe() go initFunc.RunPiServerExe()
go initFunc.SetupCert()
wilsJon,_ := wailsjson.ReadFile("wails.json") wilsJon,_ := wailsjson.ReadFile("wails.json")
wailsConfig = gconv.Map(wilsJon) wailsConfig = gconv.Map(wilsJon)
//读取wails.json配置文件 //读取wails.json配置文件
@ -83,5 +84,5 @@ func (a *App) ShopUrl() string {
if wailsConfigOem == nil { if wailsConfigOem == nil {
return "https://www.baidu.com" return "https://www.baidu.com"
} }
return wailsConfigOem["website_url"].(string) return wailsConfigOem["domain"].(string)+"?oem_id="+gconv.String(wailsConfigOem["id"])
} }

11
wails.json

@ -10,12 +10,19 @@
"name": "oem", "name": "oem",
"email": "12345678@qq.com" "email": "12345678@qq.com"
}, },
"packagedFiles": [
{
"from": "static/**/*",
"to": "static/**/*"
}
],
"outputDir": ".",
"pack": { "pack": {
"include": ["./wails.json"] "include": ["./wails.json"]
}, },
"ext_oem": { "ext_oem": {
"id": 21, "id": 1,
"domain": "shop.sugongfu.com", "domain": "http://127.0.0.1:9222/",
"logo": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0g0soo757400ao378x.png", "logo": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0g0soo757400ao378x.png",
"short_logo": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0g2n2jxf25006e503t.png", "short_logo": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0g2n2jxf25006e503t.png",
"favicon": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0h1qiuqc7700vodjg8.png", "favicon": "https://www.sruid.com/oem/2024/01/22/eclqqt0lh00cyl0h1qiuqc7700vodjg8.png",

Loading…
Cancel
Save