xref: /aosp_15_r20/external/crosvm/tools/setup-wine64 (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1*bb4ee6a4SAndroid Build Coastguard Worker#!/usr/bin/env bash
2*bb4ee6a4SAndroid Build Coastguard Worker# Copyright 2022 The ChromiumOS Authors
3*bb4ee6a4SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
4*bb4ee6a4SAndroid Build Coastguard Worker# found in the LICENSE file.
5*bb4ee6a4SAndroid Build Coastguard Workerset -ex
6*bb4ee6a4SAndroid Build Coastguard Worker
7*bb4ee6a4SAndroid Build Coastguard Workerwine64 wineboot
8*bb4ee6a4SAndroid Build Coastguard Worker
9*bb4ee6a4SAndroid Build Coastguard WorkerWINETRICKS_COMMIT_HASH="b666e05a0bf28fd940e5c258ccdfc0a2799d1948"
10*bb4ee6a4SAndroid Build Coastguard WorkerWINETRICKS_URL="https://raw.githubusercontent.com/Winetricks/winetricks/"$WINETRICKS_COMMIT_HASH"/src/winetricks"
11*bb4ee6a4SAndroid Build Coastguard WorkerWINESTRICKS_SCRIPT_SHA="40fdf1f89f3636187201858e3591e86752172814"
12*bb4ee6a4SAndroid Build Coastguard Worker
13*bb4ee6a4SAndroid Build Coastguard Worker# Setup wine windows prebuilt dependecies.
14*bb4ee6a4SAndroid Build Coastguard Workerexport WINEARCH=win64
15*bb4ee6a4SAndroid Build Coastguard Workerexport WINE=wine64
16*bb4ee6a4SAndroid Build Coastguard Workersudo wget "$WINETRICKS_URL" -O winetricks
17*bb4ee6a4SAndroid Build Coastguard Workerecho "$WINESTRICKS_SCRIPT_SHA winetricks" | sha1sum -c -
18*bb4ee6a4SAndroid Build Coastguard Workersudo chmod +x winetricks
19*bb4ee6a4SAndroid Build Coastguard Worker
20*bb4ee6a4SAndroid Build Coastguard Worker# winetricks command fails while setting up dll registry post installation. During docker build
21*bb4ee6a4SAndroid Build Coastguard Worker# this command fails because it tries to create a regedit window but we do not have DISPLAY set.
22*bb4ee6a4SAndroid Build Coastguard Worker# Failure happens after installing dlls that we need so we ignore the failure.
23*bb4ee6a4SAndroid Build Coastguard Worker# TODO(b:255824543): Find a way to clean install vcrun2015
24*bb4ee6a4SAndroid Build Coastguard Worker./winetricks --force vcrun2015 || true
25*bb4ee6a4SAndroid Build Coastguard Workerln -fs ~/.wine/drive_c/windows/system32/ucrtbase.dll ~/.wine/drive_c/windows/system32/ucrtbased.dll
26*bb4ee6a4SAndroid Build Coastguard Workerln -fs ~/.wine/drive_c/windows/system32/vcruntime140.dll ~/.wine/drive_c/windows/system32/vcruntime140d.dll
27*bb4ee6a4SAndroid Build Coastguard Workersudo rm winetricks
28