Skip to content

Commit 34d0a96

Browse files
committed
add an app icon
1 parent 9024227 commit 34d0a96

File tree

10 files changed

+106
-8
lines changed

10 files changed

+106
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ lib/*
44
!lib/libsteam_api.so
55
release-notes.md
66
benchmarks/MinEdLauncher.Benchmarks/BenchmarkDotNet.Artifacts/
7-
7+
*.ico
88
## rust
99
target/
1010

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
- Enable restart feature for Epic users. It's still not as seamless as non-Epic accounts. Requires the usage of [Legendary]
1717
or [Heroic]. Once you've logged in with either, you can go back to using the normal Epic launcher if you wish. It will
1818
require re-logging in every few days though, so it may be preferable to just stick with the alternate launchers.
19+
- Added an [icon](resources/min-ed-launcher.svg) for the app. Linux users can check the [readme](README.md#icon-on-linux)
20+
for setup instructions.
1921

2022
## [0.10.1] - 2024-05-03
2123

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ path = "src/bootstrapper-rs/main.rs"
1313
windows = { version = "0.42", features = [ "Win32_UI_Shell", "Win32_Foundation", "Win32_UI_WindowsAndMessaging" ] }
1414

1515
[build-dependencies]
16-
winres = "0.1"
16+
winresource = "0.1.17"
1717

1818
[package.metadata.winres]
1919
ProductName = "MinEdLauncher.Bootstrap"

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ accounts on both Windows and Linux.
2323
* [Multi-Account]
2424
* [Frontier account via Steam or Epic]
2525
* [Epic account via Steam]
26+
* [Icon on Linux]
2627
* [Troubleshooting]
2728
* [Cache]
2829
* [Build]
@@ -92,7 +93,7 @@ Frontier's website. Linking is only required if you purchased the game via Steam
9293

9394
`gnome-terminal -- ./MinEdLauncher %command% /autorun /autoquit /edo`
9495

95-
`konsole -e ./MinEdLauncher %command% /autorun /autoquit /edo`
96+
`konsole --name min-ed-launcher -e ./MinEdLauncher %command% /autorun /autoquit /edo`
9697
5. Launch your game as you normally would in Steam
9798
#### Epic
9899
1. Download the [latest release] for your operating system
@@ -310,6 +311,20 @@ Example _Target_ field for a shortcut that launches Odyssey:
310311

311312
`"C:\Program Files (x86)\Steam\Steam.exe" -gameidlaunch 359320 /edo`
312313

314+
### Icon on Linux
315+
1. Copy the included `min-ed-launcher.svg` file to your environment's default icon location
316+
317+
Common icon locations are `~/.local/share/icons/hicolor/scalable/apps` and `/usr/share/icons/scalable/apps`.
318+
2. Copy the included `min-ed-launcher.desktop` file to your environment's default application launcher location
319+
320+
Common locations are `~/.local/share/applications` and `/usr/share/applications`
321+
322+
You may need to update your cache by running `update-desktop-database` pointed at whereever you copied the
323+
desktop file. e.g. `update-desktop-database ~/.local/share/applications/`
324+
3. Set the WM_CLASS/Application Id property in your launch options. How you do this will depend on your terminal
325+
emulator. Examples are below:
326+
* Alacritty - `alacritty --class min-ed-launcher -e ./MinEdLauncher %command% /autorun /autoquit /edo`
327+
* kitty - `kitty --class min-ed-launcher ./MinEdLauncher %command% /autorun /autoquit /edo`
313328

314329
### Troubleshooting
315330
Debug logging is placed in the standard log location for your operating system:
@@ -386,6 +401,7 @@ Note that the bootstrap project specifically targets Windows and won't publish o
386401
[Multi-Account]: #multi-account
387402
[Frontier account via Steam or Epic]: #frontier-account-via-steam-or-epic
388403
[Epic account via Steam]: #epic-account-via-steam
404+
[Icon on Linux]: #icon-on-linux
389405
[Troubleshooting]: #troubleshooting
390406
[Cache]: #cache
391407
[Build]: #build

build.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
extern crate winres;
1+
use std::path::Path;
2+
use winresource::WindowsResource;
23

34
fn main() {
4-
if cfg!(target_os = "windows") {
5-
let res = winres::WindowsResource::new();
6-
res.compile().unwrap();
5+
let icon_path = "resources/min-ed-launcher.ico";
6+
7+
if Path::new(icon_path).is_file() {
8+
let mut res = WindowsResource::new();
9+
10+
res.set_icon(icon_path);
11+
res.compile().expect("failed to build executable icon");
712
}
813
}

publish.ps1

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
11
$ErrorActionPreference = "Stop"
2+
Set-PSDebug -Strict
3+
function Create-Icon {
4+
echo "Converting SVG icon to ICO"
5+
# https://imagemagick.org/script/download.php
6+
$imageMagick = "magick.exe"
7+
8+
if ((Get-Command $imageMagick -ErrorAction SilentlyContinue) -eq $null)
9+
{
10+
echo "Couldn't find ImageMagick '${imageMagick}'. Skipping icon creation"
11+
return
12+
}
13+
14+
$iconName = "min-ed-launcher"
15+
$svg = "resources/${iconName}.svg"
16+
$ico = "resources/${iconName}.ico"
17+
$resolutions = 16,20,24,32,40,48,64,256
18+
19+
$pngImages = @()
20+
Foreach($r in $resolutions) {
21+
$png = "resources/${r}.png"
22+
$dim = "${r}x${r}"
23+
24+
& $imageMagick -background none $svg -density $dim -resize $dim -gravity center -extent $dim $png
25+
26+
$pngImages += $png
27+
}
28+
29+
# Combine all PNG image files into an ico file
30+
& $imageMagick $pngImages $ico
31+
32+
# Remove PNG files
33+
Foreach($image in $pngImages) {
34+
#Remove-Item $image
35+
}
36+
}
237

338
$target="win-x64"
439
[xml]$proj = Get-Content src\Directory.Build.props
540
$version=$proj.Project.PropertyGroup.VersionPrefix
641
$release_name="min-ed-launcher_v${version}_$target"
742
$target_dir="artifacts\$release_name"
843

44+
Create-Icon
45+
946
dotnet publish -r "$target" --self-contained -o "$target_dir" -c ReleaseWindows -p:PublishSingleFile=true src\MinEdLauncher\MinEdLauncher.fsproj
1047
$full_version=(Get-Item "$target_dir\MinEdLauncher.exe").VersionInfo.ProductVersion
1148
(Get-Content Cargo.toml).replace('0.0.0', "$full_version") | Set-Content Cargo.toml # Workaround for https://github.com/rust-lang/cargo/issues/6583

publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ release_name="min-ed-launcher_v${version}_$target"
66

77
dotnet restore -r $target
88
dotnet publish src/MinEdLauncher/MinEdLauncher.fsproj -r "$target" --self-contained true --no-restore -o "artifacts/$release_name" -c Release -p:PublishSingleFile=true
9-
cp README.md CHANGELOG.md "artifacts/$release_name"
9+
cp README.md CHANGELOG.md resources/min-ed-launcher.svg resources/min-ed-launcher.desktop "artifacts/$release_name"
1010
rm artifacts/"$release_name"/*.pdb
1111

1212
tar czvf "artifacts/$release_name.tar.gz" -C "artifacts" "$release_name"

resources/min-ed-launcher.desktop

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[Desktop Entry]
2+
Name=Minimal ED Launcher
3+
Comment=Launches the game Elite: Dangerous
4+
Exec=MinEdLauncher %F
5+
Terminal=true
6+
Type=Application
7+
Keywords=elite;ed;launcher;
8+
Icon=min-ed-launcher
9+
Categories=Game;

resources/min-ed-launcher.svg

Lines changed: 24 additions & 0 deletions
Loading

src/MinEdLauncher/MinEdLauncher.fsproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838

3939
<PropertyGroup>
4040
<IsLinux>!$(DefineConstants.Contains('WINDOWS'))</IsLinux>
41+
<IsWindows>$(DefineConstants.Contains('WINDOWS'))</IsWindows>
42+
</PropertyGroup>
43+
44+
<PropertyGroup Condition="$(IsWindows) And Exists('..\..\resources\min-ed-launcher.ico')">
45+
<ApplicationIcon>..\..\resources\min-ed-launcher.ico</ApplicationIcon>
4146
</PropertyGroup>
4247

4348
<ItemGroup>

0 commit comments

Comments
 (0)