Compare commits

..

87 Commits

Author SHA1 Message Date
Lea Anthony d24d82f86d Rename exp -> v3 2023-01-18 21:34:11 +11:00
Lea Anthony 81e9223124 Merge branch 'master' into future/exp 2023-01-18 21:27:30 +11:00
Lea Anthony 2374bb7e0e Update clir 2023-01-18 20:57:31 +11:00
Lea Anthony 4c42ef9710 Create generate bindings command 2023-01-18 20:19:12 +11:00
stffabi b4d64678b5 Basic integration of the assetserver 2023-01-18 09:31:09 +01:00
Lea Anthony a4f729a6a0 Rename parser package.
Fix linting issues
Add README.md
2023-01-18 08:22:31 +11:00
Lea Anthony 8e593e9c35 Start of TS models generation support 2023-01-17 18:57:35 +11:00
Lea Anthony 0a09363db7 Support struct discovery over multiple files 2023-01-17 07:45:41 +11:00
Lea Anthony b0b96c9838 Support struct discovery in methods 2023-01-16 20:30:05 +11:00
Lea Anthony 8bbf5ff3f1 Recursive bound model discovery implemented 2023-01-15 20:25:42 +11:00
Lea Anthony 572fbc9705 Initial parsing to discover bound struct names 2023-01-13 17:35:43 +11:00
Lea Anthony f371b513d1 Fix name of Window menu in role 2023-01-13 17:33:54 +11:00
Lea Anthony e5d3803fc1 Initial runtime builds
Added Taskfile for fast runtime builds
2023-01-08 21:06:31 +11:00
Lea Anthony 06a0377963 Fix frameless
Add rounded corners for frameless
Create NSWindow subclass
Add pre-post build hooks
2023-01-07 11:26:46 +11:00
Lea Anthony 62a5509390 Do not display internal tasks when using wails task list 2023-01-06 20:20:40 +11:00
Lea Anthony 54805d99a0 Remove New from Dialog methods 2023-01-06 20:19:20 +11:00
Lea Anthony d1e2ee452f Integrate Task 2023-01-05 15:02:08 +11:00
Lea Anthony b5127d95ff Add EnableFraudulentWebsiteWarnings feature
Co-authored-by: stffabi <stffabi@users.noreply.github.com>
2023-01-04 20:12:28 +11:00
Lea Anthony 174a31b49a Add run command for running tasks in a Taskfile.yml
Add `generate` command for generating assets
Add build example
2023-01-04 20:01:13 +11:00
Lea Anthony 746b4dfc04 Fix sizes bug
Remove redundant menu package
2023-01-03 05:43:56 +11:00
Lea Anthony e5da0eb5f8 Add icon generation
Add syso generation
Add tests
2023-01-02 21:23:44 +11:00
Lea Anthony f4044ebcd9 Add icon tool 2023-01-02 08:23:29 +11:00
Lea Anthony bc7d8295ba Refactor window -> webviewwindow 2023-01-02 05:48:52 +11:00
Lea Anthony 71fb7fadff Merge branch 'chore/move_assetserver_to_pkg' into future/exp 2022-12-31 13:08:34 +11:00
Lea Anthony be240795e2 Refactor assetserver into pkg 2022-12-31 11:01:24 +11:00
Lea Anthony cf5def05a6 Refactor application API to use options by default. Updated examples. 2022-12-31 10:38:36 +11:00
Lea Anthony ad802a3ad0 Frameless support
applicationShouldTerminateAfterLastWindowClosed support
2022-12-30 14:14:28 +11:00
Lea Anthony 287039a8f3 Task experiment 2022-12-28 19:17:38 +11:00
Lea Anthony ad1d104d85 Add screen support
Co-authored-by: Oleg Gulevskyy <43781031+oleggulevskyy@users.noreply.github.com>
2022-12-28 14:09:13 +11:00
Lea Anthony 92af7455ad Support Show/Hide window
Better demo
window.Run() -> window.Show()
2022-12-27 21:15:43 +11:00
Lea Anthony b6b6acf1d9 Remove debug printfs 2022-12-27 15:31:24 +11:00
Lea Anthony 5187641e25 Remove C.toggleFullscreen 2022-12-27 15:29:57 +11:00
Lea Anthony 41779866c4 Disable fullscreen button if there are size constraints 2022-12-27 13:42:57 +11:00
Lea Anthony f800222781 Allow SetSize to adjust min/max constraints 2022-12-27 09:38:00 +11:00
Lea Anthony 0c364b2813 Fix sizing of window/contentrect
Fix set min/max size
Ignore SetSize when in fullscreen
Disable size constraints when going fullscreen
2022-12-27 09:23:54 +11:00
Lea Anthony 7dbb8c1377 Improve Minimise, Maximise
Add Restore
setAutoenablesItems:NO
2022-12-26 20:21:51 +11:00
Lea Anthony 6a0c101b08 Fix dialog ID issue
Use map instead of uint for dialog IDs
2022-12-24 20:40:34 +11:00
Lea Anthony f240f2100c Refactor mainthread dispatch 2022-12-24 15:35:04 +11:00
Lea Anthony 2b91ced1b7 Support SetPosition
Optimise event listener callbacks
2022-12-24 13:38:48 +11:00
Lea Anthony b7f1defbf3 NavigateToURL -> SetURL
Fixed typo in colour
Removed EnableDevTools
2022-12-23 23:18:28 +11:00
Lea Anthony 2946a0aa25 GetCurrentWindow -> CurrentWindow 2022-12-23 19:55:54 +11:00
Lea Anthony b043126031 Add open file dialog filters
Add clipboard
Fix mouse event handling
2022-12-23 07:34:12 +11:00
Lea Anthony 4d58b56d54 Improve dialogs 2022-12-21 21:30:26 +11:00
Lea Anthony 025e8d7645 Add SaveFileDialog
Add Toolbar Styles
Add Invisible Titlebar option with drag support
2022-12-20 21:49:19 +11:00
Lea Anthony e7abe1c606 Add Webview navigation events
Add HTML/JS/CSS in config
Add RenderHTML()
Tidy up window delegate
2022-12-19 21:17:50 +11:00
Lea Anthony ea1f086289 OpenDialog attach to window & multiple files selection 2022-12-19 08:26:59 +11:00
Lea Anthony b1e8f2f887 Start of file dialogs 2022-12-18 23:06:31 +11:00
Lea Anthony 45adc49683 Add application icon support
Add message dialog support
Add default icons
Add png to byte slice task
Fixed kitchen sink
2022-12-18 13:06:03 +11:00
Lea Anthony 2409984aab Add application about dialog
Add application icon support
2022-12-18 00:40:53 +11:00
Lea Anthony 8f9eeb8055 Improve menu demo 2022-12-17 20:49:58 +11:00
Lea Anthony a8d5f185c2 Fix resizing bug
Refactor some application setters
2022-12-17 20:49:46 +11:00
Lea Anthony bbb418f98f Fix submenu radio processing 2022-12-17 20:49:04 +11:00
Lea Anthony f8eb680559 Add Window & Help menus
Fix min/max sizing
2022-12-17 19:56:29 +11:00
Lea Anthony da5fa806d7 Add Zoom In/Out & Actual size roles 2022-12-16 21:28:16 +11:00
Lea Anthony 88f6a3d1b9 Refactor and support more roles 2022-12-16 21:09:31 +11:00
Lea Anthony 475880c0a8 Add services, hide, hideothers, unhide role
Add application.Name()
refactor roles
Add app menu role
2022-12-16 21:06:49 +11:00
Lea Anthony faf418eac0 Add global reference for application
Add default application meu for Mac
Add window example
Fix invalid accelerator error logging
2022-12-15 21:21:19 +11:00
Lea Anthony f35b8dfec5 Refactor Application
Add SetActivationPolicy
Added labels to menus
2022-12-15 18:06:09 +11:00
Lea Anthony 14fcfb8348 Refactor event types 2022-12-15 18:03:01 +11:00
Lea Anthony f84c4aca72 Refactor message processing functions 2022-12-15 08:01:49 +11:00
Lea Anthony dad7798da9 New Systray example 2022-12-15 08:01:21 +11:00
Lea Anthony 79af667b7a Support Menu Accelerators 2022-12-15 08:00:49 +11:00
Lea Anthony d84cb5b190 Fix enabled menuitem 2022-12-14 19:15:58 +11:00
Lea Anthony 7c18f25508 Support radio menuitems
Support systemtray destroy()
2022-12-14 19:03:27 +11:00
Lea Anthony 085de606ee Support submenus 2022-12-14 08:48:17 +11:00
Lea Anthony c7ac90def4 Support template icons 2022-12-14 08:26:52 +11:00
Lea Anthony bb36ce61bc Refactor dispatching 2022-12-14 07:52:10 +11:00
Lea Anthony a35a876094 Add support for system tray + menus 2022-12-13 21:54:12 +11:00
Lea Anthony f38c6c6d1c Add Fatal() 2022-12-11 20:05:00 +11:00
Lea Anthony f6a16950f2 Add Window methods Width(), Height(), Size() + Position()
Fix main thread locking issue
Add Window aliases
2022-12-11 19:57:20 +11:00
Lea Anthony ddb2f63f7b Support Window aliases 2022-12-11 14:39:53 +11:00
Lea Anthony bf8e541221 Support Window events
Convert events to uint
Rename system events to application events
2022-12-11 13:01:38 +11:00
Lea Anthony 4a2cf597c2 Fix resizable 2022-12-11 11:26:21 +11:00
Lea Anthony 27370559d3 Refactor Is* methods
Add more events
2022-12-11 11:09:52 +11:00
Lea Anthony a134bfac42 Add Center
Add more events
2022-12-10 22:34:15 +11:00
Lea Anthony d5e21d5003 Fix race condition in closing window during navigating
Add sane defaults
2022-12-09 08:22:17 +11:00
Lea Anthony 85abb1122f Add main thread dispatching
Make `window.Run` operate on main thread
2022-12-09 07:47:47 +11:00
Lea Anthony 0257362a86 Support per-window message dispatching 2022-12-08 23:06:27 +11:00
Lea Anthony 1872672d0c Support appearance 2022-12-08 18:20:04 +11:00
Lea Anthony 644655662e Support toolbar config 2022-12-08 18:09:02 +11:00
Lea Anthony 508bbb4fb4 Support Min/Max/Fullscreen, BackgroundColour 2022-12-08 17:25:39 +11:00
Lea Anthony cb9df61a98 Support MacBackdrop type
Fix devtools window error
2022-12-08 07:47:04 +11:00
Lea Anthony ab976e56af Support ExecJS 2022-12-07 23:58:45 +11:00
Lea Anthony df1cc2ee0b Support EnableDevTools 2022-12-07 23:52:16 +11:00
Lea Anthony af6daa273e Support min/max window size 2022-12-07 23:44:19 +11:00
Lea Anthony 05803fb5d5 Add more Window API 2022-12-07 23:30:20 +11:00
Lea Anthony 5a37091bb0 Initial play around 2022-12-07 21:55:09 +11:00
466 changed files with 7387 additions and 19096 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
name: Build + Test v2
name: Build + Test
on:
push:
+1 -1
View File
@@ -141,7 +141,7 @@ func (a *App) start() error {
// Defer the shutdown
defer a.shutdown()
// Run the renderer
// run the renderer
err = a.renderer.Run()
if err != nil {
return err
-33
View File
@@ -1,33 +0,0 @@
atomicgo.dev/assert v0.0.2/go.mod h1:ut4NcI3QDdJtlmAxQULOmA13Gz6e2DWbSAS8RUOmNYQ=
github.com/MarvinJWendt/testza v0.5.1/go.mod h1:L7csM8IBqCc0HH4TRYZSPCIRg6zJeqzM1pm3FSYZBso=
github.com/atomicgo/cursor v0.0.1 h1:xdogsqa6YYlLfM+GyClC/Lchf7aiMerFiZQn7soTOoU=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568 h1:BHsljHzVlRcyQhjrss6TZTdY2VfCqZPbv5k3iBFa2ZQ=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/renameio/v2 v2.0.0 h1:UifI23ZTGY8Tt29JbYFiuyIU3eX+RNFtUwefq9qAhxg=
github.com/jessevdk/go-flags v1.5.0 h1:1jKYvbxEjfUl0fmqTCOfonvskHHXMjBySTLW4y9LFvc=
github.com/klauspost/cpuid/v2 v2.2.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
github.com/pkg/sftp v1.10.1 h1:VasscCm72135zRysgrJDKsntdmPN+OuU3+nnHYA9wyc=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 h1:Hir2P/De0WpUhtrKGGjvSb2YxUgyZ7EFOSLIcSSpiwE=
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
gopkg.in/errgo.v2 v2.1.0 h1:0vLT13EuvQ0hNvakwLuFZ/jYrLp5F3kcWHXdRggjCE8=
mvdan.cc/editorconfig v0.2.0 h1:XL+7ys6ls/RKrkUNFQvEwIvNHh+JKx8Mj1pUV5wQxQE=
+1 -1
View File
@@ -55,7 +55,7 @@ func newIPCMessage(incomingMessage string, responseFunction func(*ipcResponse) e
// hasCallbackID checks if the message can send an error back to the frontend
func (m *ipcMessage) hasCallbackID() error {
if m.CallbackID == "" {
return fmt.Errorf("attempted to return error to message with no Callback ID")
return fmt.Errorf("attempted to return error to message with no callback ID")
}
return nil
}
+2 -2
View File
@@ -186,7 +186,7 @@ func (w *WebView) evalJSSync(js string) error {
go func() {
exit := false
// We are done when we receive the Callback ID
// We are done when we receive the callback ID
w.log.Debug("SyncJS: sending with ID = " + ID)
w.eventManager.On(ID, func(...interface{}) {
w.log.Debug("SyncJS: Got callback ID = " + ID)
@@ -361,7 +361,7 @@ func (w *WebView) focus() {
// callback sends a callback to the frontend
func (w *WebView) callback(data string) error {
callbackCMD := fmt.Sprintf("window.wails._.Callback('%s');", data)
callbackCMD := fmt.Sprintf("window.wails._.callback('%s');", data)
return w.evalJS(callbackCMD)
}
+10 -7
View File
@@ -4178,10 +4178,13 @@
"dev": true
},
"json5": {
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
"dev": true
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz",
"integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==",
"dev": true,
"requires": {
"minimist": "^1.2.5"
}
},
"kind-of": {
"version": "6.0.3",
@@ -4231,9 +4234,9 @@
},
"dependencies": {
"json5": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
-4
View File
@@ -103,7 +103,6 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
signal.Notify(quitChannel, os.Interrupt, os.Kill, syscall.SIGTERM)
exitCodeChannel := make(chan int, 1)
skipBindings := buildOptions.SkipBindings
// Build the frontend if requested, but ignore building the application itself.
ignoreFrontend := buildOptions.IgnoreFrontend
if !ignoreFrontend {
@@ -132,11 +131,8 @@ func Application(f *flags.Dev, logger *clilogger.CLILogger) error {
// Do initial build but only for the application.
logger.Println("Building application for development...")
buildOptions.SkipRuntime = true // runtime JS scripts never need to be written again, they never change during a dev loop.
buildOptions.SkipBindings = true
buildOptions.IgnoreFrontend = true
debugBinaryProcess, appBinary, err := restartApp(buildOptions, nil, f, exitCodeChannel)
buildOptions.SkipBindings = skipBindings
buildOptions.IgnoreFrontend = ignoreFrontend || f.FrontendDevServerURL != ""
if err != nil {
return err
+3
View File
@@ -0,0 +1,3 @@
build/bin
node_modules
frontend/wailsjs
+17
View File
@@ -0,0 +1,17 @@
# System Tray
This example shows how to create a system tray using an experimental programmatic API.
## Running
As this example outputs text to the console, it is recommended to build using `wails build -debug`.
## Supported Platforms
- [x] Windows
- [ ] macOS
- [ ] Linux

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

@@ -4,17 +4,17 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleName</key>
<string>{{ "{{.Info.ProductName}}" }}</string>
<string>{{.Info.ProductName}}</string>
<key>CFBundleExecutable</key>
<string>{{ "{{.ProjectName}}" }}</string>
<string>{{.Name}}</string>
<key>CFBundleIdentifier</key>
<string>com.wails.{{ "{{.ProjectName}}" }}</string>
<string>com.wails.{{.Name}}</string>
<key>CFBundleVersion</key>
<string>v1.0.0</string>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key>
<string>This is a comment</string>
<string>{{.Info.Comments}}</string>
<key>CFBundleShortVersionString</key>
<string>v1.0.0</string>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleIconFile</key>
<string>iconfile</string>
<key>LSMinimumSystemVersion</key>
@@ -22,6 +22,6 @@
<key>NSHighResolutionCapable</key>
<string>true</string>
<key>NSHumanReadableCopyright</key>
<string>(c) 2023 My Company Name</string>
<string>{{.Info.Copyright}}</string>
</dict>
</plist>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 20 KiB

@@ -0,0 +1,15 @@
{
"fixed": {
"file_version": "{{.Info.ProductVersion}}"
},
"info": {
"0000": {
"ProductVersion": "{{.Info.ProductVersion}}",
"CompanyName": "{{.Info.CompanyName}}",
"FileDescription": "{{.Info.ProductName}}",
"LegalCopyright": "{{.Info.Copyright}}",
"ProductName": "{{.Info.ProductName}}",
"Comments": "{{.Info.Comments}}"
}
}
}
@@ -0,0 +1,101 @@
Unicode true
####
## Please note: Template replacements don't work in this file. They are provided with default defines like
## mentioned underneath.
## If the keyword is not defined, "wails_tools.nsh" will populate them with the values from ProjectInfo.
## If they are defined here, "wails_tools.nsh" will not touch them. This allows to use this project.nsi manually
## from outside of Wails for debugging and development of the installer.
##
## For development first make a wails nsis build to populate the "wails_tools.nsh":
## > wails build --target windows/amd64 --nsis
## Then you can call makensis on this file with specifying the path to your binary:
## For a AMD64 only installer:
## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app.exe
## For a ARM64 only installer:
## > makensis -DARG_WAILS_ARM64_BINARY=..\..\bin\app.exe
## For a installer with both architectures:
## > makensis -DARG_WAILS_AMD64_BINARY=..\..\bin\app-amd64.exe -DARG_WAILS_ARM64_BINARY=..\..\bin\app-arm64.exe
####
## The following information is taken from the ProjectInfo file, but they can be overwritten here.
####
## !define INFO_PROJECTNAME "MyProject" # Default "{{.Name}}"
## !define INFO_COMPANYNAME "MyCompany" # Default "{{.Info.CompanyName}}"
## !define INFO_PRODUCTNAME "MyProduct" # Default "{{.Info.ProductName}}"
## !define INFO_PRODUCTVERSION "1.0.0" # Default "{{.Info.ProductVersion}}"
## !define INFO_COPYRIGHT "Copyright" # Default "{{.Info.Copyright}}"
###
## !define PRODUCT_EXECUTABLE "Application.exe" # Default "${INFO_PROJECTNAME}.exe"
## !define UNINST_KEY_NAME "UninstKeyInRegistry" # Default "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
####
## !define REQUEST_EXECUTION_LEVEL "admin" # Default "admin" see also https://nsis.sourceforge.io/Docs/Chapter4.html
####
## Include the wails tools
####
!include "wails_tools.nsh"
# The version information for this two must consist of 4 parts
VIProductVersion "${INFO_PRODUCTVERSION}.0"
VIFileVersion "${INFO_PRODUCTVERSION}.0"
VIAddVersionKey "CompanyName" "${INFO_COMPANYNAME}"
VIAddVersionKey "FileDescription" "${INFO_PRODUCTNAME} Installer"
VIAddVersionKey "ProductVersion" "${INFO_PRODUCTVERSION}"
VIAddVersionKey "FileVersion" "${INFO_PRODUCTVERSION}"
VIAddVersionKey "LegalCopyright" "${INFO_COPYRIGHT}"
VIAddVersionKey "ProductName" "${INFO_PRODUCTNAME}"
!include "MUI.nsh"
!define MUI_ICON "..\icon.ico"
!define MUI_UNICON "..\icon.ico"
# !define MUI_WELCOMEFINISHPAGE_BITMAP "resources\leftimage.bmp" #Include this to add a bitmap on the left side of the Welcome Page. Must be a size of 164x314
!define MUI_FINISHPAGE_NOAUTOCLOSE # Wait on the INSTFILES page so the user can take a look into the details of the installation steps
!define MUI_ABORTWARNING # This will warn the user if they exit from the installer.
!insertmacro MUI_PAGE_WELCOME # Welcome to the installer page.
# !insertmacro MUI_PAGE_LICENSE "resources\eula.txt" # Adds a EULA page to the installer
!insertmacro MUI_PAGE_DIRECTORY # In which folder install page.
!insertmacro MUI_PAGE_INSTFILES # Installing page.
!insertmacro MUI_PAGE_FINISH # Finished installation page.
!insertmacro MUI_UNPAGE_INSTFILES # Uinstalling page
!insertmacro MUI_LANGUAGE "English" # Set the Language of the installer
## The following two statements can be used to sign the installer and the uninstaller. The path to the binaries are provided in %1
#!uninstfinalize 'signtool --file "%1"'
#!finalize 'signtool --file "%1"'
Name "${INFO_PRODUCTNAME}"
OutFile "..\..\bin\${INFO_PROJECTNAME}-${ARCH}-installer.exe" # Name of the installer's file.
InstallDir "$PROGRAMFILES64\${INFO_COMPANYNAME}\${INFO_PRODUCTNAME}" # Default installing folder ($PROGRAMFILES is Program Files folder).
ShowInstDetails show # This will always show the installation details.
Function .onInit
!insertmacro wails.checkArchitecture
FunctionEnd
Section
!insertmacro wails.webview2runtime
SetOutPath $INSTDIR
!insertmacro wails.files
CreateShortcut "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
CreateShortCut "$DESKTOP\${INFO_PRODUCTNAME}.lnk" "$INSTDIR\${PRODUCT_EXECUTABLE}"
!insertmacro wails.writeUninstaller
SectionEnd
Section "uninstall"
RMDir /r "$AppData\${PRODUCT_EXECUTABLE}" # Remove the WebView2 DataPath
RMDir /r $INSTDIR
Delete "$SMPROGRAMS\${INFO_PRODUCTNAME}.lnk"
Delete "$DESKTOP\${INFO_PRODUCTNAME}.lnk"
!insertmacro wails.deleteUninstaller
SectionEnd
@@ -0,0 +1,171 @@
# DO NOT EDIT - Generated automatically by `wails build`
!include "x64.nsh"
!include "WinVer.nsh"
!include "FileFunc.nsh"
!ifndef INFO_PROJECTNAME
!define INFO_PROJECTNAME "{{.Name}}"
!endif
!ifndef INFO_COMPANYNAME
!define INFO_COMPANYNAME "{{.Info.CompanyName}}"
!endif
!ifndef INFO_PRODUCTNAME
!define INFO_PRODUCTNAME "{{.Info.ProductName}}"
!endif
!ifndef INFO_PRODUCTVERSION
!define INFO_PRODUCTVERSION "{{.Info.ProductVersion}}"
!endif
!ifndef INFO_COPYRIGHT
!define INFO_COPYRIGHT "{{.Info.Copyright}}"
!endif
!ifndef PRODUCT_EXECUTABLE
!define PRODUCT_EXECUTABLE "${INFO_PROJECTNAME}.exe"
!endif
!ifndef UNINST_KEY_NAME
!define UNINST_KEY_NAME "${INFO_COMPANYNAME}${INFO_PRODUCTNAME}"
!endif
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${UNINST_KEY_NAME}"
!ifndef REQUEST_EXECUTION_LEVEL
!define REQUEST_EXECUTION_LEVEL "admin"
!endif
RequestExecutionLevel "${REQUEST_EXECUTION_LEVEL}"
!ifdef ARG_WAILS_AMD64_BINARY
!define SUPPORTS_AMD64
!endif
!ifdef ARG_WAILS_ARM64_BINARY
!define SUPPORTS_ARM64
!endif
!ifdef SUPPORTS_AMD64
!ifdef SUPPORTS_ARM64
!define ARCH "amd64_arm64"
!else
!define ARCH "amd64"
!endif
!else
!ifdef SUPPORTS_ARM64
!define ARCH "arm64"
!else
!error "Wails: Undefined ARCH, please provide at least one of ARG_WAILS_AMD64_BINARY or ARG_WAILS_ARM64_BINARY"
!endif
!endif
!macro wails.checkArchitecture
!ifndef WAILS_WIN10_REQUIRED
!define WAILS_WIN10_REQUIRED "This product is only supported on Windows 10 (Server 2016) and later."
!endif
!ifndef WAILS_ARCHITECTURE_NOT_SUPPORTED
!define WAILS_ARCHITECTURE_NOT_SUPPORTED "This product can't be installed on the current Windows architecture. Supports: ${ARCH}"
!endif
${If} ${AtLeastWin10}
!ifdef SUPPORTS_AMD64
${if} ${IsNativeAMD64}
Goto ok
${EndIf}
!endif
!ifdef SUPPORTS_ARM64
${if} ${IsNativeARM64}
Goto ok
${EndIf}
!endif
IfSilent silentArch notSilentArch
silentArch:
SetErrorLevel 65
Abort
notSilentArch:
MessageBox MB_OK "${WAILS_ARCHITECTURE_NOT_SUPPORTED}"
Quit
${else}
IfSilent silentWin notSilentWin
silentWin:
SetErrorLevel 64
Abort
notSilentWin:
MessageBox MB_OK "${WAILS_WIN10_REQUIRED}"
Quit
${EndIf}
ok:
!macroend
!macro wails.files
!ifdef SUPPORTS_AMD64
${if} ${IsNativeAMD64}
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_AMD64_BINARY}"
${EndIf}
!endif
!ifdef SUPPORTS_ARM64
${if} ${IsNativeARM64}
File "/oname=${PRODUCT_EXECUTABLE}" "${ARG_WAILS_ARM64_BINARY}"
${EndIf}
!endif
!macroend
!macro wails.writeUninstaller
WriteUninstaller "$INSTDIR\uninstall.exe"
SetRegView 64
WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "${INFO_COMPANYNAME}"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "${INFO_PRODUCTNAME}"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${INFO_PRODUCTVERSION}"
WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "$INSTDIR\${PRODUCT_EXECUTABLE}"
WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
WriteRegStr HKLM "${UNINST_KEY}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
IntFmt $0 "0x%08X" $0
WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" "$0"
!macroend
!macro wails.deleteUninstaller
Delete "$INSTDIR\uninstall.exe"
SetRegView 64
DeleteRegKey HKLM "${UNINST_KEY}"
!macroend
# Install webview2 by launching the bootstrapper
# See https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution#online-only-deployment
!macro wails.webview2runtime
!ifndef WAILS_INSTALL_WEBVIEW_DETAILPRINT
!define WAILS_INSTALL_WEBVIEW_DETAILPRINT "Installing: WebView2 Runtime"
!endif
SetRegView 64
# If the admin key exists and is not empty then webview2 is already installed
ReadRegStr $0 HKLM "SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
${If} $0 != ""
Goto ok
${EndIf}
${If} ${REQUEST_EXECUTION_LEVEL} == "user"
# If the installer is run in user level, check the user specific key exists and is not empty then webview2 is already installed
ReadRegStr $0 HKCU "Software\Microsoft\EdgeUpdate\Clients{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv"
${If} $0 != ""
Goto ok
${EndIf}
${EndIf}
SetDetailsPrint both
DetailPrint "${WAILS_INSTALL_WEBVIEW_DETAILPRINT}"
SetDetailsPrint listonly
InitPluginsDir
CreateDirectory "$pluginsdir\webview2bootstrapper"
SetOutPath "$pluginsdir\webview2bootstrapper"
File "tmp\MicrosoftEdgeWebview2Setup.exe"
ExecWait '"$pluginsdir\webview2bootstrapper\MicrosoftEdgeWebview2Setup.exe" /silent /install'
SetDetailsPrint both
ok:
!macroend
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity type="win32" name="com.wails.{{.Name}}" version="{{.Info.ProductVersion}}.0" processorArchitecture="*"/>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/>
</dependentAssembly>
</dependency>
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware> <!-- fallback for Windows 7 and 8 -->
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">permonitorv2,permonitor</dpiAwareness> <!-- falls back to per-monitor if per-monitor v2 is not supported -->
</asmv3:windowsSettings>
</asmv3:application>
</assembly>
View File
+59
View File
@@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>Systray Example</title>
<style>
html {
background-color: rgba(27, 38, 54, 0.75);
text-align: center;
color: white;
}
@font-face {
font-family: "Nunito";
font-style: normal;
font-weight: 400;
src: local(""),
url("../../common/fonts/nunito-v16-latin-regular.woff2") format("woff2");
}
body {
margin: 0;
color: white;
font-family: "Nunito", sans-serif;
}
.logo {
display: block;
width: 50%;
height: 50%;
background-position: center;
background-repeat: no-repeat;
background-image: url("../../common/images/logo-universal.png");
background-size: 100% 100%;
background-origin: content-box;
}
#app {
height: 100vh;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
}
</style>
</head>
<body>
<div id="app">
<div class="logo"></div>
<p>Systray Example</p>
</div>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -2,13 +2,12 @@
"name": "frontend",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"vite": "^4.0.0"
"vite": "^2.9.9"
}
}

Some files were not shown because too many files have changed in this diff Show More