Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion WeaselDeployer/WeaselDeployer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
static int Run(LPTSTR lpCmdLine) {
Configurator configurator;
configurator.Initialize();

if (!wcscmp(L"/?", lpCmdLine) || !wcscmp(L"/help", lpCmdLine)) {
WCHAR msg[1024] = {0};
if (LoadString(GetModuleHandle(NULL), IDS_STR_HELP, msg,
sizeof(msg) / sizeof(TCHAR))) {
MessageBox(NULL, msg, L"Weasel Deployer", MB_ICONINFORMATION | MB_OK);
} else {
MessageBox(NULL,
L"Usage: WeaselDeployer.exe [options]\n"
L"/? or /help - Show this help message\n"
L"/deploy - Update Workspace\n"
L"/dict - Manage dictionary\n"
L"/sync - Sync user data\n"
L"/install - Install Weasel (Initial deployment)",
L"Weasel Deployer", MB_ICONINFORMATION | MB_OK);
}
return 0;
}

bool deployment_scheduled = !wcscmp(L"/deploy", lpCmdLine);
if (deployment_scheduled) {
return configurator.UpdateWorkspace();
Expand All @@ -78,4 +97,4 @@ static int Run(LPTSTR lpCmdLine) {

bool installing = !wcscmp(L"/install", lpCmdLine);
return configurator.Run(installing);
}
}
Binary file modified WeaselDeployer/WeaselDeployer.rc
Binary file not shown.
1 change: 1 addition & 0 deletions WeaselDeployer/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define IDS_STR_RECORD_COUNT 155
#define IDS_STR_DICT_SNAPSHOT 156
#define IDS_STR_KCSS_DICT_SNAPSHOT 157
#define IDS_STR_HELP 158
#define IDC_SCHEMA_LIST 1000
#define IDC_SCHEMA_DESCRIPTION 1001
#define IDC_GET_SCHEMATA 1002
Expand Down
29 changes: 29 additions & 0 deletions WeaselSetup/WeaselSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,35 @@ LPCTSTR GetParamByPrefix(LPCTSTR lpCmdLine, LPCTSTR prefix) {
static int Run(LPTSTR lpCmdLine) {
constexpr bool silent = true;
constexpr bool old_ime_support = false;
// parameter /? or /help to show commandline args
if (!wcscmp(L"/?", lpCmdLine) || !wcscmp(L"/help", lpCmdLine)) {
WCHAR msg[1024] = {0};
if (LoadString(GetModuleHandle(NULL), IDS_STR_HELP, msg,
sizeof(msg) / sizeof(TCHAR))) {
MessageBox(NULL, msg, L"WeaselSetup", MB_ICONINFORMATION | MB_OK);
} else {
MessageBox(
NULL,
L"Usage: WeaselSetup.exe [options]\n"
L"/? or /help - Show this help message\n"
L"/u - Uninstall Weasel\n"
L"/i - Install Weasel\n"
L"/s - Install Weasel (Simplified Chinese)\n"
L"/t - Install Weasel (Traditional Chinese)\n"
L"/ls - Set Weasel language to Simplified Chinese\n"
L"/lt - Set Weasel language to Traditional Chinese\n"
L"/le - Set Weasel language to English\n"
L"/eu - Enable automatic update check\n"
L"/du - Disable automatic update check\n"
L"/toggleime - Toggle IME on open/close(ctrl+space)\n"
L"/toggleascii - Toggle ASCII on open/close(ctrl+space)\n"
L"/testing - Set update channel to testing\n"
L"/release - Set update channel to release\n"
L"/userdir:<dir> - Set user directory\n",
L"WeaselSetup", MB_ICONINFORMATION | MB_OK);
}
return 0;
}
bool uninstalling = !wcscmp(L"/u", lpCmdLine);
if (uninstalling) {
if (IsProcAdmin())
Expand Down
Binary file modified WeaselSetup/WeaselSetup.rc
Binary file not shown.
1 change: 1 addition & 0 deletions WeaselSetup/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define IDS_STR_ERR_WRITE_HANT 145
#define IDS_STR_MODIFY_SUCCESS_INFO 146
#define IDS_STR_MODIFY_SUCCESS_CAP 147
#define IDS_STR_HELP 148
#define IDD_INSTALL_OPTIONS 201
#define IDD_DIALOG1 203
#define IDC_RADIO_CN 1000
Expand Down
Loading