diff --git a/.gitignore b/.gitignore index 815b01f..66c28c6 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ dist-ssr *.sln *.sw? .npmrc +output package-lock.json yarn.lock diff --git a/README.md b/README.md index baa53d0..9a9e7f1 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,10 @@ 此外还支持双击头部进行全屏切换,拖拽头部进行移动窗口,还有其他需求,欢迎提过来。 +## 已知Bug +- Windows下不能安装到C:\Program File,会直接闪退。建议安装到其他目录,比如D:\Program Files。 +- Linux下暂时不能存cookie,即应用关闭后数据清空,账号自动推出。 + ## 开发 开始前参考 [Tauri](https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-macos) 快速配置好环境,如果你想打包 Windows、Linux 系统的包,可以参考 [Building](https://tauri.app/v1/guides/building/) 文档 diff --git a/README_EN.md b/README_EN.md index 07031c9..0c7f6ab 100644 --- a/README_EN.md +++ b/README_EN.md @@ -90,6 +90,10 @@ More common apps can be downloaded from [Releases](https://github.com/tw93/Pake/ In addition, it supports double clicking the head to switch to full screen, and dragging the head to move the window +## Bugs +- It cannot be installed to C:\Program File under Windows, and it will crash directly. It is recommended to install to another directory, such as D:\Program Files. +- Under Linux, cookies cannot be stored temporarily, that is, the data will be cleared after the application is closed, and the account will be automatically released. + ## Development Refer to the [Tauri documentation](https://tauri.app/v1/guides/getting-started/prerequisites#setting-up-macos) to quickly configure your environment before you start, if you want to package Windows or Linux systems, you can refer to [Building](https://tauri.app/v1/guides/building/) Documentation. diff --git a/app.csv b/app.csv new file mode 100644 index 0000000..146a9d4 --- /dev/null +++ b/app.csv @@ -0,0 +1,4 @@ +weread,微信阅读,weread.qq.com +aliyuque,语雀,www.yuque.com +flomo,浮墨,flomoapp.com +weread,微信阅读,weread.qq.com \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..7ec3ece --- /dev/null +++ b/build.bat @@ -0,0 +1,68 @@ +@echo off +chcp 65001 + +if not exist node_modules ( + call npm i +) + +if not exist output ( + mkdir output +) + + +if not exist output\windows ( + mkdir output\windows +) + + echo. + echo ======================= + echo "build for windows" + echo ======================= + echo. + +:: total package number +set /A index=1 +set /A total=4 + +set old_name=weread +set old_zh_name=微信阅读 +set old_url=weread.qq.com + +for /f "tokens=1-3 delims=," %%i in (app.csv) do ( + setlocal enabledelayedexpansion + set name=%%i + set name_zh=%%j + set url=%%k + @echo on + + ::echo name is !name! !name_zh! !url! + :: replace url + .\sd.exe !old_url! !url! src-tauri\tauri.conf.json + ::replace pacakge name + .\sd.exe !old_name! !name! src-tauri\tauri.conf.json + echo update ico with 32x32 pictue + echo .\sd.exe !old_name! !name! src-tauri\src\main.rs + .\sd.exe !old_name! !name! src-tauri\src\main.rs + ::copy src-tauri\png\!name!_32.ico src-tauri\icons\icon.ico + echo. + ::update package info + set old_zh_name=!name_zh! + set old_name=!name! + set old_url=!url! + ::build package + echo building package !index!/!total! + echo package name is !name! !name_zh! + echo npm run build:windows + @echo off + call npm run tauri build -- --target x86_64-pc-windows-msvc + move src-tauri\target\x86_64-pc-windows-msvc\release\bundle\msi\*.msi output\windows + + @echo on + echo package build success! + echo. + echo. + + set /A index=index+1 + @echo off + +) diff --git a/sd.exe b/sd.exe new file mode 100644 index 0000000..285ed10 Binary files /dev/null and b/sd.exe differ diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 4d252c0..8d25526 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -122,7 +122,7 @@ fn main() -> wry::Result<()> { }) .with_inner_size(wry::application::dpi::LogicalSize::new(width, height)); #[cfg(target_os = "windows")] - let icon_path = concat!(env!("CARGO_MANIFEST_DIR"), "/icons/icon.ico"); + let icon_path = concat!(env!("CARGO_MANIFEST_DIR"), "/png/weread_32.ico"); #[cfg(target_os = "windows")] let icon = load_icon(std::path::Path::new(icon_path)); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 03860cc..cd95dcd 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -20,7 +20,7 @@ "bundle": { "icon": [ "icons/weread.icns", - "icons/icon.ico", + "png/weread_32.ico", "png/weread_512.png" ], "identifier": "com.tw93.weread",