From 126a6dbbed4df0f51aeb32dbfcbf6570d54b139b Mon Sep 17 00:00:00 2001 From: zkitefly Date: Sat, 24 Jun 2023 09:40:13 +0800 Subject: [PATCH] Update HMCLauncher (#2264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 更新 lang.h * 更新 main.cpp * 更新 HMCLauncher.sh --- HMCL/src/main/resources/assets/HMCLauncher.sh | 8 ++++++++ HMCLauncher/HMCL/lang.h | 6 ++++-- HMCLauncher/HMCL/main.cpp | 5 +++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/resources/assets/HMCLauncher.sh b/HMCL/src/main/resources/assets/HMCLauncher.sh index 4a09404ba..8767589ed 100644 --- a/HMCL/src/main/resources/assets/HMCLauncher.sh +++ b/HMCL/src/main/resources/assets/HMCLauncher.sh @@ -62,8 +62,10 @@ if [ -n "${HMCL_JAVA_HOME+x}" ]; then else if [ "$_HMCL_USE_CHINESE" == true ]; then echo "环境变量 HMCL_JAVA_HOME 的值无效,请设置为合法的 Java 路径。" 1>&2 + echo "你可以访问 https://docs.hmcl.net/help.html 页面寻求帮助。" 1>&2 else echo "The value of the environment variable HMCL_JAVA_HOME is invalid, please set it to a valid Java path." 1>&2 + echo "You can visit the https://docs.hmcl.net/help.html page for help." 1>&2 fi exit 1 fi @@ -124,9 +126,11 @@ fi if [[ "$_HMCL_OS" == "unknown" || "$_HMCL_ARCH" == "unknown" ]]; then if [ "$_HMCL_USE_CHINESE" == true ]; then echo "运行 HMCL 需要 Java 运行时环境,请安装 Java 并设置环境变量后重试。" 1>&2 + echo "你可以访问 https://docs.hmcl.net/help.html 页面寻求帮助。" 1>&2 else echo "The Java runtime environment is required to run HMCL. " 1>&2 echo "Please install Java and set the environment variables and try again." 1>&2 + echo "You can visit the https://docs.hmcl.net/help.html page for help." 1>&2 fi exit 1 fi @@ -134,9 +138,11 @@ fi if [[ "$_HMCL_ARCH" == "loongarch64" ]]; then if [ "$_HMCL_USE_CHINESE" == true ]; then echo "运行 HMCL 需要 Java 运行时环境,请安装龙芯 JDK8 (https://docs.hmcl.net/downloads/loongnix.html) 并设置环境变量后重试。" 1>&2 + echo "你可以访问 https://docs.hmcl.net/help.html 页面寻求帮助。" 1>&2 else echo "The Java runtime environment is required to run HMCL." 1>&2 echo "Please install Loongson JDK8 (https://docs.hmcl.net/downloads/loongnix.html) and set the environment variables, then try again." 1>&2 + echo "You can visit the https://docs.hmcl.net/help.html page for help." 1>&2 fi exit 1 fi @@ -175,9 +181,11 @@ _HMCL_DOWNLOAD_PAGE="https://docs.hmcl.net/downloads/$_HMCL_DOWNLOAD_PAGE_OS/$_H if [ "$_HMCL_USE_CHINESE" == true ]; then echo "运行 HMCL 需要 Java 运行时环境,请安装 Java 并设置环境变量后重试。" 1>&2 echo "$_HMCL_DOWNLOAD_PAGE" 1>&2 + echo "你可以访问 https://docs.hmcl.net/help.html 页面寻求帮助。" 1>&2 else echo "The Java runtime environment is required to run HMCL. " 1>&2 echo "Please install Java and set the environment variables and try again." 1>&2 echo "$_HMCL_DOWNLOAD_PAGE" 1>&2 + echo "You can visit the https://docs.hmcl.net/help.html page for help." 1>&2 fi exit 1 diff --git a/HMCLauncher/HMCL/lang.h b/HMCLauncher/HMCL/lang.h index 41c276ac3..55bbc68f7 100644 --- a/HMCLauncher/HMCL/lang.h +++ b/HMCLauncher/HMCL/lang.h @@ -6,7 +6,9 @@ #define ERROR_PROMPT L"The Java runtime environment is required to run HMCL and Minecraft,\n"\ L"Click 'OK' to start downloading java.\n"\ - L"Please restart HMCL after installing Java." + L"Please restart HMCL after installing Java.\n"\ + L"Click 'Help' go for help." #define ERROR_PROMPT_ZH L" HMCL Լ Minecraft Ҫ Java ʱȷʼء\n"\ - L"ڰװ Java ɺ HMCL" + L"ڰװ Java ɺ HMCL\n"\ + L"Ѱ" diff --git a/HMCLauncher/HMCL/main.cpp b/HMCLauncher/HMCL/main.cpp index 736d2b529..2aad481e8 100644 --- a/HMCLauncher/HMCL/main.cpp +++ b/HMCLauncher/HMCL/main.cpp @@ -3,6 +3,7 @@ #include "os.h" #include "java.h" #include "lang.h" +#include Version J8(TEXT("8")); @@ -49,6 +50,10 @@ void FindJavaInDirAndLaunchJVM(const std::wstring &baseDir, const std::wstring & } } +void OpenHelpPage() { + ShellExecute(0, 0, L"https://docs.hmcl.net/help.html", 0, 0, SW_SHOW); +} + int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nCmdShow) { std::wstring path, exeName, jvmOptions;