Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Portable Mode #12

Closed
ag2s20150909 opened this issue Apr 6, 2022 · 5 comments
Closed

[FR] Portable Mode #12

ag2s20150909 opened this issue Apr 6, 2022 · 5 comments

Comments

@ag2s20150909
Copy link
Contributor

When a new folder named data is created in the current directory of the software executable, portable mode will use this folder as the base startup folder and as the Home Directory

@2dust
Copy link
Owner

2dust commented Apr 9, 2022

clashN is already in portable mode

@2dust 2dust closed this as completed Apr 9, 2022
@ag2s20150909
Copy link
Contributor Author

ag2s20150909 commented Apr 9, 2022

clashN is already in portable mode

But it store file in C:\Users\xxxx\.config\clash,when use local flie proxy-providers .
Because it depends on a specific absolute path, this is not a true portable mode

@2dust
Copy link
Owner

2dust commented Apr 10, 2022

proxy-providers type: http or file?
If http, you can download it yourself when you use it
If file, you can use absolute path

@ag2s20150909
Copy link
Contributor Author

proxy-providers type: http or file? If http, you can download it yourself when you use it If file, you can use absolute path

https://github.com/Dreamacro/clash/blob/30d4668008b493b65e7d6982b4c43bb34871e13c/main.go#L33

https://github.com/MetaCubeX/Clash.Meta/blob/4c8d651d6585bed810b82ce2e4d2e5e31a89f34d/main.go#L34

Clash core use -d set configuration directory(homeDir) and -f specify configuration file.
So It is easy to implement this feature.
1,Check whether the target folder exists in the current installation directory.
2, If it exists, add -d to the startup parameter to specify the homeDir

@2dust
Copy link
Owner

2dust commented Apr 12, 2022

clashN.zip
Test with this version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants