基于Windows10-1909环境源码安装res-downloader

res-downloader Windows 环境安装配置记录

项目概述

res-downloader 是一款基于 Go + Wails 的跨平台资源下载工具,支持多种网络资源的嗅探与下载,包括:

  • 微信视频号、小程序
  • 抖音、快手、小红书
  • 直播流、m3u8
  • 酷狗音乐、QQ音乐等

技术栈分析

根据GitHub仓库信息,项目使用以下技术栈:

  • 后端: Go (45.3%)
  • 前端: Vue.js (35.9%) + TypeScript (6.2%) + JavaScript (3.7%)
  • UI: CSS (1.3%) + HTML (0.2%)
  • 构建: NSIS (7.4%)

Windows 环境安装配置过程

系统环境信息

  • 操作系统:Windows 10 (版本 10.0.18363)
  • Shell:PowerShell 7
  • 工作目录:C:\code\11

步骤1:检查系统环境

首先检查当前系统环境:

# 检查系统信息
Get-ComputerInfo | Select-Object WindowsProductName, WindowsVersion, TotalPhysicalMemory

输出结果:

WindowsProductName WindowsVersion TotalPhysicalMemory
------------------ -------------- -------------------
Windows 10 Pro     1909

检查已安装的开发工具:

# 检查Node.js版本
node --version
# 输出:v16.14.2

# 检查npm版本  
npm --version
# 输出:8.5.0

# 检查Git(未安装)
git --version
# 输出:git: The term 'git' is not recognized...

# 检查Go(未安装)
go version
# 输出:go: The term 'go' is not recognized...

环境检查结果:

  • ✅ Node.js v16.14.2 (已安装)
  • ✅ npm 8.5.0 (已安装)
  • ❌ Git (未安装,需要安装)
  • ❌ Go (未安装,需要安装)

步骤2:安装Git

由于系统没有winget和chocolatey包管理器,我们使用PowerShell直接下载Git安装程序:

# 下载Git安装程序
Invoke-WebRequest -Uri "https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/Git-2.43.0-64-bit.exe" -OutFile "Git-2.43.0-64-bit.exe"

# 静默安装Git
Start-Process -FilePath "Git-2.43.0-64-bit.exe" -ArgumentList "/VERYSILENT", "/NORESTART" -Wait

# 刷新环境变量
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User")

# 验证安装
git --version

输出结果:

git version 2.43.0.windows.1

Git安装成功!

步骤3:安装Go

下载并安装Go 1.21.5版本:

# 设置TLS协议并下载Go安装程序
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri "https://go.dev/dl/go1.21.5.windows-amd64.msi" -OutFile "go1.21.5.windows-amd64.msi"

# 静默安装Go
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i", "go1.21.5.windows-amd64.msi", "/quiet", "/norestart" -Wait

# 刷新环境变量
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("PATH","User")

# 验证安装
go version

输出结果:

go version go1.21.5 windows/amd64

Go安装成功!

步骤4:安装Wails CLI

安装Wails CLI工具:

# 安装Wails CLI
go install github.com/wailsapp/wails/v2/cmd/wails@latest

# 验证安装
wails version

输出结果:

v2.10.2
 ♥   If Wails is useful to you or your company, please consider sponsoring the project:
https://github.com/sponsors/leaanthony

Wails CLI安装成功!

步骤5:克隆项目源码

# 克隆项目
git clone https://github.com/putyy/res-downloader.git

# 进入项目目录
cd res-downloader

# 查看项目结构
ls

输出结果:

Cloning into 'res-downloader'...
remote: Enumerating objects: 1267, done.
remote: Counting objects: 100% (188/188), done.
remote: Compressing objects: 100% (106/106), done.
remote: Total 1267 (delta 106), reused 82 (delta 82), pack-reused 1079 (from 1)
Receiving objects: 100% (1267/1267), 27.88 MiB | 15.25 MiB/s, done.
Resolving deltas: 100% (702/702), done.

项目结构:

Directory: C:\code\11\res-downloader

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d----           2025/7/19     8:52                .github
d----           2025/7/19     8:52                build
d----           2025/7/19     8:52                core
d----           2025/7/19     8:52                docs
d----           2025/7/19     8:52                frontend
-a---           2025/7/19     8:52             56 .gitignore
-a---           2025/7/19     8:52           1598 go.mod
-a---           2025/7/19     8:52           8294 go.sum
-a---           2025/7/19     8:52          11557 LICENSE
-a---           2025/7/19     8:52           2887 main.go
-a---           2025/7/19     8:52           4520 README-EN.md
-a---           2025/7/19     8:52           4036 README.md
-a---           2025/7/19     8:52            635 wails.json

步骤6:安装项目依赖

# 安装Go依赖
go mod download

# 安装前端依赖
cd frontend
npm install
cd ..

Go依赖安装输出:

go: downloading go1.23.2 (windows/amd64)

前端依赖安装输出:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'sass-loader@14.2.1',   
npm WARN EBADENGINE   current: { node: 'v16.14.2', npm: '8.5.0' }
npm WARN EBADENGINE }

added 263 packages, and audited 264 packages in 35s

57 packages are looking for funding
  run `npm fund` for details       

11 vulnerabilities (1 low, 9 moderate, 1 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
npm notice
npm notice New major version of npm available! 8.5.0 -> 11.4.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.4.2
npm notice Run npm install -g npm@11.4.2 to update!
npm notice

步骤7:编译项目

# 编译项目
wails build

编译输出:

Wails CLI v2.10.2

# Build Options
Platform(s)        | windows/amd64
Compiler           | C:\Program Files\Go\bin\go.exe
Skip Bindings      | false
Build Mode         | production
Devtools           | false
Frontend Directory | C:\code\11\res-downloader\frontend
Obfuscated         | false
Skip Frontend      | false
Compress           | false
Package            | true
Clean Bin Dir      | false
LDFlags            | 
Tags               | []
Race Detector      | false

Warning: go.mod is using Wails '2.10.1' but the CLI is 'v2.10.2'. Consider updating your project's `go.mod` file.

# Building target: windows/amd64

  • Generating bindings: Done.
  • Installing frontend dependencies: Done.
  • Compiling frontend: Done.
  • Generating application assets: Done.
  • Compiling application: Done.
 INFO  Wails is now using the new Go WebView2Loader. If you encounter any issues with it, please report them to https://github.com/wailsapp/wails/issues/2004. You
 could also use the old legacy loader with `-tags native_webview2loader`, but keep in mind this will be deprecated in the near future.
Built 'C:\code\11\res-downloader\build\bin\res-downloader.exe' in 1m54.827s.

编译成功!生成的可执行文件:

Directory: C:\code\11\res-downloader\build\bin

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           2025/7/19     8:56       18769408 res-downloader.exe

步骤8:运行应用

# 运行应用
.\build\bin\res-downloader.exe

应用启动成功!

在这里插入图片描述

安装配置总结

环境检查结果

  • ✅ Windows 10 Pro (版本 1909)
  • ✅ Node.js v16.14.2 (已安装)
  • ✅ npm 8.5.0 (已安装)
  • ✅ Git v2.43.0.windows.1 (新安装)
  • ✅ Go v1.21.5 (新安装)
  • ✅ Wails CLI v2.10.2 (新安装)

项目编译结果

  • ✅ 项目源码克隆成功
  • ✅ Go依赖安装成功
  • ✅ 前端依赖安装成功(有11个安全漏洞警告,但不影响运行)
  • ✅ 项目编译成功
  • ✅ 可执行文件生成:res-downloader.exe (18.7MB)
  • ✅ 应用启动成功

注意事项

  1. Node.js版本警告:当前使用Node.js v16.14.2,而sass-loader@14.2.1需要更高版本,但不影响编译
  2. 安全漏洞:npm安装时发现11个安全漏洞,建议后续运行npm audit fix修复
  3. Wails版本差异:项目go.mod使用Wails 2.10.1,而CLI是2.10.2,建议更新项目依赖
  4. 证书安装:首次运行应用时可能需要允许安装证书文件
  5. 网络访问:确保允许应用进行网络访问
  6. 代理设置:关闭应用后记得手动关闭系统代理

使用说明

1. 启动代理服务

  1. 打开应用
  2. 点击左上角"启动代理"按钮
  3. 选择要获取的资源类型
  4. 在外部打开目标资源页面
  5. 返回应用查看资源列表

2. 系统代理配置

应用启动后会自动设置系统代理:

  • 地址:127.0.0.1
  • 端口:8899

3. 常见问题解决

编译错误
# 清理缓存
go clean -cache
npm cache clean --force

# 重新安装依赖
go mod tidy
cd frontend && npm install && cd ..
权限问题
# 如果使用管理员权限运行
Start-Process -FilePath ".\build\bin\res-downloader.exe" -Verb RunAs
网络问题
# 检查端口占用
netstat -an | findstr :8899

# 检查防火墙设置
netsh advfirewall firewall show rule name=all | findstr "res-downloader"

参考链接


本指南基于 Windows 10 Pro 编写,其他 Windows 版本可能需要相应调整。

关注公众号:阅读更多文章

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值