From a2d63b5cdcca8810368714cade06553f571c5ae8 Mon Sep 17 00:00:00 2001 From: wh201906 Date: Sun, 3 Apr 2022 15:55:03 +0800 Subject: [PATCH] Update tutorial --- doc/tutorial/Quickstart/quickstart.md | 25 +++++++++++++++++++-- doc/tutorial/Quickstart/quickstart_zh_CN.md | 24 +++++++++++++++++++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/doc/tutorial/Quickstart/quickstart.md b/doc/tutorial/Quickstart/quickstart.md index fea9610..789663d 100644 --- a/doc/tutorial/Quickstart/quickstart.md +++ b/doc/tutorial/Quickstart/quickstart.md @@ -41,5 +41,26 @@ (3) You might need to change "\" to "/dev/\" in "Settings"->"Start arguments" editbox ![](args_linux.png) -(4) If you are using Raspbian(Raspberry OS), you might need to check "Keep the client active even the PM3 hardware is disconnected." in the "Steeings" panel -![](keep.png) \ No newline at end of file +(4) If you are using Raspbian(Raspberry OS), you might need to check "Keep the client active even the PM3 hardware is disconnected." in the "Settings" panel +![](keep.png) + +## About preload script +The client might refer to some environment variables to load dependencies +For example, the RRG client on Windows requires these environment variables +``` +QT_PLUGIN_PATH=\libs\ +QT_QPA_PLATFORM_PLUGIN_PATH=\libs\ +PATH=\libs\;\libs\shell\; +MSYSTEM=MINGW64 +``` +So the GUI will run "\\\setup.bat" before loading the client, which will set the environment variables to the client properly. The script will not affect the system environment variables. +The contents of setup.bat are as follows +``` +@echo off +set "HOME=%~dp0" +set "QT_PLUGIN_PATH=%HOME%\libs\" +set "QT_QPA_PLATFORM_PLUGIN_PATH=%QT_PLUGIN_PATH%" +set "PATH=%QT_PLUGIN_PATH%;%QT_PLUGIN_PATH%shell\;%PATH%" +set MSYSTEM=MINGW64 +``` +You can write your own script by referring to it if you need other client, then input the script path in the "Preload script path" editbox. \ No newline at end of file diff --git a/doc/tutorial/Quickstart/quickstart_zh_CN.md b/doc/tutorial/Quickstart/quickstart_zh_CN.md index c7452a0..c9b058a 100644 --- a/doc/tutorial/Quickstart/quickstart_zh_CN.md +++ b/doc/tutorial/Quickstart/quickstart_zh_CN.md @@ -46,4 +46,26 @@ ![](args_linux_zh_CN.png) (4) 若使用树莓派Raspbian系统且连接成功若干秒后PM3会自动断开,则需要在“设置”面板中勾选“在PM3断开后保持客户端运行” -![](keep_zh_CN.png) \ No newline at end of file +![](keep_zh_CN.png) + +## 预加载脚本 +客户端在运行时可能需要使用某些环境变量以解决依赖问题 +例如,Windows平台下的冰人客户端运行时需要以下环境变量 +``` +QT_PLUGIN_PATH=<客户端路径>\libs\ +QT_QPA_PLATFORM_PLUGIN_PATH=<客户端路径>\libs\ +PATH=<客户端路径>\libs\;<客户端路径>\libs\shell\;<原PATH变量> +MSYSTEM=MINGW64 +``` +因此,GUI会在加载客户端之前先运行"\<客户端路径\>\\setup.bat",从而在加载客户端时使用正确的环境变量。这些设置不会影响系统环境变量,仅对客户端本身有效 + +setup.bat的内容如下 +``` +@echo off +set "HOME=%~dp0" +set "QT_PLUGIN_PATH=%HOME%\libs\" +set "QT_QPA_PLATFORM_PLUGIN_PATH=%QT_PLUGIN_PATH%" +set "PATH=%QT_PLUGIN_PATH%;%QT_PLUGIN_PATH%shell\;%PATH%" +set MSYSTEM=MINGW64 +``` +如果需要使用其它客户端,你可以参考此文件编写自己的脚本,然后将其填入“预加载脚本路径”当中 \ No newline at end of file