@@ -13,7 +13,7 @@ https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
13
13
Tagged releases are accessible here:
14
14
https://github.com/Winetricks/winetricks/releases
15
15
16
- # Installing
16
+ # Installing (Package)
17
17
The ``` winetricks ``` package should be used if it is available and up to date. The package is available in most mainstream (Unix-like) Operating Systems:
18
18
19
19
* Arch: https://www.archlinux.org/packages/community/any/winetricks/
@@ -28,151 +28,82 @@ The ```winetricks``` package should be used if it is available and up to date. T
28
28
29
29
Note: packaged Debian / Ubuntu winetricks versions are typically outdated, so a manual installation is recommended.
30
30
31
- If the package is unavailable, outdated, or the latest version is desired, a manual installation of winetricks can be done.
32
- It is _ highly_ recommended to uninstall any previously installed version of winetricks first.
31
+ # Automating Installation & Updating
33
32
34
- ** _ If you don't uninstall a previously installed, packaged version of winetricks... Well then you get to pick up the pieces!_ **
33
+ If the winetricks package is unavailable, outdated, or the latest version is desired, a manual auto-updating setup is recommended.
34
+ It is _ highly_ recommended to uninstall any previously installed version of winetricks first.
35
35
36
- E.g. for Debian / Ubuntu:
36
+ ** _ If you don't uninstall a previously installed, packaged version of winetricks... Well then you get to pick up the pieces! _ ** ... E.g. for Debian / Ubuntu:
37
37
```
38
38
sudo apt-get purge winetricks
39
39
```
40
40
41
- Then, for Ubuntu, use a shell script to download the current winetricks script(s).
42
- E.g.:
43
-
44
- ```
45
- # Create and switch to a temporary directory writeable by current user. See:
46
- # https://www.tldp.org/LDP/abs/html/subshells.html
47
- cd "$(mktemp -d)"
48
-
49
- # Use a BASH "here document" to create an updater shell script file.
50
- # See:
51
- # https://www.tldp.org/LDP/abs/html/here-docs.html
52
- # > outputs stdout to a file, overwriting any pre-existing file
53
- # << takes input, directly from the script itself, till the second '_EOF_SCRIPT' marker, as stdin
54
- # the cat command hooks these 2 streams up (stdin and stdout)
55
- ###### create update_winetricks START ########
56
- cat > update_winetricks <<_EOF_SCRIPT
57
- #!/bin/sh
58
-
59
- # Create and switch to a temporary directory writeable by current user. See:
60
- # https://www.tldp.org/LDP/abs/html/subshells.html
61
- cd "$(mktemp -d)"
62
-
63
- # Download the latest winetricks script (master="latest version") from Github.
64
- wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
65
-
66
- # Mark the winetricks script (we've just downloaded) as executable. See:
67
- # https://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/x9543.htm
68
- chmod +x winetricks
69
-
70
- # Move the winetricks script to a location which will be in the standard user PATH. See:
71
- # https://www.tldp.org/LDP/abs/html/internalvariables.html
72
- sudo mv winetricks /usr/bin
73
-
74
- # Download the latest winetricks BASH completion script (master="latest version") from Github.
75
- wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.bash-completion
76
-
77
- # Move the winetricks BASH completion script to a standard location for BASH completion modules. See:
78
- # https://www.tldp.org/LDP/abs/html/tabexpansion.html
79
- sudo mv winetricks.bash-completion /usr/share/bash-completion/completions/winetricks
80
- _EOF_SCRIPT
81
- ###### create update_winetricks FINISH ########
82
-
83
- # Mark the update_winetricks script (we've just written out) as executable. See:
84
- # https://www.tldp.org/LDP/GNU-Linux-Tools-Summary/html/x9543.htm
85
- chmod +x update_winetricks
86
-
87
- # We must escalate privileges to root, as regular Linux users do not have write access to '/usr/bin'.
88
- sudo mv update_winetricks /usr/bin/
89
- ```
90
-
91
- See the manpages for the individual functions, if you are not clear how they are being used, e.g.
92
- ```
93
- man mktemp
94
- man mv
95
- man wget
96
- man sudo
97
- ...
98
- ```
99
-
100
- An alternative updater script implementation, using ** su** in place of ** sudo** , is also possible:
101
-
102
- ```
103
- cd "$(mktemp -d)"
104
- cat > update_winetricks <<_EOF_SCRIPT
105
- #!/bin/sh
106
-
107
- cd "$(mktemp -d)"
108
- wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
109
- wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.bash-completion
110
- chmod +x winetricks
111
- su root sh -c 'mv winetricks /usr/bin ; mv winetricks.bash-completion /usr/share/bash-completion/completions/winetricks'
112
- _EOF_SCRIPT
113
-
114
- chmod +x update_winetricks
115
- su root sh -c 'mv update_winetricks /usr/bin/'
116
- ```
117
-
118
- To use ``` curl ``` instead of ``` wget ``` : subsitute all ``` wget ``` calls with ``` curl -O ``` , in the winetricks update script.
119
-
120
-
121
- # Updating
122
- Using the traditional Unix crontab...
123
- ```
124
- sudo ln "/usr/bin/update_winetricks" "/etc/cron.weekly/update_winetricks"
125
- ```
126
- Note: ensure you have a cron utility installed and enabled, on systems utilizing ** systemd** by default.
127
-
128
- The update script can be automated, to run on a set schedule, via (where available) ** systemd** units.
129
- E.g. to create a scheduled winetricks updater ** systemd** ** timer** unit, and an associated ** systemd** ** service** unit:
130
- ```
131
- cd "$(mktemp -d)"
132
- cat > winetricks_update.timer <<_EOF_TIMER_UNIT
133
- [Unit]
134
- Description=Run winetricks update script weekly (Saturday)
135
-
136
- [Timer]
137
- OnCalendar=Sat
138
- Persistent=true
139
-
140
- [Install]
141
- WantedBy=timers.target
142
- _EOF_TIMER_UNIT
143
-
144
- cat > winetricks_update.service <<_EOF_SERVICE_UNIT
145
- [Unit]
146
- Description=Run winetricks update script
147
- After=network.target
148
-
149
- [Service]
150
- ExecStart=/usr/bin/update_winetricks
151
- Type=oneshot
152
- _EOF_SERVICE_UNIT
153
-
154
- sudo mv winetricks_update.timer winetricks_update.service /etc/systemd/system/
155
- ```
156
- See:
157
- * [ freedesktop.org: systemd service unit] ( https://www.freedesktop.org/software/systemd/man/systemd.service.html )
158
- * [ freedesktop.org: systemd timer unit] ( https://www.freedesktop.org/software/systemd/man/systemd.timer.html )
159
-
160
- To start and enable the winetricks update timer:
161
- ```
162
- sudo systemctl daemon-reload
163
- sudo systemctl enable winetricks_update.timer
164
- sudo systemctl start winetricks_update.timer
165
- ```
166
-
167
- The core winetricks script can also be updated by simply doing:
168
- ```
169
- winetricks --self-update
170
- ```
171
- or:
172
- ```
173
- sudo winetricks --self-update
174
- ```
175
- for a system-wide winetricks installation.
41
+ <hr />
42
+
43
+ Steps to setup an winetricks auto-updater script (pulling the Git Master on a weekly basis)...
44
+
45
+ 1 . Simple shell script to download and install the current winetricks script(s):
46
+ ```
47
+ cat <<_EOF_SCRIPT | sudo install /dev/stdin /usr/bin/update_winetricks
48
+ #!/bin/sh
49
+
50
+ curl -sL https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks \
51
+ | sudo install /dev/stdin /usr/bin/winetricks
52
+ curl -sL https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks.bash-completion \
53
+ | sudo install /dev/stdin /usr/share/bash-completion/completions/winetricks
54
+ _EOF_SCRIPT
55
+ ```
56
+
57
+ 2. Automatically running the winetricks updater (update_winetricks) script. Use only **one** of the **two** service options:
58
+
59
+ * Option _i._ [Cron](https://en.wikipedia.org/wiki/Cron)-based.
60
+
61
+ * Option _ii._ [systemd](https://en.wikipedia.org/wiki/Systemd)-based (**Linux -only**).
62
+
63
+ <hr />
64
+
65
+ 1. Use Cron to auto-update winetricks (weekly):
66
+
67
+ ```
68
+ sudo ln -s "/usr/bin/update_winetricks" "/etc/cron.weekly/update_winetricks"
69
+ ```
70
+
71
+ <hr />
72
+
73
+ 2. Use a **systemd timer unit** and **systemd service unit** to auto-update winetricks (weekly).
74
+
75
+ **systemd timer unit** (calls the **systemd service unit** at a specified interval):
76
+ ```
77
+ cat > /etc/systemd/system/winetricks_update.timer <<_EOF_TIMER_UNIT | sudo install /dev/stdin /etc/systemd/system/winetricks_update.timer
78
+ [Unit]
79
+ Description=Run winetricks update script weekly (Saturday)
80
+
81
+ [Timer]
82
+ OnCalendar=Sat
83
+ Persistent=true
84
+
85
+ [Install]
86
+ WantedBy=timers.target
87
+ _EOF_TIMER_UNIT
88
+ ```
89
+ **systemd service unit** (this service does the work - it is called automatically by the **systemd timer unit**):
90
+ ```
91
+ cat << _EOF_SERVICE_UNIT | sudo install /dev/stdin /etc/systemd/system/winetricks_update.service
92
+ [Unit]
93
+ Description=Run winetricks update script
94
+ After=network.target
95
+
96
+ [Service]
97
+ ExecStart=/usr/bin/update_winetricks
98
+ Type=oneshot
99
+ _EOF_SERVICE_UNIT
100
+ ```
101
+ Enable and start the **systemd timer unit**:
102
+ ```
103
+ sudo systemctl daemon-reload
104
+ sudo systemctl enable winetricks_update.timer
105
+ sudo systemctl start winetricks_update.timer
106
+ ```
176
107
177
108
# Custom .verb files
178
109
New dll/settings/programs can be added to Winetricks by passing a custom .verb (format below)
0 commit comments