Compare commits

...
13 Commits
17 changed files with 1003 additions and 1038 deletions
+3 -3
View File
@@ -1,12 +1,12 @@
pnpm run build
rustup default nightly
@REM rustup default nightly
@REM rem 使用rust nightly构建支持win7的版本,请先将根目录的windows.0.48.5 放入以下目录
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\lib\x64
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\lib\x86
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\atlmfc\lib\x64
@REM rem C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\你自己的版本\atlmfc\lib\x86
pnpm tauri build -- -Z build-std --target x86_64-win7-windows-msvc
@REM pnpm tauri build -- -Z build-std --target x86_64-win7-windows-msvc
rustup default stable
pnpm tauri build
pnpm run release
pnpm run release-win7
@REM pnpm run release-win7
+15 -4
View File
@@ -22,7 +22,7 @@ async function toggleVisibility() {
}
}
export async function useTray(init: boolean = false, beforExit: Function, handleConnection: Function) {
export async function useTray(init: boolean = false, beforExit: Function, handleConnection: Function, handleReconnect: Function) {
let tray;
try {
tray = await TrayIcon.getById(DEFAULT_TRAY_NAME);
@@ -31,7 +31,7 @@ export async function useTray(init: boolean = false, beforExit: Function, handle
tooltip: `EasyTierGame\n${pkg.version}`,
title: `EasyTierGame\n${pkg.version}`,
id: DEFAULT_TRAY_NAME,
menu: await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection) }),
menu: await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection, handleReconnect) }),
action: async e => {
toggleVisibility();
}
@@ -45,16 +45,17 @@ export async function useTray(init: boolean = false, beforExit: Function, handle
if (init) {
tray.setTooltip(`EasyTierGame\n${pkg.version}`);
tray.setShowMenuOnLeftClick(false);
tray.setMenu(await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection) }));
tray.setMenu(await Menu.new({ id: "main", items: await generateMenuItem(beforExit, handleConnection, handleReconnect) }));
}
return tray;
}
export async function generateMenuItem(beforExit: Function, handleConnection: Function) {
export async function generateMenuItem(beforExit: Function, handleConnection: Function, handleReconnect: Function) {
return [
await MenuItemShow("显示 / 隐藏"),
await MenuItemExchangeConnection("联机 / 断开", handleConnection),
await MenuItemReconnect("重新联机", handleReconnect),
await MenuItemTheme(),
await PredefinedMenuItem.new({ item: "Separator" }),
await MenuItemPublicPeers(),
@@ -63,6 +64,16 @@ export async function generateMenuItem(beforExit: Function, handleConnection: Fu
];
}
export async function MenuItemReconnect(text: string, handleReconnect: Function) {
return await MenuItem.new({
id: "reconnect",
text,
action: async () => {
await handleReconnect();
}
});
}
export async function MenuItemExit(text: string, beforExit: Function) {
return await MenuItem.new({
id: "quit",
+8 -5
View File
@@ -1,5 +1,5 @@
import { type UnlistenFn } from "@tauri-apps/api/event";
import { getCurrentWindow, PhysicalPosition, type WindowOptions, Window, currentMonitor } from "@tauri-apps/api/window";
import { getCurrentWindow, PhysicalPosition, type WindowOptions, Window, currentMonitor, PhysicalSize } from "@tauri-apps/api/window";
import { WebviewWindow } from "@tauri-apps/api/webviewWindow";
import type { WebviewLabel, WebviewOptions } from "@tauri-apps/api/webview";
import useMainStore from "@/stores/index";
@@ -44,18 +44,21 @@ export default async (
defaultOpts.parent = appWindow;
// console.error(logicalPosition);
if (defaultOpts.x == 0 && defaultOpts.y == 0) {
const appSize = await appWindow.outerSize();
const logicalAppSize = {
width: 340,
height: 305
}
const factor = await appWindow.scaleFactor();
const appPosition = await appWindow.outerPosition();
const logicalPosition = new PhysicalPosition(appPosition.x + appSize.width, appPosition.y).toLogical(factor);
const logicalPosition = new PhysicalPosition(appPosition.x + Math.ceil((logicalAppSize.width + 5) * factor), appPosition.y).toLogical(factor);
defaultOpts.x = logicalPosition.x;
defaultOpts.y = logicalPosition.y;
}
}
dialog = new WebviewWindow(label, { ...defaultOpts, ...options });
await dealCloseListener(dialog, label, beforeCloseFunc);
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
await dialog.show();
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
} else {
const visible = await dialog.isVisible();
if (visible) {
@@ -63,8 +66,8 @@ export default async (
} else {
const appWindow = getCurrentWindow();
await dealCloseListener(dialog, label, beforeCloseFunc);
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
await dialog.show();
afterCreatedFunc && (await afterCreatedFunc(dialog, appWindow));
}
}
};
+7 -7
View File
@@ -3,7 +3,7 @@
"private": true,
"author": "leizi97",
"description": "A simple network initiator based on Easytier",
"version": "1.4.6",
"version": "1.4.7",
"scripts": {
"dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0",
"build": "nuxt generate --dotenv env/.env.prod",
@@ -12,9 +12,9 @@
},
"devDependencies": {
"@element-plus/icons-vue": "^2.3.1",
"@element-plus/nuxt": "1.1.2",
"@element-plus/nuxt": "1.1.3",
"@nuxtjs/tailwindcss": "6.13.2",
"@pinia/nuxt": "0.11.0",
"@pinia/nuxt": "0.11.1",
"@tauri-apps/api": "2.5.0",
"@tauri-apps/cli": "2.5.0",
"@tauri-apps/plugin-cli": "^2.2.0",
@@ -28,14 +28,14 @@
"@vitejs/plugin-vue-jsx": "4.1.2",
"@vueuse/core": "12.7.0",
"archiver": "^7.0.1",
"element-plus": "2.9.11",
"element-plus": "2.10.2",
"less": "4.2.1",
"lodash-es": "^4.17.21",
"nuxt": "3.17.4",
"pinia": "3.0.2",
"nuxt": "3.17.5",
"pinia": "3.0.3",
"pinia-plugin-persistedstate": "4.3.0",
"postcss": "^8.4.38",
"prettier": "3.5.2",
"prettier-plugin-tailwindcss": "0.6.11"
"prettier-plugin-tailwindcss": "0.6.13"
}
}
+48 -4
View File
@@ -44,19 +44,43 @@
</ElTooltip>
</div>
<div class="flex flex-nowrap items-center gap-[5px]">
<ElCheckbox v-model="mainStore.config.enableKcpProxy">启用KCP代理</ElCheckbox>
<ElTooltip content="将TCP流量转为KCP流量,降低传输延迟,提升传输速度">
<ElCheckbox
@change="handleKcpProxyChange"
v-model="mainStore.config.enableKcpProxy"
>
启用KCP代理
</ElCheckbox>
<ElTooltip content="(不可与QUIC代理同时开启)将TCP流量转为KCP流量,降低传输延迟,提升传输速度">
<ElIcon><QuestionFilled /></ElIcon>
</ElTooltip>
<CoreVersionWarning version="2.2.0" />
</div>
<div class="flex flex-nowrap items-center gap-[5px]">
<ElCheckbox v-model="mainStore.config.disableKcpInput">禁用KCP输入</ElCheckbox>
<ElTooltip content="禁用KCP入站流量,其他开启KCP代理的节点无法连接到本节点">
<ElTooltip content="不允许其他节点使用 KCP 代理 TCP 流到此节点。开启 KCP 代理的节点访问此节点时,依然使用原始 TCP 连接">
<ElIcon><QuestionFilled /></ElIcon>
</ElTooltip>
<CoreVersionWarning version="2.2.0" />
</div>
<div class="flex flex-nowrap items-center gap-[5px]">
<ElCheckbox
@change="handleQuicProxyChange"
v-model="mainStore.config.enableQuicProxy"
>
启用QUIC代理
</ElCheckbox>
<ElTooltip content="(不可与KCP代理同时开启)使用 QUIC 代理 TCP 流,提高在 UDP 丢包网络上的延迟和吞吐量">
<ElIcon><QuestionFilled /></ElIcon>
</ElTooltip>
<CoreVersionWarning version="2.3.2" />
</div>
<div class="flex flex-nowrap items-center gap-[5px]">
<ElCheckbox v-model="mainStore.config.disableQuicInput">禁用QUIC输入</ElCheckbox>
<ElTooltip content="不允许其他节点使用 QUIC 代理 TCP 流到此节点。开启 QUIC 代理的节点访问此节点时,依然使用原始 TCP 连接">
<ElIcon><QuestionFilled /></ElIcon>
</ElTooltip>
<CoreVersionWarning version="2.3.2" />
</div>
<div><ElCheckbox v-model="mainStore.config.disableUdpHolePunching">禁用UDP打洞功能</ElCheckbox></div>
<div><ElCheckbox v-model="mainStore.config.disableIpv6">不使用IPv6</ElCheckbox></div>
<div class="flex flex-nowrap items-center gap-[5px]">
@@ -153,7 +177,9 @@
配置
</ElButton>
</ElTooltip>
<ElTooltip content="将本地端口转发到虚拟网络中的远程端口.如:udp://0.0.0.0:12345/10.126.126.1:23456,表示将本地UDP端口12345转发到虚拟网络中的10.126.126.1:23456.可以指定多个">
<ElTooltip
content="将本地端口转发到虚拟网络中的远程端口.如:udp://0.0.0.0:12345/10.126.126.1:23456,表示将本地UDP端口12345转发到虚拟网络中的10.126.126.1:23456.可以指定多个"
>
<ElIcon><QuestionFilled /></ElIcon>
</ElTooltip>
<CoreVersionWarning version="2.3.0" />
@@ -386,6 +412,24 @@
}
};
const handleKcpProxyChange = () => {
if (mainStore.config.enableKcpProxy) {
if (mainStore.config.enableQuicProxy) {
ElMessage.warning("KCP代理和QUIC代理不能同时开启");
}
mainStore.config.enableQuicProxy = false;
}
};
const handleQuicProxyChange = () => {
if (mainStore.config.enableQuicProxy) {
if (mainStore.config.enableKcpProxy) {
ElMessage.warning("KCP代理和QUIC代理不能同时开启");
}
mainStore.config.enableKcpProxy = false;
}
};
// 为bind_device功能增加改方法
const getGuids = async () => {
const guidsValue = await invoke<string[][]>("get_network_adapter_guids");
+95 -39
View File
@@ -272,21 +272,6 @@
{{ !data.isStart ? "启动联机" : "停止联机" }}
<template #dropdown>
<ElDropdownMenu>
<ElDropdownItem
command="import_config"
:icon="Link"
>
导入联机配置
</ElDropdownItem>
<ElDropdownItem
command="share_config"
:icon="Share"
>
分享联机配置
</ElDropdownItem>
<ElDropdownItem disabled>
<ElDivider class="!m-0 !h-[2px]" />
</ElDropdownItem>
<ElDropdownItem
:icon="SetUp"
command="create_server"
@@ -328,6 +313,27 @@
>
本地游戏列表
</ElDropdownItem>
<ElDropdownItem disabled>
<ElDivider class="!m-0 !h-[2px]" />
</ElDropdownItem>
<ElDropdownItem
command="import_config"
:icon="Link"
>
导入联机配置
</ElDropdownItem>
<ElDropdownItem
command="share_config"
:icon="Share"
>
分享联机配置
</ElDropdownItem>
<ElDropdownItem
command="reconnect"
:icon="RefreshRight"
>
重新联机
</ElDropdownItem>
</ElDropdownMenu>
</template>
</ElDropdown>
@@ -720,7 +726,7 @@
import { initStartWinIpBroadcast } from "~/composables/netcard";
import useMainStore from "@/stores/index";
import { ElMessage, ElMessageBox, ElTooltip } from "element-plus";
import { getCurrentWindow, type Window } from "@tauri-apps/api/window";
import { getCurrentWindow, PhysicalSize, type Window } from "@tauri-apps/api/window";
import { getAllWebviewWindows, WebviewWindow } from "@tauri-apps/api/webviewWindow";
import etWindows, { dataSubscribe } from "@/composables/windows";
import { resourceDir as getResourceDir, join } from "@tauri-apps/api/path";
@@ -746,6 +752,9 @@
async () => {
await handleConnection();
return data.isStart;
},
async () => {
await handleReconnect();
}
);
@@ -1085,8 +1094,8 @@
const list = await invoke<string[][][]>("fetch_easytier_list");
data.releaseList = [
...list.flat().filter(el => {
// console.log(el, el[0], el[2]);
return el && el[0] && el[2] && !el[2].includes("gui");
// console.log(el, el[0], el[2], el[3]); // el[3] 是prerelease bool值
return el && el[0] && el[2] && !el[2].includes("gui") && (el[3] != 'true' || !el[3]);
})
] as any;
coreManagementData.loading = false;
@@ -1174,6 +1183,10 @@
saveServerUrl = mainStore.basePeers.length > 0 ? mainStore.basePeers[0] || "" : "";
}
data.configJsonSeverUrl = guiJson.serverUrl;
if(guiJson.enableKcpProxy && guiJson.enableQuicProxy) {
// 如果同时开启kcp代理和quic代理,则禁用quic代理
guiJson.enableQuicProxy = false;
}
mainStore.$patch({
config: {
...mainStore.config,
@@ -1224,6 +1237,18 @@
await appWindow.show();
await appWindow.setFocus();
}
const appWindow = getCurrentWindow();
const logicalAppSize = {
width: 340,
height: 305
}
const scaleFactor = await appWindow.scaleFactor();
const size = new PhysicalSize(Math.ceil(logicalAppSize.width * scaleFactor), Math.ceil(logicalAppSize.height * scaleFactor));
appWindow.setSize(size);
appWindow.onScaleChanged(({ payload: { scaleFactor } }) => {
console.log("scaleFactor", scaleFactor);
appWindow.setSize(new PhysicalSize(Math.ceil(logicalAppSize.width * scaleFactor), Math.ceil(logicalAppSize.height * scaleFactor)));
});
};
let logsTimer: NodeJS.Timeout | null = null;
@@ -1234,7 +1259,7 @@
await initGuiJson();
await compatibleInitAutoStart();
// await initAutoStart();
await initStartWinIpBroadcast();
// await initStartWinIpBroadcast(); // 对于三层tun而言,winipbroadcast没有作用,先禁用
await compatibleIpv6Listener();
await getCoreVersion();
await listenObj.listenThreadId();
@@ -1400,10 +1425,16 @@
args.push("--compression", mainStore.config.compression);
}
if (mainStore.config.enableKcpProxy) {
args.push("--enable-kcp-proxy");
args.push("--enable-kcp-proxy", 'true');
}
if (mainStore.config.disableKcpInput) {
args.push("--disable-kcp-input");
args.push("--disable-kcp-input", 'true');
}
if (mainStore.config.enableQuicProxy) {
args.push("--enable-quic-proxy", 'true');
}
if (mainStore.config.disableQuicInput) {
args.push("--disable-quic-input", 'true');
}
if (mainStore.config.bindDeviceEnable) {
args.push("--bind-device", "true");
@@ -1423,7 +1454,7 @@
});
}
}
if(mainStore.config.privateMode) {
if (mainStore.config.privateMode) {
args.push("--private-mode", "true");
}
return args;
@@ -1535,6 +1566,8 @@
enablePreventSleep,
enableKcpProxy,
disableKcpInput,
enableQuicProxy,
disableQuicInput,
privateMode
} = mainStore.config;
const WT = btoa(
@@ -1569,6 +1602,8 @@
enablePreventSleep,
enableKcpProxy,
disableKcpInput,
enableQuicProxy,
disableQuicInput,
privateMode
}
})
@@ -1688,6 +1723,25 @@
}
);
}
if (command === "reconnect") {
handleReconnect();
}
};
const handleReconnect = async () => {
if (data.isStart) {
ElMessage.info({
message: "正在重新联机...",
duration: 2200
});
await handleConnection();
setTimeout(() => {
handleConnection();
}, 2000);
} else {
handleConnection();
}
};
const handleDeleteAdminConfig = async () => {
@@ -1926,24 +1980,26 @@
};
const storageDialog = async () => {
await etWindows("storage-listener", {
title: "自建服务器",
minWidth: 0,
minHeight: 0,
width: 0,
height: 0,
x: 9999,
y: 9999,
resizable: false,
transparent: true,
hiddenTitle: true,
alwaysOnBottom: true,
url: "#/storage-listener"
},
(dialog) => {
dialog.hide();
await etWindows(
"storage-listener",
{
title: "存储监听",
minWidth: 0,
minHeight: 0,
width: 0,
height: 0,
x: 9999,
y: 9999,
resizable: false,
transparent: true,
hiddenTitle: true,
alwaysOnBottom: true,
visible: false,
url: "#/storage-listener"
},
dialog => {
dialog.hide();
}
);
};
</script>
+5 -5
View File
@@ -10,7 +10,7 @@
name="netcard"
class="flex h-full flex-col"
>
<div>
<!-- <div>
<div>
<ElTooltip
content="找不到游戏房间时,就开启它后再尝试搜索房间(默认开启)
@@ -39,13 +39,13 @@
active-text="已开启"
inactive-text="已关闭"
></ElSwitch>
</div>
</div> -->
<div>
<ElTooltip
content="使用ForceBindIP启动应用 (强制绑定IP或者网卡),如果还没有启动联机,请先启动联机,联机成功后,点击刷新获取easytier生成的网卡"
>
<ElText>
方案2
方案1
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
</ElText>
</ElTooltip>
@@ -131,7 +131,7 @@
<div>
<ElTooltip content="设置网卡的跃点,提升网卡优先级,尝试将您联机使用的网卡跃点设置为最小,请先查询网卡信息">
<ElText>
方案3
方案2
<ElIcon class="ml-[3px]"><QuestionFilled /></ElIcon>
</ElText>
</ElTooltip>
@@ -502,7 +502,7 @@
onMounted(() => {
data.pingIp = mainStore.config.ipv4;
initStartWinIpBroadcast();
// initStartWinIpBroadcast();
getGuids();
});
+775 -940
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1253,7 +1253,7 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125"
[[package]]
name = "easytier-game"
version = "1.4.6"
version = "1.4.7"
dependencies = [
"hashbrown 0.15.2",
"log",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "easytier-game"
version = "1.4.6"
version = "1.4.7"
homepage = "https://github.com/EasyTier/EasyTier"
repository = "https://github.com/EasyTier/EasytierGame"
description = "A simple network initiator based on Easytier"
+1
View File
@@ -26,6 +26,7 @@
"core:tray:allow-get-by-id",
"core:tray:allow-set-icon",
"core:tray:allow-new",
"core:window:allow-set-size",
{
"identifier": "shell:allow-spawn",
"allow": [
+3 -1
View File
@@ -35,7 +35,9 @@
"netCardMetricValue": 1, // 网卡跃点
"enablePreventSleep": false, // 启用防止睡眠
"compression": "none", // 压缩算法
"enableKcpProxy": true, // 启用kcp代理
"enableKcpProxy": true, // 启用kcp代理,就不能启用quic代理
"disableKcpInput": false, // 禁用kcp输入
"enableQuicProxy": false, // 启用quic代理,就不能启用kcp代理
"disableQuicInput": false, // 禁用quic输入
"privateMode": false // 启用私有模式
}
Binary file not shown.
Binary file not shown.
+32 -24
View File
@@ -322,7 +322,11 @@ async fn get_route_by_cli() -> String {
}
#[tauri::command(rename_all = "snake_case")]
async fn download_easytier_zip(app_handle: tauri::AppHandle ,download_url: String, file_name: String) {
async fn download_easytier_zip(
app_handle: tauri::AppHandle,
download_url: String,
file_name: String,
) {
let cache_dir_path = get_tool_exe_path("\\easytier\\cache");
let cache_file_name = format!("{}\\{}", cache_dir_path, file_name);
let cache_file_name_path = path::Path::new(&cache_file_name);
@@ -355,14 +359,18 @@ async fn download_easytier_zip(app_handle: tauri::AppHandle ,download_url: Strin
while let Some(item) = response.chunk().await.unwrap() {
match file.write_all(&item) {
Ok(_) => {
app_handle.emit("download_core_progress", [item.len() as u64, context_size]).expect("error to emit download_core_progress");
},Err(why) => {
app_handle
.emit("download_core_progress", [item.len() as u64, context_size])
.expect("error to emit download_core_progress");
}
Err(why) => {
log::error!("error to write file: {}", why);
app_handle.emit("download_core_progress_error", why.to_string()).expect("error to emit download_core_progress_error");
return
app_handle
.emit("download_core_progress_error", why.to_string())
.expect("error to emit download_core_progress_error");
return;
}
};
}
println!("下载完成");
unzip(path);
@@ -512,18 +520,19 @@ fn stop_command(child_id: u32) {
}
#[tauri::command(rename_all = "snake_case")]
async fn fetch_easytier_list() -> Vec<Vec<[String; 3]>> {
async fn fetch_easytier_list() -> Vec<Vec<[String; 4]>> {
// 获取release列表
if let Ok(release) = fetch_releases().await {
let mut release_list = Vec::new();
let mut release_list: Vec<Vec<[String; 4]>> = Vec::new();
for re in release {
let mut assets_list = Vec::new();
let mut assets_list: Vec<[String; 4]> = Vec::new();
for asset in re.assets {
if asset.name.contains("windows-x86_64") {
assets_list.push([
re.tag_name.clone(),
asset.name.clone(),
asset.browser_download_url.clone(),
re.prerelease.to_string(),
]);
}
}
@@ -661,11 +670,11 @@ fn ensure_task_folder_and_cleanup(
unsafe {
let root = BSTR::from("\\");
let root_folder: ITaskFolder = task_service.GetFolder(&root)?;
match task_service.GetFolder(folder_path) {
Ok(existing_folder) => {
println!("任务文件夹已存在: {}", folder_path);
// 检查并清理现有任务
if let Ok(_existing_task) = existing_folder.GetTask(task_name) {
println!("发现同名任务: {},准备删除", task_name);
@@ -738,23 +747,23 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
&VARIANT::default(),
&VARIANT::default(),
)?;
let folder_path = BSTR::from("\\easytierGame");
let task_name = BSTR::from("auto start");
let task_definition = task_service.NewTask(0)?;
// 设置任务信息
let registration_info = task_definition.RegistrationInfo()?;
registration_info.SetDescription(&BSTR::from("EasytierGame auto start task"))?;
registration_info.SetAuthor(&BSTR::from("EasytierGame"))?;
// 改为用户登录触发
let triggers = task_definition.Triggers()?;
let trigger = triggers.Create(TASK_TRIGGER_LOGON)?;
let logon_trigger: ILogonTrigger = trigger.cast()?;
logon_trigger.SetEnabled(VARIANT_BOOL::from(true))?;
// 设置动作
let actions = task_definition.Actions()?;
let action = actions.Create(TASK_ACTION_EXEC)?;
@@ -763,14 +772,13 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
let exe_path: &str = exe.to_str().unwrap();
exec_action.SetPath(&BSTR::from(exe_path))?;
exec_action.SetArguments(&BSTR::from("--task-auto-start"))?;
// 使用当前用户运行
let principal = task_definition.Principal()?;
principal.SetUserId(&BSTR::from(whoami::username().as_str()))?;
principal.SetLogonType(TASK_LOGON_INTERACTIVE_TOKEN)?;
principal.SetRunLevel(TASK_RUNLEVEL_HIGHEST)?;
// 设置任务设置
let settings = task_definition.Settings()?;
settings.SetEnabled(VARIANT_BOOL::from(true))?;
@@ -778,12 +786,12 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
settings.SetStartWhenAvailable(VARIANT_BOOL::from(true))?;
// settings.SetHidden(VARIANT_BOOL::from(true))?; // 注释掉让任务可见
settings.SetExecutionTimeLimit(&BSTR::from("PT0S"))?;
settings.SetDisallowStartIfOnBatteries(VARIANT_BOOL(0))?; // 允许在电池供电时启动
// 获取文件夹并注册任务
let task_folder = ensure_task_folder_and_cleanup(&task_service, &folder_path, &task_name)?;
let task_folder =
ensure_task_folder_and_cleanup(&task_service, &folder_path, &task_name)?;
let _auto_task = task_folder.RegisterTaskDefinition(
&task_name,
&task_definition,
@@ -791,9 +799,9 @@ fn autostart(enabled: bool) -> std::result::Result<(), Box<dyn std::error::Error
&VARIANT::default(),
&VARIANT::default(),
TASK_LOGON_INTERACTIVE_TOKEN,
&VARIANT::default()
&VARIANT::default(),
)?;
CoUninitialize();
}
}
+4 -4
View File
@@ -1,7 +1,7 @@
{
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "easytier-game",
"version": "1.4.6",
"version": "1.4.7",
"identifier": "com.tauri.easytier-game",
"build": {
@@ -12,14 +12,14 @@
"app": {
"windows": [
{
"title": "easytier-game 1.4.6",
"title": "easytier-game 1.4.7",
"label": "main",
"minWidth": 340,
"width": 340,
"height": 305,
"minHeight": 305,
"maxHeight": 305,
"maxWidth": 360,
"maxHeight": 405,
"maxWidth": 460,
"resizable": true,
"fullscreen": false,
"decorations": true,
+5
View File
@@ -44,6 +44,8 @@ const store = defineStore("main", {
compression: "none", //加密算法
enableKcpProxy: true, //启用kcp代理 默认开启
disableKcpInput: false, //禁用kcp输入
enableQuicProxy: false, //启用quic代理 默认开启
disableQuicInput: false, //禁用quic输入
bindDeviceEnable: false, //是否绑定设备
acceptDNS: false, //魔法dns
privateMode: false, //是否启用私有模式
@@ -130,6 +132,9 @@ const store = defineStore("main", {
"config.enableKcpProxy",
"config.disableKcpInput",
"config.enableQuicProxy",
"config.disableQuicInput",
"config.bindDeviceEnable",