Commit bdf68de 1 parent df2730b commit bdf68de Copy full SHA for bdf68de
File tree 7 files changed +27
-17
lines changed
7 files changed +27
-17
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " installer-downloader"
3
3
description = " A secure minimal web installer for the Mullvad app"
4
+ version = " 1.0.0"
4
5
authors.workspace = true
5
6
repository.workspace = true
6
7
license.workspace = true
Original file line number Diff line number Diff line change 6
6
<string >English </string >
7
7
<key >CFBundleExecutable </key >
8
8
<string >installer-downloader </string >
9
- <key >CFBundleGetInfoString </key >
10
- <string ></string >
11
9
<key >CFBundleIconFile </key >
12
10
<string >icon.icns </string >
13
11
<key >CFBundleIdentifier </key >
14
- <string >net.mullvad.MullvadVPNInstaller </string >
12
+ <string >%BUNDLE_ID% </string >
15
13
<key >CFBundleInfoDictionaryVersion </key >
16
14
<string >6.0 </string >
17
- <key >CFBundleLongVersionString </key >
18
- <string ></string >
19
15
<key >CFBundleName </key >
20
- <string >net.mullvad.MullvadVPNInstaller </string >
16
+ <string >%BUNDLE_NAME% </string >
21
17
<key >CFBundlePackageType </key >
22
18
<string >APPL </string >
23
- <key >CFBundleShortVersionString </key >
24
- <string >0.1 </string >
25
19
<key >CFBundleVersion </key >
26
- <string ></string >
20
+ <string >%BUNDLE_VERSION% </string >
27
21
<key >CSResourcesFileMapped </key >
28
22
<true />
29
23
<key >LSRequiresCarbon </key >
Original file line number Diff line number Diff line change @@ -2,10 +2,6 @@ use anyhow::Context;
2
2
use std:: env;
3
3
4
4
fn main ( ) -> anyhow:: Result < ( ) > {
5
- if cfg ! ( debug_assertions) {
6
- return Ok ( ( ) ) ;
7
- }
8
-
9
5
let target_os = env:: var ( "CARGO_CFG_TARGET_OS" ) . context ( "Missing 'CARGO_CFG_TARGET_OS" ) ?;
10
6
match target_os. as_str ( ) {
11
7
"windows" => win_main ( ) ,
@@ -23,8 +19,10 @@ fn win_main() -> anyhow::Result<()> {
23
19
windows_sys:: Win32 :: System :: SystemServices :: SUBLANG_ENGLISH_US as u16 ,
24
20
) ) ;
25
21
26
- println ! ( "cargo:rerun-if-changed=loader.manifest" ) ;
27
- res. set_manifest_file ( "loader.manifest" ) ;
22
+ if !cfg ! ( debug_assertions) {
23
+ println ! ( "cargo:rerun-if-changed=loader.manifest" ) ;
24
+ res. set_manifest_file ( "loader.manifest" ) ;
25
+ }
28
26
res. set_icon ( "../dist-assets/icon.ico" ) ;
29
27
30
28
res. compile ( ) . context ( "Failed to compile resources" )
Original file line number Diff line number Diff line change @@ -87,6 +87,12 @@ function assert_can_sign {
87
87
fi
88
88
}
89
89
90
+ # Get the project version (specified in Cargo.toml).
91
+ # This outputs string such as 1.0.0.
92
+ function product_version {
93
+ sed -n ' s/^version = "\(.*\)"$/\1/p' Cargo.toml
94
+ }
95
+
90
96
# Run cargo with all appropriate flags and options
91
97
# Arguments:
92
98
# - (optional) target
@@ -212,7 +218,13 @@ function dist_macos_app {
212
218
213
219
mkdir -p " $app_path /Contents/MacOS"
214
220
215
- cp ./assets/Info.plist " $app_path /Contents/Info.plist"
221
+ # Generate info plist, using the version specified in Cargo.toml
222
+ sed -e " s/%BUNDLE_VERSION%/$( product_version) /g" \
223
+ -e " s/%BUNDLE_NAME%/$BUNDLE_NAME /g" \
224
+ -e " s/%BUNDLE_ID%/$BUNDLE_ID /g" \
225
+ ./assets/Info.plist > " $app_path /Contents/Info.plist"
226
+
227
+ # Copy executable
216
228
cp " $BUILD_DIR /installer-downloader" " $app_path /Contents/MacOS/installer-downloader"
217
229
218
230
# Sign app bundle
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ mod inner {
16
16
pub fn run ( ) {
17
17
log:: init ( ) . expect ( "failed to set up logger" ) ;
18
18
19
+ :: log:: debug!( "Installer downloader version: {}" , resource:: VERSION ) ;
20
+
19
21
let rt = tokio:: runtime:: Builder :: new_multi_thread ( )
20
22
. enable_all ( )
21
23
. build ( )
Original file line number Diff line number Diff line change 1
1
//! Shared text and other resources
2
2
3
+ /// Installer downloader version
4
+ pub const VERSION : & str = env ! ( "CARGO_PKG_VERSION" ) ;
5
+
3
6
/// Window title
4
7
pub const WINDOW_TITLE : & str = "Mullvad VPN installer" ;
5
8
/// Window width
You can’t perform that action at this time.
0 commit comments