#!/bin/sh # Script to install a VB app in a clean Wine directory # This is rediculously hard # (C) Dan Kegel 2005 set -x # Verify no existing wine if test -d $HOME/.wine; then echo Please blow away $HOME/.wine first exit 1 fi # Verify that SETUP.EXE and SETUP.LST are in the current directory if ! test -f SETUP.EXE || ! test -f SETUP.LST; then echo Please cd into the app directory first exit 1 fi # Grab cabextract CABEXTRACT=cabextract if ! which cabextract > /dev/null; then wget http://freshmeat.net/redir/cabextract/993/url_tgz/cabextract-1.1.tar.gz tar -xzvf cabextract-1.1.tar.gz cd cabextract-1.1 ./configure make CABEXTRACT=`pwd`/cabextract cd .. fi # Grab unshield (needed to unpack some cabs created by Installshield) UNSHIELD=unshield if ! which unshield > /dev/null; then wget http://easynews.dl.sourceforge.net/sourceforge/synce/unshield-0.5.tar.gz tar -xzvf unshield-0.5.tar.gz cd unshield-0.5 ./configure make CABEXTRACT=`pwd`/src/unshield cd .. fi # Initialize .wine wcmd /c echo foo > /dev/null # Kill the wineserver so we can modify the registry # (Yeah, I should use regedit instead...) wineserver -k # Fake IE per workaround in http://bugs.winehq.org/show_bug.cgi?id=3453 # else MDAC refuses to install cat >> $HOME/.wine/system.reg <<"_EOF_" [Software\\Microsoft\\Internet Explorer] "Version"="6.0.2900.2180" _EOF_ # Install MDAC wine MDAC_TYP.EXE > mdac.log 2>&1 # Work around bug http://bugs.winehq.org/show_bug.cgi?id=3636 OLDDIR=`pwd` cd $HOME/.wine/drive_c/windows/system32 for cab in ../RegisteredPackages/*/*.CAB; do $CABEXTRACT $cab done cd $OLDDIR # Install VB runtime, else you get # err:module:import_dll Library MSVBVM60.DLL (which is needed by L"C:\\windows\\Setup1.exe") not found test -f vbrun60.exe || wget http://download.microsoft.com/download/vb60pro/install/6/win98me/en-us/vbrun60.exe wine vbrun60.exe # Modify the app's SETUP.LST to work around "Unable to Register MSADO25.TLB" # See http://support.microsoft.com/kb/299645 # Note: changing Setup.Lst doesn't help, you have to change SETUP.LST if grep -q 'msado25.*DLLSelfRegister' SETUP.LST; then sed -i -e 's/msado25.tlb,$(WinSysPath),$(DLLSelfRegister)/msado25.tlb,$(WinSysPath),$(TLBRegister)/' SETUP.LST fi # Install SQL 7.0 client to satisfy dependency of VBSQL.OCX, # which shows up in the wine log as # err:module:import_dll Library ntwdblib.dll (which is needed by L"C:\\windows\\system32\\VBSQL.OCX") not found # and in the app install log as "Unable to Register vbsql.ocx" test -f sql70sp4.exe || wget http://download.microsoft.com/download/sql70/SP/7.00.1063/W98NT42KMeXP/EN-US/sql70sp4.exe test -f X86/setup/_user1.cab || cabextract sql70sp4.exe #cd $HOME/.wine/drive_c/70SP4/X86/setup test -d USERSETUP_LANGINDOSIND || unshield x X86/setup/_user1.cab cp USERSETUP_LANGINDOSIND/*.dll $HOME/.wine/drive_c/windows/system32/ # Install the app WINEDEBUG=+file wine SETUP.EXE > app.log 2>&1