prevent some other bullshit situations

This commit is contained in:
DuckSoft 2020-07-05 15:26:50 +08:00
parent 6eb5647c7b
commit 61a6616862

View File

@ -805,6 +805,19 @@ void PreferencesWindow::on_checkVCoreSettings_clicked()
if (answer == QMessageBox::StandardButton::Abort) if (answer == QMessageBox::StandardButton::Abort)
return; return;
} }
else if (vCorePathSmallCased.endsWith("v2ctl") || vCorePathSmallCased.endsWith("v2ctl.exe"))
{
const auto strWarnTitle = tr("Watch Out!");
const auto strWarnContent = //
tr("You may be about to set V2Ray core incorrectly to V2Ray Control executable, which is absolutely not correct.\r\n"
"The filename of V2Ray core is usually 'v2ray' or 'v2ray.exe'. Make sure to choose it wisely.\r\n"
"If you insist to proceed, we're not providing with any support.");
const auto answer = QMessageBox::warning(this, strWarnTitle, strWarnContent, //
QMessageBox::StandardButton::Abort | QMessageBox::StandardButton::Ignore, //
QMessageBox::StandardButton::Abort);
if (answer == QMessageBox::StandardButton::Abort)
return;
}
if (!V2rayKernelInstance::ValidateKernel(vcorePath, vAssetsPath, &result)) if (!V2rayKernelInstance::ValidateKernel(vcorePath, vAssetsPath, &result))
{ {