3

In winetricks help I can see the following option:

-q, --unattended Don't ask any questions, just install automatically

which allows me to install automatically many apps and games (winetricks games list) without any user interaction.

How this is done, and how this be achieved for custom binary (such as this one)?

Related: Software to force installer/setup to run silently

kenorb
  • 26,615

2 Answers2

5

The entire winetricks program is just a shell script. For each program that is supported, it consists of some commands to download the installer, execute it and then click through the buttons of each page of the installation wizard. All of this needs to be programmed by hand.

For instance see how Python is installed:

cd "$W_CACHE"/python26
w_try "$WINE" msiexec /i python-2.6.2.msi ALLUSERS=1 $W_UNATTENDED_SLASH_Q

w_ahk_do "
    SetTitleMatchMode, 2
    run pywin32-214.win32-py2.6.exe
    WinWait, Setup, Wizard will install pywin32
    if ( w_opt_unattended > 0 ) {
         ControlClick Button2   ; next
         WinWait, Setup, Python 2.6 is required
         ControlClick Button3   ; next
         WinWait, Setup, Click Next to begin
         ControlClick Button3   ; next
         WinWait, Setup, finished
         ControlClick Button4   ; Finish
    }
    WinWaitClose
    "

I cannot help further as I am not familiar with the functions; but following the examples you should be able to do it.

kenorb
  • 26,615
o9000
  • 316
2

There is also xdotool which allows to fake input from the mouse and keyboard very easily.

For example:

wine setup.exe &
# Wait until Wine initializes
while : ; do
    echo "Waiting for Wine to initialize..."
    sleep 2
    set +e  # Fix for: https://github.com/jordansissel/xdotool/issues/60
    WINDOW_ID=$(xdotool search --name "Setup*")
    set -e
    [[ -z $WINDOW_ID ]] || break
done

# Set focus on installer window and act to install platform
xdotool windowfocus $WINDOW_ID
xdotool key space Tab Tab Tab Return Tab Tab Tab space Alt+n
kenorb
  • 26,615