diff --git a/app_bundler/lib/app_bundler.ex b/app_bundler/lib/app_bundler.ex index 4a6696461..a7480ae4a 100644 --- a/app_bundler/lib/app_bundler.ex +++ b/app_bundler/lib/app_bundler.ex @@ -11,6 +11,14 @@ defmodule AppBundler do end end + def target do + case :erlang.system_info(:system_architecture) do + 'x86_64-apple-' ++ _ -> "macos-x86_64" + 'aarch64-apple-' ++ _ -> "macos-aarch64" + 'win32' -> "windows-x86_64" + end + end + def os do case :os.type() do {:unix, :darwin} -> :macos diff --git a/app_bundler/lib/app_bundler/macos.ex b/app_bundler/lib/app_bundler/macos.ex index f74c9486b..7d006b957 100644 --- a/app_bundler/lib/app_bundler/macos.ex +++ b/app_bundler/lib/app_bundler/macos.ex @@ -98,9 +98,9 @@ defmodule AppBundler.MacOS do log(:green, "signing", Path.relative_to_cwd(app_dir)) codesign(to_sign, "--options=runtime --entitlements=#{entitlements_plist_path}", notarization) - arch = :erlang.system_info(:system_architecture) |> to_string |> String.split("-") |> hd() + target = AppBundler.target() vsn = release.version - dmg_path = "#{Mix.Project.build_path()}/#{app_name}Install-#{vsn}-#{arch}.dmg" + dmg_path = "#{Mix.Project.build_path()}/#{app_name}Install-#{vsn}-#{target}.dmg" log(:green, "creating", Path.relative_to_cwd(dmg_path)) cmd!( diff --git a/app_bundler/lib/templates/windows/Installer.nsi.eex b/app_bundler/lib/templates/windows/Installer.nsi.eex index 3b9ee0b5a..9c54dd825 100644 --- a/app_bundler/lib/templates/windows/Installer.nsi.eex +++ b/app_bundler/lib/templates/windows/Installer.nsi.eex @@ -8,7 +8,7 @@ app_name = Keyword.fetch!(@app_options, :name) Name "<%= app_name %>" ManifestDPIAware true -OutFile "<%= app_name %>Install.exe" +OutFile "<%= app_name %>Install-<%= @release.version %>-<%= AppBundler.target() %>.exe" Unicode True InstallDir "$LOCALAPPDATA\<%= app_name %>"