HMCL-dev / HMCL-dev/HMCL

[Feature] 从 HMCL JAR 中排除 HMCLauncher

Open
#3,844 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
10.1k
Forks
934
Avg merge
1d 5h
Merged PRs (30d)
82

Description

描述 | Description

从 HMCL JAR 中排除 HMCLauncher.exeHMCLauncher.sh

为了实现这项变化,我计划未来 HMCL 在构建时创建两个 JAR:常规用途的标准 JAR 和更新时下载的 Full JAR

在除了自动更新外的所有渠道中,我们都应当分发标准 JAR。它有着完整的启动器功能,但不包含 HMCLauncher.exeHMCLauncher.sh 和两个文件。

而在自动更新时,应当下载 Full JAR。相比标准 JAR,它包含额外的三个文件:

  • assets/HMCLauncher.exe
  • assets/HMCLauncher.sh
  • META-INF/hmcl_signature_lite(名称待定,其内容为标准 JAR 的 META-INF/hmcl_signature

更新时,Full JAR 可以基于这些文件创建标准 JAR。

这个方案应该能最大程度的保证兼容性,但 Full JAR 仍有被误报的可能,也许需要改进。

原因 | Reason

HMCL JAR 内现在包含 HMCLauncher.exe 和 HMCLauncher.sh,用于在更新时生成 exe 或 sh 格式的启动器。

这种分发方式存在两个问题:

  1. 对于自动更新之外的场景,这两个文件完全是冗余的,平白增加了启动器的大小。
  2. 在 JAR 中嵌入 EXE 会增加杀软的误报率(#3216)。

其中杀软误报的问题尤为恼人。我们希望尽量减少被误报的概率,所以必须考虑从 JAR 内删除 HMCLauncher.exe。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the HMCL JAR build and automatic-update packaging entry points, then inspect how assets/HMCLauncher.exe, assets/HMCLauncher.sh, and META-INF/hmcl_signature are currently included. Define the standard and Full JAR contents, including the proposed signature metadata, and verify that automatic updates can reconstruct the standard JAR while other distribution channels omit the launcher files.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, release
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.