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.