-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first commit * works for me * fix EOF * add proper wails example * ci: install go and wails cli * fix deno example * install webkit2gtk-4.0 for wails * try with a 32x32 png * Update examples/wails/Packager.toml Co-authored-by: Fabian-Lars <[email protected]> --------- Co-authored-by: amr-crabnebula <[email protected]> Co-authored-by: Fabian-Lars <[email protected]>
- Loading branch information
1 parent
20027d0
commit 64f57f7
Showing
35 changed files
with
1,324 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
/target | ||
.idea | ||
.idea | ||
.DS_Store | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
build/bin | ||
node_modules | ||
frontend/dist |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name = "wails-example" | ||
before-packaging-command = "wails build -noPackage" | ||
out-dir = "./build/bin" | ||
version = "0.0.0" | ||
product-name = "Wails example" | ||
identifier = "com.wails.example" | ||
resources = ["Cargo.toml", "src", "32x32.png"] | ||
icons = ["32x32.png"] | ||
binaries = [{ filename = "wails_example", main = true }] | ||
|
||
[deb] | ||
depends = ["libgtk-3-0", "libwebkit2gtk-4.1-0"] | ||
|
||
[appimage] | ||
libs = [ | ||
"WebKitNetworkProcess", | ||
"WebKitWebProcess", | ||
"libwebkit2gtkinjectedbundle.so", | ||
] | ||
|
||
[appimage.linuxdeploy-plugins] | ||
"gtk" = "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh" | ||
|
||
[nsis] | ||
appdata-paths = ["$LOCALAPPDATA/$IDENTIFIER"] | ||
preinstall-section = """ | ||
; Setup messages | ||
; English | ||
LangString webview2AbortError ${LANG_ENGLISH} "Failed to install WebView2! The app can't run without it. Try restarting the installer." | ||
LangString webview2DownloadError ${LANG_ENGLISH} "Error: Downloading WebView2 Failed - $0" | ||
LangString webview2DownloadSuccess ${LANG_ENGLISH} "WebView2 bootstrapper downloaded successfully" | ||
LangString webview2Downloading ${LANG_ENGLISH} "Downloading WebView2 bootstrapper..." | ||
LangString webview2InstallError ${LANG_ENGLISH} "Error: Installing WebView2 failed with exit code $1" | ||
LangString webview2InstallSuccess ${LANG_ENGLISH} "WebView2 installed successfully" | ||
Section PreInstall | ||
; Check if Webview2 is already installed and skip this section | ||
${If} ${RunningX64} | ||
ReadRegStr $4 HKLM "SOFTWARE\\WOW6432Node\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" | ||
${Else} | ||
ReadRegStr $4 HKLM "SOFTWARE\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" | ||
${EndIf} | ||
ReadRegStr $5 HKCU "SOFTWARE\\Microsoft\\EdgeUpdate\\Clients\\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" "pv" | ||
StrCmp $4 "" 0 webview2_done | ||
StrCmp $5 "" 0 webview2_done | ||
Delete "$TEMP\\MicrosoftEdgeWebview2Setup.exe" | ||
DetailPrint "$(webview2Downloading)" | ||
nsis_tauri_utils::download "https://go.microsoft.com/fwlink/p/?LinkId=2124703" "$TEMP\\MicrosoftEdgeWebview2Setup.exe" | ||
Pop $0 | ||
${If} $0 == 0 | ||
DetailPrint "$(webview2DownloadSuccess)" | ||
${Else} | ||
DetailPrint "$(webview2DownloadError)" | ||
Abort "$(webview2AbortError)" | ||
${EndIf} | ||
StrCpy $6 "$TEMP\\MicrosoftEdgeWebview2Setup.exe" | ||
DetailPrint "$(installingWebview2)" | ||
; $6 holds the path to the webview2 installer | ||
ExecWait "$6 /install" $1 | ||
${If} $1 == 0 | ||
DetailPrint "$(webview2InstallSuccess)" | ||
${Else} | ||
DetailPrint "$(webview2InstallError)" | ||
Abort "$(webview2AbortError)" | ||
${EndIf} | ||
webview2_done: | ||
SectionEnd | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## Wails example | ||
|
||
1. install The Go programming language: https://go.dev/dl/ | ||
2. install `wails` CLI first | ||
|
||
```sh | ||
go install github.com/wailsapp/wails/v2/cmd/wails@latest | ||
``` | ||
|
||
3. package the app | ||
|
||
```sh | ||
cargo r -p cargo-packager -- -p wails-example --release | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
) | ||
|
||
// App struct | ||
type App struct { | ||
ctx context.Context | ||
} | ||
|
||
// NewApp creates a new App application struct | ||
func NewApp() *App { | ||
return &App{} | ||
} | ||
|
||
// startup is called when the app starts. The context is saved | ||
// so we can call the runtime methods | ||
func (a *App) startup(ctx context.Context) { | ||
a.ctx = ctx | ||
} | ||
|
||
// Greet returns a greeting for the given name | ||
func (a *App) Greet(name string) string { | ||
return fmt.Sprintf("Hello %s, It's show time!", name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env -S pkgx +npm +go +gum +jq zsh | ||
# ^^ curl https://pkgx.sh | sh | ||
# ^^ pkgx makes all those tools (including bash!) available to the script | ||
# no packages are installed; your system remains pristine | ||
|
||
go install github.com/wailsapp/wails/v2/cmd/wails@latest | ||
|
||
# works on mac | ||
export PATH="$HOME/go/bin:$PATH" | ||
|
||
if [ -d wails_example ]; then | ||
cd wails_example | ||
elif [ ! -d .git ] && gum confirm 'Create new wails app?'; then | ||
wails init -n wails_example -t vanilla | ||
cd wails_example | ||
fi | ||
|
||
# probably not resilient if wails changes | ||
wails build | grep "Built" | cut -d " " -f 2 | read buildpath | ||
|
||
echo "Your binary is available at ${buildpath}" | ||
mkdir -p ./dist | ||
|
||
# I am stupid why doesn't this work | ||
# cp ${buildpath} ./dist/ | ||
cp ./build/bin/wails_example.app/Contents/MacOS/wails_example ./dist | ||
|
||
# also doesn't work here, sadly | ||
# cargo r -p cargo-packager -- -p wails-example --release -c packager.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Build Directory | ||
|
||
The build directory is used to house all the build files and assets for your application. | ||
|
||
The structure is: | ||
|
||
* bin - Output directory | ||
* darwin - macOS specific files | ||
* windows - Windows specific files | ||
|
||
## Mac | ||
|
||
The `darwin` directory holds files specific to Mac builds. | ||
These may be customised and used as part of the build. To return these files to the default state, simply delete them | ||
and | ||
build with `wails build`. | ||
|
||
The directory contains the following files: | ||
|
||
- `Info.plist` - the main plist file used for Mac builds. It is used when building using `wails build`. | ||
- `Info.dev.plist` - same as the main plist file but used when building using `wails dev`. | ||
|
||
## Windows | ||
|
||
The `windows` directory contains the manifest and rc files used when building with `wails build`. | ||
These may be customised for your application. To return these files to the default state, simply delete them and | ||
build with `wails build`. | ||
|
||
- `icon.ico` - The icon used for the application. This is used when building using `wails build`. If you wish to | ||
use a different icon, simply replace this file with your own. If it is missing, a new `icon.ico` file | ||
will be created using the `appicon.png` file in the build directory. | ||
- `installer/*` - The files used to create the Windows installer. These are used when building using `wails build`. | ||
- `info.json` - Application details used for Windows builds. The data here will be used by the Windows installer, | ||
as well as the application itself (right click the exe -> properties -> details) | ||
- `wails.exe.manifest` - The main application manifest file. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleName</key> | ||
<string>{{.Info.ProductName}}</string> | ||
<key>CFBundleExecutable</key> | ||
<string>{{.Name}}</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.wails.{{.Name}}</string> | ||
<key>CFBundleVersion</key> | ||
<string>{{.Info.ProductVersion}}</string> | ||
<key>CFBundleGetInfoString</key> | ||
<string>{{.Info.Comments}}</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>{{.Info.ProductVersion}}</string> | ||
<key>CFBundleIconFile</key> | ||
<string>iconfile</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.13.0</string> | ||
<key>NSHighResolutionCapable</key> | ||
<string>true</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>{{.Info.Copyright}}</string> | ||
<key>NSAppTransportSecurity</key> | ||
<dict> | ||
<key>NSAllowsLocalNetworking</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleName</key> | ||
<string>{{.Info.ProductName}}</string> | ||
<key>CFBundleExecutable</key> | ||
<string>{{.Name}}</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>com.wails.{{.Name}}</string> | ||
<key>CFBundleVersion</key> | ||
<string>{{.Info.ProductVersion}}</string> | ||
<key>CFBundleGetInfoString</key> | ||
<string>{{.Info.Comments}}</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>{{.Info.ProductVersion}}</string> | ||
<key>CFBundleIconFile</key> | ||
<string>iconfile</string> | ||
<key>LSMinimumSystemVersion</key> | ||
<string>10.13.0</string> | ||
<key>NSHighResolutionCapable</key> | ||
<string>true</string> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>{{.Info.Copyright}}</string> | ||
</dict> | ||
</plist> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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}}" | ||
} | ||
} | ||
} |
Oops, something went wrong.