-
Notifications
You must be signed in to change notification settings - Fork 13
/
wine-wrapper
55 lines (42 loc) · 2.05 KB
/
wine-wrapper
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash
# TODO: update user paths and system details in registry
# TODO: handle common appdata
# TODO: update machine ids
# - Software\\Microsoft\\Cryptography: MachineGuid
# TODO: maybe system can be read-only
cp -u /app/extra/{system,user,userdef}.reg ~/.wine/
[ -L ~/.wine/drive_c ] ||
ln -s /app/extra/drive_c ~/.wine/drive_c
mkdir -p ~/.wine/dosdevices
[ -L ~/.wine/drive_c/c\: ] ||
ln -s ../drive_c ~/.wine/dosdevices/c\:
[ -L ~/.wine/drive_c/z\: ] ||
ln -s / ~/.wine/dosdevices/z\:
cp --update --preserve=timestamps /app/extra/.update-timestamp ~/.wine/
mkdir -p ${WINE_CACHE}/windows/{Installer,logs,temp}
mkdir -p ${WINE_PUBLIC}/{Desktop,Documents,Music,Pictures,Videos}
mkdir -p "${WINE_LOCAL_APPDATA}"/Microsoft/Windows/{History,INetCache,INetCookies}
mkdir -p "${WINE_LOCALLOW_APPDATA}"
mkdir -p "${WINE_APPDATA}"/Microsoft/Windows/{"Network Shortcuts","Printer Shortcuts",Recent,SendTo,Themes}
mkdir -p "${WINE_APPDATA}"/Microsoft/Windows/"Start Menu"/Programs/{"Administrative Tools",StartUp}
[ -L "${WINE_APPDATA}"/Microsoft/Windows/Templates ] ||
ln -s "$(xdg-user-dir TEMPLATES)" "${WINE_APPDATA}"/Microsoft/Windows/Templates
mkdir -p "${WINE_USERPROFILE}"/{Contacts,Favorites,Links,"Saved Games",Searches,Temp}
[ -L "${WINE_USERPROFILE}"/Desktop ] ||
ln -s "$(xdg-user-dir DESKTOP)" "${WINE_USERPROFILE}"/Desktop
[ -L "${WINE_USERPROFILE}"/Documents ] ||
ln -s "$(xdg-user-dir DOCUMENTS)" "${WINE_USERPROFILE}"/Documents
[ -L "${WINE_USERPROFILE}"/Downloads ] ||
ln -s "$(xdg-user-dir DOWNLOAD)" "${WINE_USERPROFILE}"/Downloads
[ -L "${WINE_USERPROFILE}"/Music ] ||
ln -s "$(xdg-user-dir MUSIC)" "${WINE_USERPROFILE}"/Music
[ -L "${WINE_USERPROFILE}"/Pictures ] ||
ln -s "$(xdg-user-dir PICTURES)" "${WINE_USERPROFILE}"/Pictures
[ -L "${WINE_USERPROFILE}"/Videos ] ||
ln -s "$(xdg-user-dir VIDEOS)" "${WINE_USERPROFILE}"/Videos
[ "$USER" = "User" ] ||
[ -L ${WINE_PROFILESDIRECTORY}/"$USER" ] ||
ln -s User ${WINE_PROFILESDIRECTORY}/"$USER"
[ -f "$WINE_APP_INIT" ] &&
source "$WINE_APP_INIT"
exec wine "$WINE_EXEC" "$WINE_ARGS" "$@"