The-Wineskin-Project / WineskinServer

Wineskin
GNU Lesser General Public License v2.1
2.47k stars 170 forks source link

using winetricks with proxy available? #483

Closed PYUDNG closed 1 year ago

PYUDNG commented 1 year ago

Is your feature request related to a problem? Please describe. I'm using wineskin in China, where github.com and archieve.org isn't directly available. To connect to these websites, I use a proxy and set http_proxy=127.0.0.1:proxyport and https_proxy=127.0.0.1:proxyport in my ~/.bash_profile so that whenever I uses bash in my terminal app, the proxy is used by bash. But when I use winetricks inside wineskin, this does not seem to work, maybe ~/.bash_profile is not loaded at all.

Describe the solution you'd like The best solution I can think of is to allow users to execute some commands before winetricks xxx... is executed. In this way, users can run source ~/.bash_profile; winetricks xxx... or http_proxy=127.0.0.1:proxyport; https_proxy=127.0.0.1:proxyport; winetricks xxx... and other commands like these. This solution can be reached by providing a text box to input these commands, or executing a custom bash script automatically before executing winetricks command. In this way, not only proxies can be set but also other works (e.g. setting environment variables) can be done.

Describe alternatives you've considered Another solution is to provide a --proxy flag, which specifics which proxy address to connect, so that users can use winetricks with their proxy.

Additional context ---

Gcenx commented 1 year ago

You can directly set environment exports using the Unix Commands field.

Also added a new env to winetricks WINETRICKS_PROXY that sets --proxy with the contents of WINETRICKS_PROXY, this would also be side via Unix Commands field.

PYUDNG commented 1 year ago

How to use Unix Commands field? Do I have to edit some files like ~/.bashrc or I have to do something else? I tried googling but still can't understand what Unix Commands field is

Edited: Oh I found the Unix Commands field. It's just an inputbox in wineskin advanced, not a Unix system utility. Thanks for your time!

PYUDNG commented 1 year ago

Another problem: How can I use the Unix Commands field? I writed export WINETRICKS_PROXY=127.0.0.1:proxyport in Unix Commands field and then ran winetricks, but seems proxy isn't used. I tested my proxy in bash and my web browser and it works, so I think I may be using the Unix Commands field in the wrong way.

Gcenx commented 1 year ago
export WINETRICKS_PROXY=“127.0.0.1:proxyport”

It needs to be quoted like the above example, or directly add the env you have in your environment.

export http_proxy=“127.0.0.1:proxyport”; export https_proxy=“127.0.0.1:proxyport”

if nether of the above work let me know so I can make modifications to WineskinLauncher to handle this.

PYUDNG commented 1 year ago

This command works:

export WINETRICKS_PROXY="127.0.0.1:proxyport"

Thank you!