Skip to content

Commit

Permalink
feat: add support for VCC Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmo-ds committed Mar 22, 2024
1 parent f332147 commit 89a9cea
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VCC(VRChat Creator Companion) 的翻译脚本, 用于自动翻译 VCC 的界面.
- [简体中文](./localization/zh-hans.json)
- [繁体中文](./localization/zh-hant.json)

> **Todo**
> [!NOTE]
> [v1.3.0](https://github.com/gizmo-ds/vcc-auto-translate/releases/tag/v1.3.0-beta) 以后的版本不再对 VCC v2.2.2
> 以前的版本进行适配, 如有需要使用旧版本, 请下载`v1.3.0`之前的版本.
> 因爲進行了較大的更新, 繁体中文的翻譯還需要一點時間.
Expand All @@ -25,9 +25,11 @@ VCC(VRChat Creator Companion) 的翻译脚本, 用于自动翻译 VCC 的界面.
## 自动安装

你可以通过 [Release](https://github.com/gizmo-ds/vcc-auto-translate/releases/latest) 下载预编译的安装工具并运行,
该工具会自动安装翻译脚本.
该工具会自动安装翻译脚本.
如果出现错误, 请尝试将安装工具移动到 VCC 安装目录下运行. (与`CreatorCompanion.exe`同目录)

> 如果出现错误, 请尝试将安装工具移动到 VCC 安装目录下运行. (与`CreatorCompanion.exe`同目录)
> [!IMPORTANT]
> VCC Beta 版本必须将安装工具移动到 VCC Beta 目录下运行. (与`CreatorCompanionBeta.exe`同目录)
## 如何移除翻译脚本?

Expand Down
Binary file modified bun.lockb
Binary file not shown.
8 changes: 4 additions & 4 deletions cmd/installer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"os"
"path/filepath"

"vcc-auto-translate-installer/cmd/installer/utils"

"github.com/PuerkitoBio/goquery"
Expand Down Expand Up @@ -35,19 +36,18 @@ type stackTracer interface {
func main() {
fmt.Println(t("banner"))

var err error
var vccInstallPath string
_, err := os.Stat("CreatorCompanion.exe")
if err != nil {
if !utils.FilesExist("CreatorCompanion.exe", "CreatorCompanionBeta.exe") {
vccInstallPath, err = utils.FindVCCInstallPath()
if err != nil {
fmt.Println(t("error", err.Error()))
pause()
os.Exit(2)
}
fmt.Println(t("vcc-path", vccInstallPath))
}

fmt.Println(t("vcc-path", vccInstallPath))

if err = installer(vccInstallPath); err != nil {
if e, ok := err.(stackTracer); ok {
fmt.Printf("%v: %s\n", e.StackTrace()[0], t("error", err.Error()))
Expand Down
9 changes: 9 additions & 0 deletions cmd/installer/utils/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,12 @@ func CopyFile(src, dst string) (int64, error) {
written, err := io.Copy(d, source)
return written, err
}

func FilesExist(files ...string) bool {
for _, file := range files {
if _, err := os.Stat(file); err == nil {
return true
}
}
return false
}

0 comments on commit 89a9cea

Please sign in to comment.