Skip to content

Commit 63f2791

Browse files
committed
feat: WeaselSetup.exe with new param /? or /help to show help info
1 parent 1004f39 commit 63f2791

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

WeaselSetup/WeaselSetup.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,35 @@ LPCTSTR GetParamByPrefix(LPCTSTR lpCmdLine, LPCTSTR prefix) {
145145
static int Run(LPTSTR lpCmdLine) {
146146
constexpr bool silent = true;
147147
constexpr bool old_ime_support = false;
148+
// parameter /? or /help to show commandline args
149+
if (!wcscmp(L"/?", lpCmdLine) || !wcscmp(L"/help", lpCmdLine)) {
150+
WCHAR msg[1024] = {0};
151+
if (LoadString(GetModuleHandle(NULL), IDS_STR_HELP, msg,
152+
sizeof(msg) / sizeof(TCHAR))) {
153+
MessageBox(NULL, msg, L"WeaselSetup", MB_ICONINFORMATION | MB_OK);
154+
} else {
155+
MessageBox(
156+
NULL,
157+
L"Usage: WeaselSetup.exe [options]\n"
158+
L"/? or /help - Show this help message\n"
159+
L"/u - Uninstall Weasel\n"
160+
L"/i - Install Weasel\n"
161+
L"/s - Install Weasel (Simplified Chinese)\n"
162+
L"/t - Install Weasel (Traditional Chinese)\n"
163+
L"/ls - Set Weasel language to Simplified Chinese\n"
164+
L"/lt - Set Weasel language to Traditional Chinese\n"
165+
L"/le - Set Weasel language to English\n"
166+
L"/eu - Enable automatic update check\n"
167+
L"/du - Disable automatic update check\n"
168+
L"/toggleime - Toggle IME on open/close(ctrl+space)\n"
169+
L"/toggleascii - Toggle ASCII on open/close(ctrl+space)\n"
170+
L"/testing - Set update channel to testing\n"
171+
L"/release - Set update channel to release\n"
172+
L"/userdir:<dir> - Set user directory\n",
173+
L"WeaselSetup", MB_ICONINFORMATION | MB_OK);
174+
}
175+
return 0;
176+
}
148177
bool uninstalling = !wcscmp(L"/u", lpCmdLine);
149178
if (uninstalling) {
150179
if (IsProcAdmin())

WeaselSetup/WeaselSetup.rc

2.8 KB
Binary file not shown.

WeaselSetup/resource.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define IDS_STR_ERR_WRITE_HANT 145
2525
#define IDS_STR_MODIFY_SUCCESS_INFO 146
2626
#define IDS_STR_MODIFY_SUCCESS_CAP 147
27+
#define IDS_STR_HELP 148
2728
#define IDD_INSTALL_OPTIONS 201
2829
#define IDD_DIALOG1 203
2930
#define IDC_RADIO_CN 1000

0 commit comments

Comments
 (0)