Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Clash Verge
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Clash Verge
Commits
6eee10d4
There was an error fetching the commit references. Please try again later.
Unverified
Commit
6eee10d4
authored
3 years ago
by
GyDi
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
chore: resolve wintun.dll
parent
2d95f2b0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/check.mjs
+42
-0
42 additions, 0 deletions
scripts/check.mjs
src-tauri/.gitignore
+1
-1
1 addition, 1 deletion
src-tauri/.gitignore
with
43 additions
and
1 deletion
scripts/check.mjs
+
42
−
0
View file @
6eee10d4
...
...
@@ -91,6 +91,47 @@ async function resolveSidecar() {
await
fs
.
remove
(
tempDir
);
}
/**
* only Windows
* get the wintun.dll (not required)
*/
async
function
resolveWintun
()
{
const
{
platform
}
=
process
;
if
(
platform
!==
"
win32
"
)
return
;
const
url
=
"
https://www.wintun.net/builds/wintun-0.14.1.zip
"
;
const
tempDir
=
path
.
join
(
cwd
,
"
pre-dev-temp
"
);
const
tempZip
=
path
.
join
(
tempDir
,
"
wintun.zip
"
);
const
wintunPath
=
path
.
join
(
tempDir
,
"
wintun/bin/amd64/wintun.dll
"
);
const
targetPath
=
path
.
join
(
cwd
,
"
src-tauri/resources
"
,
"
wintun.dll
"
);
if
(
!
FORCE
&&
(
await
fs
.
pathExists
(
targetPath
)))
return
;
await
fs
.
mkdirp
(
tempDir
);
if
(
!
(
await
fs
.
pathExists
(
tempZip
)))
{
await
downloadFile
(
url
,
tempZip
);
}
// unzip
const
zip
=
new
AdmZip
(
tempZip
);
zip
.
extractAllTo
(
tempDir
,
true
);
if
(
!
(
await
fs
.
pathExists
(
wintunPath
)))
{
throw
new
Error
(
`path not found "
${
wintunPath
}
"`
);
}
// move wintun.dll to resources
await
fs
.
rename
(
wintunPath
,
targetPath
);
// delete temp dir
await
fs
.
remove
(
tempDir
);
console
.
log
(
`[INFO]: resolve wintun.dll finished`
);
}
/**
* get the Country.mmdb (not required)
*/
...
...
@@ -123,4 +164,5 @@ async function downloadFile(url, path) {
/// main
resolveSidecar
().
catch
(
console
.
error
);
resolveWintun
().
catch
(
console
.
error
);
resolveMmdb
().
catch
(
console
.
error
);
This diff is collapsed.
Click to expand it.
src-tauri/.gitignore
+
1
−
1
View file @
6eee10d4
...
...
@@ -2,5 +2,5 @@
# will have compiled files and executables
/target/
WixTools
resources
/Country.mmdb
resources
sidecar
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment