-
Notifications
You must be signed in to change notification settings - Fork 20
/
Cargo.toml
108 lines (96 loc) · 3.55 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
[package]
name = "tauri-example"
version = "0.0.0"
description = "Tauri Example"
edition = "2021"
publish = false
[build-dependencies]
tauri-build = { version = "=2.0.0-rc.8", features = [] }
[dependencies]
tauri = { version = "=2.0.0-rc.9", features = ["devtools"] }
tauri-utils = { version = "=2.0.0-rc.8", features = [] }
tauri-macros = "=2.0.0-rc.7"
serde.workspace = true
serde_json.workspace = true
cargo-packager-updater = { path = "../../crates/updater" }
[features]
# this feature is used for production builds or when `devPath` points to the filesystem
# DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]
[package.metadata.packager]
before-packaging-command = "cargo tauri build"
product-name = "Tauri example"
identifier = "com.tauri.example"
resources = [
"Cargo.toml",
"../../README.md",
"icons/*",
"src",
{ src = "src-ui/assets/tauri.svg", target = "path/to/tauri.svg" },
{ src = "src-ui", target = "path/to/src-ui" },
{ src = "src-ui/assets/*", target = "public" },
]
icons = [
"icons/32x32.png",
"icons/128x128.png",
"icons/[email protected]",
"icons/icon.icns",
"icons/icon.ico",
]
[package.metadata.packager.deb]
depends = ["libgtk-3-0", "libwebkit2gtk-4.1-0", "libayatana-appindicator3-1"]
section = "rust"
[package.metadata.packager.appimage]
bins = ["/usr/bin/xdg-open"]
libs = [
"WebKitNetworkProcess",
"WebKitWebProcess",
"libwebkit2gtkinjectedbundle.so",
"libayatana-appindicator3.so.1",
]
[package.metadata.packager.appimage.linuxdeploy-plugins]
"gtk" = "https://raw.githubusercontent.com/tauri-apps/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
[package.metadata.packager.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
"""