You need to sign in or sign up before continuing.
autoinstall 10.4 KB
Newer Older
Mikhail Tergoev's avatar
Mikhail Tergoev committed
1 2 3
#!/bin/bash
# Author: Castro-Fidel (PortWINE-Linux.ru)
########################################################################
4
kill_portwine
5
sleep 3
Mikhail Tergoev's avatar
Mikhail Tergoev committed
6
export PW_USER_TEMP="$WINEPREFIX/drive_c/users/${USER}/Temp"
7
export PW_FORCE_LARGE_ADDRESS_AWARE=0
8
export PW_USE_GAMEMODE=0
Mikhail Tergoev's avatar
Mikhail Tergoev committed
9
export PW_CHECK_AUTOINSTAL=1
10
export PW_GUI_DISABLED_CS=1
Mikhail Tergoev's avatar
Mikhail Tergoev committed
11
export PW_WINEDBG_DISABLE=1
12 13
export PW_NO_WRITE_WATCH=0
export PW_VULKAN_USE=0
14 15
unset PW_WINE_VER
export PW_WINE_USE=proton_steam
16 17
export PW_NO_FSYNC=1
export PW_NO_ESYNC=1
Mikhail Tergoev's avatar
Mikhail Tergoev committed
18
unset PORTWINE_CREATE_SHORTCUT_NAME
19
export PW_DISABLED_CREAT_DB=1
20

Mikhail Tergoev's avatar
Mikhail Tergoev committed
21
PW_WGC () {
22
    export LAUNCH_PARAMETERS=("/VERYSILENT")
Mikhail Tergoev's avatar
Mikhail Tergoev committed
23
    [ "${update_loc}" = "RUS" ] && export WGC_LOC=RU || export WGC_LOC=EU
24
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/Wargaming_Game_Center_Install_WoT_${WGC_LOC}.exe"
25
    start_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
26 27
    if try_download "https://redirect.wargaming.net/WGC/Wargaming_Game_Center_Install_WoT_${WGC_LOC}.exe" "${PW_AUTOINSTALL_EXE}"
    then
28
        pw_start_progress_bar_block "Starting WGC installation..."
29
        pw_kill_autostart wgc.exe &
30
        pw_run "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
31 32
        portwine_exe="$WINEPREFIX/drive_c/ProgramData/Wargaming.net/GameCenter/wgc_api/wgc_api.exe"
        export PORTWINE_CREATE_SHORTCUT_NAME="Wargaming Game Center"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
33
        try_remove_file "${PW_AUTOINSTALL_EXE}"
34 35
        kill_portwine
        portwine_create_shortcut
Mikhail Tergoev's avatar
Mikhail Tergoev committed
36
    fi
37
    stop_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
38 39
}

Mikhail Tergoev's avatar
Mikhail Tergoev committed
40 41 42
PW_ORIGIN () {
    export LAUNCH_PARAMETERS=("/silent" )
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/OriginSetup.exe"
43
    start_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
44 45
    if try_download "https://download.dm.origin.com/origin/live/OriginSetup.exe" "${PW_AUTOINSTALL_EXE}"
    then
46
        pw_start_progress_bar_block "Installing the Origin. Please wait..."
47
        pw_kill_autostart Origin.exe &
48
        pw_run "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
49
        portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/Origin/Origin.exe"
50
        pw_stop_progress_bar
Mikhail Tergoev's avatar
Mikhail Tergoev committed
51
        try_remove_file "${PW_AUTOINSTALL_EXE}"
52 53
        kill_portwine
        portwine_create_shortcut
Mikhail Tergoev's avatar
Mikhail Tergoev committed
54
    fi
55
    stop_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
56 57 58 59 60
}

PW_BATTLE_NET () {
    [ "${update_loc}" = "RUS" ] && export BN_LOC=ruRU || export BN_LOC=enUS
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/Battle.net-Setup-${BN_LOC}.exe"
61
    start_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
62 63 64
    if try_download "http://dist.blizzard.com/downloads/bna-installers/322d5bb9ae0318de3d4cde7641c96425/retail.1/Battle.net-Setup-${BN_LOC}.exe" "${PW_AUTOINSTALL_EXE}"
    then
        PW_START_PROGRESS_BAR "Installing the Battle Net. Please wait..."
65
        pw_kill_autostart Battle.net.exe &
66
        pw_run "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
67 68
        portwine_exe=`find "$WINEPREFIX/drive_c/" -type f -name "Battle.net.exe"`
        PW_STOP_PROGRESS
69
        portwine_create_shortcut
70
        try_remove_file "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
71
    fi
72
    stop_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
73 74 75 76 77
}

PW_EPIC () {
    export LAUNCH_PARAMETERS=("/q" )
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/EpicGamesLauncherInstaller.msi"
78
    start_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
79 80
    if try_download "https://launcher-public-service-prod06.ol.epicgames.com/launcher/api/installer/download/EpicGamesLauncherInstaller.msi" "${PW_AUTOINSTALL_EXE}"
    then
81
        pw_start_progress_bar_block "Installing Epic Games Launcher. Please wait..."
82
        pw_kill_autostart EpicGamesLauncher.exe &
83
        pw_run msiexec /i "${PW_AUTOINSTALL_EXE}" &
Mikhail Tergoev's avatar
Mikhail Tergoev committed
84
        sleep 10
85
        if [ ! -z `pgrep msiexec* | head -n 1` ] ; then
86 87
            while [ ! -z `pgrep msiexec* | head -n 1` ] || [ ! -z `pgrep rundll32* | head -n 1` ] || [ ! -z `pgrep -a wrap | grep ${portname} | head -n 1` ]
            do
Mikhail Tergoev's avatar
Mikhail Tergoev committed
88 89 90 91 92 93
                [ ! -z `pgrep rundll32* | head -n 1` ] && kill -n 9 `pgrep rundll32* | head -n 1` && echo "Kill rundll32.exe"
                sleep 5
            done
        fi
        portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/Epic Games/Launcher/Portal/Binaries/Win32/EpicGamesLauncher.exe"
        try_remove_file "${PW_AUTOINSTALL_EXE}"
94 95 96
        kill_portwine
        pw_stop_progress_bar
        portwine_create_shortcut
Mikhail Tergoev's avatar
Mikhail Tergoev committed
97
    fi
98
    stop_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
99 100 101
}

PW_GOG () {
102 103
    export LAUNCH_PARAMETERS=("/VERYSILENT")
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/setup_galaxy_2.0.37.384.exe"
104
    start_portwine
105
    if try_download "https://content-system.gog.com/open_link/download?path=/open/galaxy/client/2.0.37.384/setup_galaxy_2.0.37.384.exe" "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
106
    then
107
        pw_start_progress_bar_block "Installing the GOG Galaxy. Please wait..."
108
        pw_kill_autostart GalaxyClient.* &
109
        pw_run "${PW_AUTOINSTALL_EXE}"
110
        portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/GOG Galaxy/GalaxyClient.exe"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
111
        try_remove_file "${PW_AUTOINSTALL_EXE}"
112 113 114
        kill_portwine
        pw_stop_progress_bar
        portwine_create_shortcut
Mikhail Tergoev's avatar
Mikhail Tergoev committed
115
    fi
116
    stop_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
117 118 119 120 121
}

PW_EVE () {
    export PW_WINDOWS_VER=10
    export PW_DLL_INSTALL="vcrun2017"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
122
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/EveLauncher-1892908.exe"
123
    start_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
124
    if try_download "https://binaries.eveonline.com/EveLauncher-1892908.exe" "${PW_AUTOINSTALL_EXE}"
Mikhail Tergoev's avatar
Mikhail Tergoev committed
125
    then
126
        pw_start_progress_bar_block "Installing the EVE Launcher. Please wait..."
127 128 129 130 131 132 133
        if [ ! -f "$WINEPREFIX/drive_c/Games/EVE Online/Launcher/evelauncher.exe" ] ; then
            try_remove_dir "$WINEPREFIX/drive_c/Games/EVE Online"
            dd if="${PW_AUTOINSTALL_EXE}" of="${PW_AUTOINSTALL_EXE}".7z bs=1M skip=31646603 count=196171208 iflag=skip_bytes,count_bytes
            "$pw_7z" x "${PW_AUTOINSTALL_EXE}".7z -o"$WINEPREFIX/drive_c/Games/EVE Online"
            try_remove_file "${PW_AUTOINSTALL_EXE}"
            try_remove_file "${PW_AUTOINSTALL_EXE}".7z
        fi
Mikhail Tergoev's avatar
Mikhail Tergoev committed
134
        portwine_exe="$WINEPREFIX/drive_c/Games/EVE Online/Launcher/evelauncher.exe"
135 136
        pw_stop_progress_bar
        portwine_create_shortcut
Mikhail Tergoev's avatar
Mikhail Tergoev committed
137
    fi
138
    stop_portwine
Mikhail Tergoev's avatar
Mikhail Tergoev committed
139
}
140 141 142 143

PW_UBC () {
	export LAUNCH_PARAMETERS=("/S" "/D=c:\Program Files (x86)\Ubisoft Game Launcher")
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/UbisoftConnectInstaller.exe"
144
    start_portwine
145 146
    if try_download "https://ubistatic3-a.akamaihd.net/orbit/launcher_installer/UbisoftConnectInstaller.exe" "${PW_AUTOINSTALL_EXE}"
    then
147
		pw_start_progress_bar_cs "Installing the Ubisoft Connect. Please wait..."
148
        pw_kill_autostart UbisoftConnect.exe &
149
		pw_run "${PW_AUTOINSTALL_EXE}"
150 151
		portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/Ubisoft Game Launcher/UbisoftConnect.exe"
		try_remove_file "${PW_AUTOINSTALL_EXE}"
152 153 154
		kill_portwine
		pw_stop_progress_bar
		portwine_create_shortcut
155
    fi
156
    stop_portwine
157 158 159 160 161
}

PW_STEAM () {
	export LAUNCH_PARAMETERS=("/S" "/D=c:\Program Files (x86)\Steam")
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/SteamSetup.exe"
162
    start_portwine
163 164
    if try_download "https://cdn.cloudflare.steamstatic.com/client/installer/SteamSetup.exe" "${PW_AUTOINSTALL_EXE}"
    then
165
		pw_start_progress_bar_cs "Installing the Steam. Please wait..."
166
        pw_kill_autostart steam.exe &
167
		pw_run "${PW_AUTOINSTALL_EXE}"
168 169 170 171
        if [ -f "$WINEPREFIX/drive_c/Program Files (x86)/Steam/Steam.exe" ]
        then mv -f "$WINEPREFIX/drive_c/Program Files (x86)/Steam/Steam.exe" "$WINEPREFIX/drive_c/Program Files (x86)/Steam/steam.exe"
        fi
		portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/Steam/steam.exe"
172
		try_remove_file "${PW_AUTOINSTALL_EXE}"
173 174
		kill_portwine
		pw_stop_progress_bar
175
        export PORTWINE_CREATE_SHORTCUT_NAME="STEAM_PP"
176
		portwine_create_shortcut
177
    fi
178
    stop_portwine
179
}
180 181 182 183 184 185

PW_OSU () {
    export WINEPREFIX="${PORT_WINE_PATH}/data/pfx_dotnet"
    export PW_DLL_INSTALL="dotnet40"
    mkdir -p "${WINEPREFIX}/drive_c/Program Files (x86)/OSU/"
    export PW_AUTOINSTALL_EXE="${WINEPREFIX}/drive_c/Program Files (x86)/OSU/osu!.exe"
186
    start_portwine
187 188
    if try_download "https://m1.ppy.sh/r/osu!install.exe" "${PW_AUTOINSTALL_EXE}"
    then
189
        pw_start_progress_bar_block "Installing the OSU!. Please wait..."
190 191 192 193
        if  [ -f "${PORT_WINE_PATH}/data/pfx_dotnet/drive_c/Program Files (x86)/OSU/osu!install.exe" ]; then
            mv -f  "${PORT_WINE_PATH}/data/pfx_dotnet/drive_c/Program Files (x86)/OSU/osu!install.exe" "${PORT_WINE_PATH}/data/pfx_dotnet/drive_c/Program Files (x86)/OSU/osu!.exe"
        fi
        portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/OSU/osu!.exe"
194 195 196 197
        portwine_create_shortcut
		pw_run "${PW_AUTOINSTALL_EXE}"
        pw_stop_progress_bar
        kill_portwine
198
    fi
199
    stop_portwine
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
}

PW_BETHESDA () {
    export LAUNCH_PARAMETERS=("/silent" )
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/BethesdaNetLauncher_Setup.exe"
    start_portwine
    if try_download "https://download.cdp.bethesda.net/BethesdaNetLauncher_Setup.exe" "${PW_AUTOINSTALL_EXE}"
    then
        pw_start_progress_bar_block "Installing the BethesdaNetLauncher. Please wait..."
        pw_kill_autostart BethesdaNetLauncher.exe &
        pw_run "${PW_AUTOINSTALL_EXE}"
        portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/Bethesda.net Launcher/BethesdaNetLauncher.exe"
        try_remove_file "${PW_AUTOINSTALL_EXE}"
        kill_portwine
        pw_stop_progress_bar
        export PORTWINE_CREATE_SHORTCUT_NAME="Bethesda.net"
        portwine_create_shortcut
    fi
    stop_portwine
}

PW_ROCKSTAR () {
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/Rockstar-Games-Launcher.exe"
    start_portwine
    if try_download "https://gamedownloads.rockstargames.com/public/installer/Rockstar-Games-Launcher.exe" "${PW_AUTOINSTALL_EXE}"
    then
        pw_start_progress_bar_block "Rockstar-Games-Launcher. Please wait..."
        "$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files/Rockstar Games/Launcher"
        portwine_exe="$WINEPREFIX/drive_c/Program Files/Rockstar Games/Launcher/Launcher.exe"
        try_remove_file "${PW_AUTOINSTALL_EXE}"
        kill_portwine
        pw_stop_progress_bar
        export PORTWINE_CREATE_SHORTCUT_NAME="Rockstar"
        portwine_create_shortcut
    fi
    stop_portwine
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
}

PW_MYGAMES () {
    export LAUNCH_PARAMETERS=("")
    export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/MyGamesLoader.exe"
    start_portwine
    if try_download "https://static.gc.my.games/MyGamesLoader.exe" "${PW_AUTOINSTALL_EXE}"
    then
        pw_start_progress_bar_block "Installing the My.Games. Please wait..."
        pw_kill_autostart GameCenter.exe &
        pw_run "${PW_AUTOINSTALL_EXE}"
        portwine_exe="$WINEPREFIX/drive_c/users/steamuser/AppData/Local/GameCenter/GameCenter.exe"
        try_remove_file "${PW_AUTOINSTALL_EXE}"
        kill_portwine
        pw_stop_progress_bar
        export PORTWINE_CREATE_SHORTCUT_NAME="MY.GAMES"
        portwine_create_shortcut
    fi
    stop_portwine
255
}