diff --git a/sys/ExternalProcess.cpp b/sys/ExternalProcess.cpp index 2b00f35..d05065f 100644 --- a/sys/ExternalProcess.cpp +++ b/sys/ExternalProcess.cpp @@ -141,15 +141,6 @@ namespace NekoGui_sys { void CoreProcess::Start() { show_stderr = false; - // set extra env - auto v2ray_asset_dir = NekoGui::FindCoreAsset("geoip.dat"); - if (!v2ray_asset_dir.isEmpty()) { - v2ray_asset_dir = QFileInfo(v2ray_asset_dir).absolutePath(); - env << "XRAY_LOCATION_ASSET=" + v2ray_asset_dir; - } - if (NekoGui::dataStore->core_ray_direct_dns) env << "NKR_CORE_RAY_DIRECT_DNS=1"; - if (NekoGui::dataStore->core_ray_windows_disable_auto_interface) env << "NKR_CORE_RAY_WINDOWS_DISABLE_AUTO_INTERFACE=1"; - // ExternalProcess::Start(); write((NekoGui::dataStore->core_token + "\n").toUtf8()); } diff --git a/ui/mainwindow_grpc.cpp b/ui/mainwindow_grpc.cpp index 64339dc..240baf3 100644 --- a/ui/mainwindow_grpc.cpp +++ b/ui/mainwindow_grpc.cpp @@ -304,10 +304,21 @@ void MainWindow::neko_start(int _id) { // bool rpcOK; QString error = defaultClient->Start(&rpcOK, req); - if (rpcOK && !error.isEmpty()) { - runOnUiThread([=] { MessageBoxWarning("LoadConfig return error", error); }); + if (!rpcOK) { return false; - } else if (!rpcOK) { + } + if (!error.isEmpty()) { + if (error.contains("configure tun interface")) { + auto r = QMessageBox::information(this, tr("Tun device misbehaving"), + tr("If you have trouble starting VPN, you can force reset nekobox_core process here and then try starting the profile again."), + tr("Reset"), tr("Cancel"), "", + 1, 1); + if (r == 0) { + GetMainWindow()->StopVPNProcess(true); + } + return false; + } + runOnUiThread([=] { MessageBoxWarning("LoadConfig return error", error); }); return false; } //