From cf80d485ea8c49a196cf9e34a9e2656baaec8e24 Mon Sep 17 00:00:00 2001 From: Wojtek Mach Date: Wed, 10 Aug 2022 16:22:28 +0200 Subject: [PATCH] Switch rcedit to libpe which updates executable checksum closes #1324 --- app_bundler/lib/app_bundler/windows.ex | 9 +-------- app_bundler/mix.exs | 4 +++- mix.lock | 1 + 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/app_bundler/lib/app_bundler/windows.ex b/app_bundler/lib/app_bundler/windows.ex index 30d2252a0..35910a0c2 100644 --- a/app_bundler/lib/app_bundler/windows.ex +++ b/app_bundler/lib/app_bundler/windows.ex @@ -22,10 +22,9 @@ defmodule AppBundler.Windows do manifest_xml_path = "#{app_path}/Manifest.xml" copy_template(manifest_eex_path, manifest_xml_path, release: release) - rcedit_path = ensure_rcedit() erl_exe = "#{app_path}/rel/erts-#{release.erts_version}/bin/erl.exe" log(:green, :updating, Path.relative_to_cwd(erl_exe)) - cmd!(rcedit_path, ["--application-manifest", manifest_xml_path, erl_exe]) + Mix.Task.run("pe.update", ["--set-manifest", manifest_xml_path, erl_exe]) vcredist_path = ensure_vcredistx64() copy_file(vcredist_path, "#{app_path}/vcredist_x64.exe") @@ -105,12 +104,6 @@ defmodule AppBundler.Windows do AppBundler.Utils.ensure_executable(url, sha256, "nsis-3.08/makensis.exe") end - defp ensure_rcedit do - url = "https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe" - sha256 = "02e8e8c5d430d8b768980f517b62d7792d690982b9ba0f7e04163cbc1a6e7915" - AppBundler.Utils.ensure_executable(url, sha256) - end - defp ensure_magick do System.find_executable("magick.exe") || raise "couldn't find magick.exe in PATH to automatically convert images to .ico" diff --git a/app_bundler/mix.exs b/app_bundler/mix.exs index 17a48675f..35b8ae23a 100644 --- a/app_bundler/mix.exs +++ b/app_bundler/mix.exs @@ -26,6 +26,8 @@ defmodule AppBundler.MixProject do end defp deps do - [] + [ + {:libpe, "~> 1.0"} + ] end end diff --git a/mix.lock b/mix.lock index c448602ed..fb572489d 100644 --- a/mix.lock +++ b/mix.lock @@ -10,6 +10,7 @@ "floki": {:hex, :floki, "0.33.1", "f20f1eb471e726342b45ccb68edb9486729e7df94da403936ea94a794f072781", [:mix], [{:html_entities, "~> 0.5.0", [hex: :html_entities, repo: "hexpm", optional: false]}], "hexpm", "461035fd125f13fdf30f243c85a0b1e50afbec876cbf1ceefe6fddd2e6d712c6"}, "html_entities": {:hex, :html_entities, "0.5.2", "9e47e70598da7de2a9ff6af8758399251db6dbb7eebe2b013f2bbd2515895c3c", [:mix], [], "hexpm", "c53ba390403485615623b9531e97696f076ed415e8d8058b1dbaa28181f4fdcc"}, "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"}, + "libpe": {:hex, :libpe, "1.1.2", "16337b414c690e0ee9c49fe917b059622f001c399303102b98900c05c229cd9a", [:mix], [], "hexpm", "31df0639fafb603b20078c8db9596c8984f35a151c64ec2e483d9136ff9f428c"}, "mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"}, "phoenix": {:hex, :phoenix, "1.6.11", "29f3c0fd12fa1fc4d4b05e341578e55bc78d96ea83a022587a7e276884d397e4", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 1.0", [hex: :phoenix_view, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1664e34f80c25ea4918fbadd957f491225ef601c0e00b4e644b1a772864bfbc2"}, "phoenix_html": {:hex, :phoenix_html, "3.2.0", "1c1219d4b6cb22ac72f12f73dc5fad6c7563104d083f711c3fcd8551a1f4ae11", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "36ec97ba56d25c0136ef1992c37957e4246b649d620958a1f9fa86165f8bc54f"},