a pastebin project

Miscellany

  1. #!/bin/sh
  2. # Quick and dirty script to download and install various
  3. # redistributable runtime libraries
  4. #
  5. # Copyright 2007 Google (Dan Kegel, dank@kegel.com)
  6. # Thanks to Detlef Riekenberg for lots of updates
  7. # Thanks to Saulius Krasuckas for corrections and suggestions
  8.  
  9. # Default values for important settings if not already in environment.
  10. # These settings should not need editing here.
  11. WINE=${WINE:-wine}
  12. WINEPREFIXCREATE=${WINEPREFIXCREATE:-wineprefixcreate}
  13. WINEPREFIX=${WINEPREFIX:-$HOME/.wine}
  14.  
  15. # Internal variables; these locations are not too important
  16. WINETRICKS_CACHE=$HOME/winetrickscache
  17. WINETRICKS_TMP=$WINEPREFIX/drive_c/winetrickstmp
  18.  
  19. which "$WINE" > /dev/null
  20. if test "$?" -ne "0"
  21. then
  22.   echo "Cannot find wine ($WINE)"
  23.   exit 1
  24. fi
  25.  
  26. which "$WINEPREFIXCREATE" > /dev/null
  27. if test "$?" -ne "0"
  28. then
  29.   echo "Cannot find wineprefixcreate ($WINEPREFIXCREATE)"
  30.   exit 1
  31. fi
  32.  
  33. #----------------------------------------------------------------
  34.  
  35. usage() {
  36.     set +x
  37.     echo "Usage: $0 [options] package [package] ..."
  38.     echo "This script can help you prepare your system for Windows applications"
  39.     echo "that mistakenly assume all users' systems have all the needed"
  40.     echo "redistributable runtime libraries or fonts."
  41.     echo "Some options require the Linux 'cabextract' program."
  42.     echo ""
  43.     echo "Options:"
  44.     echo " -q         quiet.  You must have already agreed to the EULAs."
  45.     echo " -v         Verbose"
  46.     echo "Packages:"   
  47.     echo " art2kmin   Access 2000 runtime.  License required!"
  48.     echo " cc580      Install native common controls 5.80, override comctl32"
  49.     echo " corefonts  Install MS Times, Arial fonts"
  50.     echo " dcom98     Install native DCOM, override the Wine implementation"
  51.     echo " gdiplus    Install gdiplus.dll from pp viewer (got a better idea?)"
  52.     echo " gecko      Install the HTML rendering Engine (Mozilla)"
  53.     echo " jet40      Install Jet 4.0 Service Pack 8"
  54.     echo " liberation Install Red Hat's Liberation fonts (Sans, Serif, Mono)"
  55.     echo " mdac27     MDAC 2.7: Microsoft ODBC drivers, etc."
  56.     echo " mdac28     MDAC 2.8."
  57.     echo " mfc40"
  58.     echo " mono11     mono 1.1.13-gtksharp-2.8.2 (deprecated, use 1.2)"
  59.     echo " mono12     mono mono-1.2.5.2-gtksharp-2.10.2"
  60.     echo " msi2       Microsoft Installer 2.0"
  61.     echo " msxml3     (Note: install a bit squidgy; see http://bugs.winehq.org/show_bug.cgi?id=7849)"
  62.     echo " msxml4     (Note: installing this requires fake c: to be named harddrive1!)"
  63.     echo " pdh        Install pdh.dll (Performance Data Helper)"
  64.     echo " tahoma     Install MS Tahoma font (not part of corefonts)"
  65.     echo " vbvm50     Visual Basic 5 runtime"
  66.     echo " vbrun60    Visual Basic 6 runtime"
  67.     echo " vcrun6     vc6redist from VS6sp4, including mfc42"
  68.     echo " vcrun2005  Visual C++ 2005 redistributable libraries"
  69.     echo " wsh51      Windows Scripting Host 5.1"
  70.     echo " wsh56      Windows Scripting Host 5.6 (install vcrun6 first)"
  71.     echo " wsh56js    Windows scripting 5.6, jscript only, no cscript"
  72.     echo " wsh56vb    Windows scripting 5.6, vbscript only, no cscript"
  73.     echo "Pseudopackages:"
  74.     echo " fakeie6      Set registry to claim IE6sp1 is installed"
  75.     echo " native_mdac  Override odbc32 and odbccp32"
  76.     echo " winver=win98 Set windows version to win98"
  77.     echo " winver=winxp Set windows version to winxp"
  78.     echo " winver=      Set windows version to default (win2k)"
  79.     echo " volnum      Rename drive_c to harddiskvolume0 (needed by some installers)"
  80.     exit 1
  81. }
  82.  
  83. #----------------------------------------------------------------
  84.  
  85. if test "$1" = ""
  86. then
  87.     usage
  88. fi
  89. test -d $WINEPREFIX || $WINEPREFIXCREATE
  90. mkdir -p $WINETRICKS_CACHE
  91. mkdir -p $WINETRICKS_TMP
  92. olddir=`pwd`
  93. # Clean up after failed runs, if needed
  94. rm -rf $WINETRICKS_TMP/*
  95.  
  96. # The folder-name is localized!
  97. programfilesdir_win=`$WINE cmd.exe /c echo "%ProgramFiles%"`
  98. programfilesdir_unix=`$WINE winepath -u "$programfilesdir_win"`
  99.  
  100. #-----  Helpers  ------------------------------------------------
  101.  
  102. # Execute with error checking
  103. try() {
  104.     # "VAR=foo try cmd" fails to put VAR in the environment
  105.     # with some versions of bash if try is a shell function?!
  106.     # Adding this explicit export works around it.
  107.     export WINEDLLOVERRIDES
  108.     echo Executing "$@"
  109.     "$@"
  110.     status=$?
  111.     if test $status -ne 0
  112.     then
  113.         echo "Note: command '$@' returned status $status.  Aborting."
  114.         exit $status
  115.     fi
  116. }
  117.  
  118. # Download a file
  119. download() {
  120.     file=`basename "$1"`
  121.     test -f $WINETRICKS_CACHE/$file || (cd $WINETRICKS_CACHE; wget -c "$1")
  122.     if [ "$2"x != ""x ]
  123.     then
  124.         echo "$2  $WINETRICKS_CACHE/$file" > $WINETRICKS_CACHE/$file.sha1sum
  125.         try sha1sum --status -c $WINETRICKS_CACHE/$file.sha1sum
  126.     fi
  127. }
  128.  
  129. set_winver() {
  130.     echo "Setting Windows version to $1"
  131.     cat > $WINETRICKS_TMP/set-winver.reg <<_EOF_
  132. REGEDIT4
  133.  
  134. [HKEY_CURRENT_USER\Software\Wine]
  135. "Version"="$1"
  136.  
  137. _EOF_
  138.     try $WINE regedit $WINETRICKS_TMP/set-winver.reg
  139. }
  140.  
  141. unset_winver() {
  142.     echo "Clearing Windows version back to default"
  143.     cat > $WINETRICKS_TMP/unset-winver.reg <<_EOF_
  144. REGEDIT4
  145.  
  146. [HKEY_CURRENT_USER\Software\Wine]
  147. "Version"=-
  148.  
  149. _EOF_
  150.     try $WINE regedit $WINETRICKS_TMP/unset-winver.reg
  151. }
  152.  
  153. override_dlls() {
  154.     echo Overriding following DLLs: $@
  155.     cat > $WINETRICKS_TMP/override-dll.reg <<_EOF_
  156. REGEDIT4
  157.  
  158. [HKEY_CURRENT_USER\Software\Wine\DllOverrides]
  159. _EOF_
  160.     while test "$1" != ""
  161.     do
  162.         echo "\"$1\"=\"native,builtin\"" >> $WINETRICKS_TMP/override-dll.reg
  163.         shift
  164.     done
  165.  
  166.     try $WINE regedit $WINETRICKS_TMP/override-dll.reg
  167.     rm $WINETRICKS_TMP/override-dll.reg
  168. }
  169.  
  170. #----- One function per package, in alphabetical order ----------
  171.  
  172. load_art2kmin() {
  173.     download http://download.microsoft.com/download/office2000dev/art2kmin/1/win98/en-us/art2kmin.exe 73be2622254d1f857a204a03f068787542b985e9
  174.     try $WINE $WINETRICKS_CACHE/art2kmin.exe
  175.     cd "$WINEPREFIX/drive_c/ART2KMin Setup"
  176.     try $WINE Setup.exe INSTALLPFILES=1 /wait $WINETRICKS_QUIET
  177.     cd "$olddir"
  178. }
  179.  
  180. #----------------------------------------------------------------
  181.  
  182. load_cc580() {
  183.     # http://www.microsoft.com/downloads/details.aspx?familyid=6f94d31a-d1e0-4658-a566-93af0d8d4a1e
  184.     download http://download.microsoft.com/download/platformsdk/redist/5.80.2614.3600/w9xnt4/en-us/cc32inst.exe 94c3c494258cc54bd65d2f0153815737644bffde
  185.  
  186.     try $WINE $WINETRICKS_CACHE/cc32inst.exe "/T:`$WINE winepath -w $WINETRICKS_TMP`" /c $WINETRICKS_QUIET
  187.     try $WINE $WINETRICKS_TMP/comctl32.exe
  188.     try $WINE $WINEPREFIX/drive_c/windows/temp/x86/50ComUpd.Exe "/T:`$WINE winepath -w $WINETRICKS_TMP`" /c $WINETRICKS_QUIET
  189.     cp $WINETRICKS_TMP/comcnt.dll $WINEPREFIX/drive_c/windows/system32/comctl32.dll
  190.  
  191.     override_dlls comctl32
  192. }
  193.  
  194. #----------------------------------------------------------------
  195.  
  196. load_corefonts() {
  197.     # See http://corefonts.sf.net
  198.     # TODO: let user pick mirror, check md5;
  199.     # see http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec for how
  200.     # TODO: add more fonts
  201.     download http://internap.dl.sourceforge.net/sourceforge/corefonts/arial32.exe 6d75f8436f39ab2da5c31ce651b7443b4ad2916e
  202.     download http://internap.dl.sourceforge.net/sourceforge/corefonts/times32.exe 20b79e65cdef4e2d7195f84da202499e3aa83060
  203.     try $WINE $WINETRICKS_CACHE/arial32.exe $WINETRICKS_QUIET
  204.     try $WINE $WINETRICKS_CACHE/times32.exe $WINETRICKS_QUIET
  205. }
  206.  
  207. #----------------------------------------------------------------
  208.  
  209. load_dcom98() {
  210.     # Install native dcom per http://wiki.winehq.org/NativeDcom
  211.     # to avoid http://bugs.winehq.org/show_bug.cgi?id=4228
  212.     download http://download.microsoft.com/download/d/1/3/d13cd456-f0cf-4fb2-a17f-20afc79f8a51/DCOM98.EXE aff002bd03f17340b2bef2e6b9ea8e3798e9ccc1
  213.  
  214.     # Pick win98 so we can install native dcom
  215.     set_winver win98
  216.  
  217.     # Avoid "err:setupapi:SetupDefaultQueueCallbackA copy error 5 ..."
  218.     # Those messages are suspect, probably shouldn't be err's.
  219.     rm -f $WINEPREFIX/drive_c/windows/system32/ole32.dll
  220.     rm -f $WINEPREFIX/drive_c/windows/system32/olepro32.dll
  221.     rm -f $WINEPREFIX/drive_c/windows/system32/oleaut32.dll
  222.     rm -f $WINEPREFIX/drive_c/windows/system32/rpcrt4.dll
  223.  
  224.     # Normally only need to override ole32, but overriding advpack
  225.     # as well gets us the correct exit status.
  226.     WINEDLLOVERRIDES="ole32,advpack=n" try $WINE $WINETRICKS_CACHE/DCOM98.EXE $WINETRICKS_QUIET
  227.  
  228.     # Set native DCOM by default for all apps (ok, this might be overkill)
  229.     override_dlls ole32 oleaut32 rpcrt4
  230.  
  231.     # and undo version win98
  232.     unset_winver
  233. }
  234.  
  235. #----------------------------------------------------------------
  236.  
  237. # Fake IE per workaround in http://bugs.winehq.org/show_bug.cgi?id=3453
  238. # Just the first registry key works for most apps.
  239. # The App Paths part is required by a few apps, like Quickbooks Pro;
  240. # see http://windowsxp.mvps.org/ie/qbooks.htm
  241. set_fakeie6() {
  242.  
  243.     cat > $WINETRICKS_TMP/fakeie6.reg <<"_EOF_"
  244. REGEDIT4
  245.  
  246. [HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer]
  247. "Version"="6.0.2900.2180"
  248.  
  249. [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE]
  250. _EOF_
  251.  
  252.     echo -n '@="' >>$WINETRICKS_TMP/fakeie6.reg
  253.     echo -n "${programfilesdir_win}" | sed "s/\\\\/\\\\\\\\/" >>$WINETRICKS_TMP/fakeie6.reg
  254.     echo '\\\\Internet Explorer\\\\iexplore.exe"' >>$WINETRICKS_TMP/fakeie6.reg
  255.  
  256.     echo -n '"PATH"="' >>$WINETRICKS_TMP/fakeie6.reg
  257.     echo -n "${programfilesdir_win}" | sed "s/\\\\/\\\\\\\\/" >>$WINETRICKS_TMP/fakeie6.reg
  258.     echo '\\\\Internet Explorer"' >>$WINETRICKS_TMP/fakeie6.reg
  259.  
  260.     try $WINE regedit $WINETRICKS_TMP/fakeie6.reg
  261.  
  262.     # On old wineprefixes iexplore.exe is not created. Create a fake dll using
  263.     # shdocvw.dll that should have similar VERSIONINFO.
  264.     if [ ! -f "$programfilesdir_unix/Internet Explorer/iexplore.exe" ]; then
  265.         echo "You have an old wineprefix without iexplore.exe. Will create a fake now"
  266.         if [ ! -d "$programfilesdir_unix/Internet Explorer/iexplore.exe" ]; then
  267.             try mkdir "$programfilesdir_unix/Internet Explorer";
  268.         fi
  269.         try cp -f "$WINEPREFIX/drive_c/windows/system32/shdocvw.dll" "$programfilesdir_unix/Internet Explorer/iexplore.exe"
  270.     fi
  271. }
  272.  
  273. #----------------------------------------------------------------
  274.  
  275. load_gecko() {
  276.     # Load the HTML rendering Engine (Gecko)
  277.     # FIXME: shouldn't this code be in some script installed
  278.     # as part of Wine instead of in winetricks?
  279.     # (e.g. we hardcode gecko's url here, but it's normally
  280.     # only hardcoded in wine.inf, and fetched from the registry thereafter,
  281.     # so we're adding a maintenance burden here.)
  282.     GECKO_VERSION=0.1.0
  283.  
  284.     if ! test -f $WINETRICKS_CACHE/wine_gecko-$GECKO_VERSION.cab
  285.     then
  286.        download "http://source.winehq.org/winegecko.php?v=$GECKO_VERSION"
  287.     fi
  288.  
  289.     cat > $WINETRICKS_TMP/geckopath.reg <<_EOF_
  290. REGEDIT4
  291.  
  292. [HKEY_CURRENT_USER\\Software\\Wine\\MSHTML\\$GECKO_VERSION]
  293. _EOF_
  294.  
  295.     #The registry-entry does not support an environment-variable
  296.     # note: echo's behavior with backslashes and options is nonportable,
  297.     # see http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html
  298.     echo -n '"GeckoPath"="' >>$WINETRICKS_TMP/geckopath.reg
  299.     echo -n 'c:\\windows\\gecko\\'$GECKO_VERSION | sed "s/\\\\/\\\\\\\\/g" >>$WINETRICKS_TMP/geckopath.reg
  300.     echo '\\\\wine_gecko"' >>$WINETRICKS_TMP/geckopath.reg
  301.  
  302.     # extract the files
  303.     mkdir -p $WINEPREFIX/drive_c/windows/gecko/$GECKO_VERSION
  304.     cd $WINEPREFIX/drive_c/windows/gecko/$GECKO_VERSION
  305.     try cabextract $WINETRICKS_UNIXQUIET $WINETRICKS_CACHE/wine_gecko-$GECKO_VERSION.cab
  306.     cd "$olddir"
  307.  
  308.     # set install-path
  309.     try $WINE regedit $WINETRICKS_TMP/geckopath.reg
  310. }
  311.  
  312. #----------------------------------------------------------------
  313.  
  314. load_gdiplus() {
  315.     # gdiplus is documented here as a redistributable:
  316.     # http://msdn.microsoft.com/library/en-us/gdicpp/GDIPlus/GDIPlus.asp
  317.     # however, there's no standalone installer.  So install a random
  318.     # app that happens to bundle it.
  319.     download http://download.microsoft.com/download/a/1/a/a1adc39b-9827-4c7a-890b-91396aed2b86/ppviewer.exe 4d13ca85d1d366167b6247ac7340b7736b1bff87
  320.     try $WINE $WINETRICKS_CACHE/ppviewer.exe $WINETRICKS_QUIET
  321.     # And then make it globally available.
  322.     try cp "$programfilesdir_unix/Microsoft Office/PowerPoint Viewer/GDIPLUS.DLL" $WINEPREFIX/drive_c/windows/system32/
  323. }
  324.  
  325. #----------------------------------------------------------------
  326.  
  327. load_jet40() {
  328.     # http://support.microsoft.com/kb/239114
  329.     # See also http://bugs.winehq.org/show_bug.cgi?id=6085
  330.     download http://download.microsoft.com/download/4/3/9/4393c9ac-e69e-458d-9f6d-2fe191c51469/jet40sp8_9xnt.exe 8cd25342030857969ede2d8fcc34f3f7bcc2d6d4
  331.     try $WINE $WINETRICKS_CACHE/jet40sp8_9xnt.exe $WINETRICKS_QUIET
  332. }
  333.  
  334. #----------------------------------------------------------------
  335.  
  336. load_liberation() {
  337.     # http://www.redhat.com/promo/fonts/
  338.     download http://www.redhat.com/f/fonts/liberation-fonts-ttf-3.tar.gz 503fd3c60174b53f59ca41927b72e4a44bab586b
  339.     tar --wildcards -C $WINEPREFIX/drive_c/windows/fonts -xvzf $WINETRICKS_CACHE/liberation-fonts-ttf-3.tar.gz '*.ttf'
  340. }
  341.  
  342. #----------------------------------------------------------------
  343.  
  344. set_native_mdac() {
  345.     # Set those overrides globally so user programs get MDAC's odbc
  346.     # instead of wine's unixodbc
  347.     override_dlls odbc32 odbccp32
  348. }
  349.  
  350. load_mdac27() {
  351.     # FIXME to support other versions of mdac, will need to change
  352.     # 'download' to save in a subdirectory named after the package,
  353.     # since every version of mdac uses the same installer filename
  354.     download http://download.microsoft.com/download/3/b/f/3bf74b01-16ba-472d-9a8c-42b2b4fa0d76/mdac_typ.exe f68594d1f578c3b47bf0639c46c11c5da161feee
  355.     set_native_mdac
  356.     try $WINE $WINETRICKS_CACHE/mdac_typ.exe
  357. }
  358.  
  359. #----------------------------------------------------------------
  360.  
  361. load_mdac28() {
  362.     # FIXME to support other versions of mdac, will need to change
  363.     # 'download' to save in a subdirectory named after the package,
  364.     # since every version of mdac uses the same installer filename
  365.     # Well, shoot.  Can we get away with case sensitivity here?
  366.     download http://download.microsoft.com/download/c/d/f/cdfd58f1-3973-4c51-8851-49ae3777586f/MDAC_TYP.EXE 91bd59f0b02b67f3845105b15a0f3502b9a2216a
  367.     set_native_mdac
  368.     set_winver win98
  369.     try $WINE $WINETRICKS_CACHE/MDAC_TYP.EXE
  370.     unset_winver
  371. }
  372.  
  373. #----------------------------------------------------------------
  374.  
  375. load_mfc40() {
  376.     # See also http://www.microsoft.com/downloads/details.aspx?FamilyID=cf3005d4-7009-4d2d-89d1-b32c482c8a2d
  377.     echo "Note: Microsoft has since pulled this download.  Sorry!"
  378.    
  379.     download http://download.microsoft.com/download/sql65/Patch/6.5/WIN98/EN-US/MFC40i.exe af289f72aceda7ac2b43bf94b574e74a48cb5663
  380.     cd $WINETRICKS_TMP/
  381.     rm -rf $WINETRICKS_TMP/*
  382.     try cabextract $WINETRICKS_CACHE/MFC40i.exe
  383.     try cp mfc40.dll $WINEPREFIX/drive_c/windows/system32/
  384.     cd "$olddir"
  385. }
  386.  
  387. #----------------------------------------------------------------
  388.  
  389. load_mono11() {
  390.     echo "Mono-1.1 is deprecated.  The Mono team prefers you use Mono-1.2 instead."
  391.     # Load Mono, have it handle all .net requests
  392.     download ftp://www.go-mono.com/archive/1.1.13.8.2/windows-installer/0/mono-1.1.13.8.2-gtksharp-2.8.2-win32-0.exe e8725d03f51fcca2849d1a8f1d87ceb6f77c1d82
  393.     # Anyone know how to get it to do a silent install?
  394.     try $WINE $WINETRICKS_CACHE/mono-1.1.13.8.2-gtksharp-2.8.2-win32-0.exe
  395.  
  396.     # FIXME: what are the right registry entries here?
  397.     cat > $WINETRICKS_TMP/mono.reg <<_EOF_
  398. REGEDIT4
  399.  
  400. [HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v1.1.4322]
  401. "Install"=dword:00000001
  402. "SP"=dword:00000001
  403.  
  404. [HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\policy\v1.1]
  405. "4322"="3706-4322"
  406. _EOF_
  407.     try $WINE regedit $WINETRICKS_TMP/mono.reg
  408.     rm -f $WINETRICKS_TMP/mono.reg
  409. }
  410.  
  411. #----------------------------------------------------------------
  412.  
  413. load_mono12() {
  414.     # Load Mono, have it handle all .net requests
  415.     download ftp://www.go-mono.com/archive/1.2.5.2/windows-installer/0/mono-1.2.5.2-gtksharp-2.10.2-win32-0.exe 58fc6b9e7bedc9110c2e8f0864c39c8335f34533
  416.     # Anyone know how to get it to do a silent install?
  417.     try $WINE $WINETRICKS_CACHE/mono-1.2.5.2-gtksharp-2.10.2-win32-0.exe
  418.  
  419.     cat > $WINETRICKS_TMP/mono_1.2.reg <<_EOF_
  420. REGEDIT4
  421.  
  422. [HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v2.0.50727]
  423. "Install"=dword:00000001
  424. "SP"=dword:00000001
  425.  
  426. [HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\policy\v2.0]
  427. "4322"="3706-4322"
  428. _EOF_
  429.     try $WINE regedit $WINETRICKS_TMP/mono_1.2.reg
  430.     rm -f $WINETRICKS_TMP/mono_1.2.reg
  431. }
  432.  
  433. #----------------------------------------------------------------
  434.  
  435. load_msi2() {
  436.     # Install native msi per http://wiki.winehq.org/NativeMsi
  437.     download http://download.microsoft.com/download/WindowsInstaller/Install/2.0/W9XMe/EN-US/InstMsiA.exe e739c40d747e7c27aacdb07b50925b1635ee7366
  438.  
  439.     # Pick win98 so we can install native msi
  440.     set_winver win98
  441.  
  442.     # Avoid "err:setupapi:SetupDefaultQueueCallbackA copy error 5 ..."
  443.     rm -f $WINEPREFIX/drive_c/windows/system32/msi.dll
  444.     rm -f $WINEPREFIX/drive_c/windows/system32/msiexec.exe
  445.  
  446.     WINEDLLOVERRIDES="msi,msiexec.exe=n" try $WINE $WINETRICKS_CACHE/InstMSIA.exe $WINETRICKS_QUIET
  447.  
  448.     override_dlls msi msiexec.exe
  449.  
  450.     # and undo version win98
  451.     unset_winver
  452. }
  453.  
  454. #----------------------------------------------------------------
  455.  
  456. load_msxml3() {
  457.     # Service Pack 5
  458.     #download http://download.microsoft.com/download/a/5/e/a5e03798-2454-4d4b-89a3-4a47579891d8/msxml3.msi
  459.     # Service Pack 7
  460.     download http://download.microsoft.com/download/8/8/8/888f34b7-4f54-4f06-8dac-fa29b19f33dd/msxml3.msi d4c2178dfb807e1a0267fce0fd06b8d51106d913
  461.     # http://bugs.winehq.org/show_bug.cgi?id=7849 fixed since 0.9.37
  462.     override_dlls msxml3
  463.     try $WINE msiexec /i $WINETRICKS_CACHE/msxml3.msi $WINETRICKS_QUIET
  464. }
  465.  
  466. #----------------------------------------------------------------
  467.  
  468. load_msxml4() {
  469.     # http://www.microsoft.com/downloads/details.aspx?familyid=24B7D141-6CDF-4FC4-A91B-6F18FE6921D4
  470.     if ! test -f $WINETRICKS_CACHE/msxml4.msi
  471.     then
  472.        download http://download.microsoft.com/download/e/2/e/e2e92e52-210b-4774-8cd9-3a7a0130141d/msxml4-KB927978-enu.exe d364f9fe80c3965e79f6f64609fc253dfeb69c25
  473.        rm -rf $WINETRICKS_TMP/*
  474.  
  475.        try $WINE $WINETRICKS_CACHE/msxml4-KB927978-enu.exe "/x:`$WINE winepath -w $WINETRICKS_TMP`" $WINETRICKS_QUIET
  476.        if ! test -f $WINETRICKS_TMP/msxml.msi
  477.        then
  478.           echo msxml.msi not found
  479.           exit 1
  480.        fi
  481.        mv $WINETRICKS_TMP/msxml.msi $WINETRICKS_CACHE/msxml4.msi
  482.     fi
  483.  
  484.     try $WINE msiexec /i $WINETRICKS_CACHE/msxml4.msi $WINETRICKS_QUIET
  485. }
  486.  
  487. #----------------------------------------------------------------
  488.  
  489. load_pdh() {
  490.     # http://support.microsoft.com/kb/284996
  491.     if ! test -f $WINETRICKS_CACHE/pdhinst.exe
  492.     then
  493.        download http://download.microsoft.com/download/platformsdk/Redist/5.0.2195.2668/NT4/EN-US/pdhinst.exe f42448660def8cd7f42b34aa7bc7264745f4425e
  494.     fi
  495.     try $WINE $WINETRICKS_CACHE/pdhinst.exe
  496.     try cp -f $WINEPREFIX/drive_c/windows/temp/x86/Pdh.Dll $WINEPREFIX/drive_c/windows/system32/pdh.dll
  497. }
  498.  
  499. #----------------------------------------------------------------
  500.  
  501. volnum() {
  502.     # Recent Microsoft installers are often based on "windows package manager", see
  503.     # http://support.microsoft.com/kb/262841 and
  504.     # http://www.microsoft.com/technet/prodtechnol/windowsserver2003/deployment/winupdte.mspx
  505.     # These installers check the drive name, and if it doesn't start with 'harddisk',
  506.     # they complain "Unable to find a volume for file extraction", see
  507.     # http://bugs.winehq.org/show_bug.cgi?id=5351
  508.     # You may be able to work around this by using the installer's /x or /extract switch,
  509.     # but renaming drive_c to "harddiskvolume0" lets you just run the installer as normal.
  510.  
  511.     if ! test -d $WINEPREFIX/harddiskvolume0/
  512.     then
  513.         ln -s drive_c $WINEPREFIX/harddiskvolume0
  514.         rm $WINEPREFIX/dosdevices/c:
  515.         ln -s ../harddiskvolume0 $WINEPREFIX/dosdevices/c:
  516.         echo "Renamed drive_c to harddiskvolume0"
  517.     else
  518.         echo "drive_c already named harddiskvolume0"
  519.     fi
  520. }
  521.  
  522. #----------------------------------------------------------------
  523.  
  524. load_tahoma() {
  525.     # The tahoma font is needed by e.g. Steam
  526.     download http://internap.dl.sourceforge.net/sourceforge/corefonts/wd97vwr32.exe 8edf758f92513094a94e50b7826cd6f2b7696b8c
  527.     try cabextract --directory=$WINETRICKS_TMP $WINETRICKS_CACHE/wd97vwr32.exe
  528.     try cabextract --directory=$WINETRICKS_TMP $WINETRICKS_TMP/Viewer1.cab
  529.     try cp -f $WINETRICKS_TMP/tahoma.ttf $WINEPREFIX/drive_c/windows/fonts/tahoma.ttf
  530.     rm -rf $WINETRICKS_TMP/*
  531. }
  532.  
  533. #----------------------------------------------------------------
  534.  
  535. load_vbvm50() {
  536.     download http://download.microsoft.com/download/vb50pro/utility/1/win98/en-us/msvbvm50.exe 28bfaf09b8ac32cf5ffa81252f3e2fadcb3a8f27
  537.     try $WINE $WINETRICKS_CACHE/msvbvm50.exe $WINETRICKS_QUIET
  538. }
  539.  
  540. #----------------------------------------------------------------
  541.  
  542. load_vbrun60() {
  543.     download http://download.microsoft.com/download/vb60pro/install/6/win98me/en-us/vbrun60.exe 2dc00e5fc701492bcba7ac58f057ee43751e18e5
  544.     # Exits with status 43 for some reason?
  545.     $WINE $WINETRICKS_CACHE/vbrun60.exe $WINETRICKS_QUIET || true
  546. }
  547.  
  548. #----------------------------------------------------------------
  549.  
  550. load_vcrun6() {
  551.     # Load the Visual C++ 6 runtime libraries, including the elusive mfc42u.dll
  552.  
  553.     if ! test -f $WINETRICKS_CACHE/vcredist.exe
  554.     then
  555.        download http://download.microsoft.com/download/vc60pro/update/1/w9xnt4/en-us/vc6redistsetup_enu.exe 382c8f5a7f41189af8d4165cf441f274b7e2a457
  556.        rm -rf $WINETRICKS_TMP/*
  557.        
  558.        try $WINE $WINETRICKS_CACHE/vc6redistsetup_enu.exe "/T:`$WINE winepath -w $WINETRICKS_TMP`" /c $WINETRICKS_QUIET
  559.        if ! test -f $WINETRICKS_TMP/vcredist.exe
  560.        then
  561.           echo vcredist.exe not found
  562.           exit 1
  563.        fi
  564.        mv $WINETRICKS_TMP/vcredist.exe $WINETRICKS_CACHE
  565.     fi
  566.     # Delete some fake dlls to avoid vcredist installer warnings
  567.     rm -f $WINEPREFIX/drive_c/windows/system32/msvcrt.dll
  568.     rm -f $WINEPREFIX/drive_c/windows/system32/oleaut32.dll
  569.     rm -f $WINEPREFIX/drive_c/windows/system32/olepro32.dll
  570.     # vcredist still exits with status 43.  Anyone know why?
  571.     $WINE $WINETRICKS_CACHE/vcredist.exe || true
  572.  
  573.     # And then some apps need mfc42u.dll, dunno what right way
  574.     # is to get it, vcredist doesn't install it by default?
  575.     cd $WINETRICKS_TMP/
  576.     rm -rf $WINETRICKS_TMP/*
  577.     try cabextract $WINETRICKS_CACHE/vcredist.exe
  578.     mv mfc42u.dll $WINEPREFIX/drive_c/windows/system32/
  579.     cd "$olddir"
  580. }
  581.  
  582. #----------------------------------------------------------------
  583.  
  584. load_vcrun2005() {
  585.     # Load the Visual C++ 2005 runtime libraries
  586.     # See http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE
  587.     download http://download.microsoft.com/download/d/3/4/d342efa6-3266-4157-a2ec-5174867be706/vcredist_x86.exe 47fba37de95fa0e2328cf2e5c8ebb954c4b7b93c
  588.     try $WINE $WINETRICKS_CACHE/vcredist_x86.exe $WINETRICKS_QUIET
  589. }
  590.  
  591. #----------------------------------------------------------------
  592.  
  593. load_wsh51() {
  594.     # See also http://www.microsoft.com/downloads/details.aspx?FamilyID=bfdb7709-51e4-4aa6-adb0-05444e68dd80&DisplayLang=en
  595.     echo "Note: Microsoft has since pulled this download.  Sorry!"
  596.     download http://download.microsoft.com/download/8/7/5/8751c696-282d-49da-b118-2735315dbb5e/ste51en.exe ecc0fb713684294fe6c759f4633c5befbeba1ade
  597.  
  598.     try $WINE $WINETRICKS_CACHE/ste51en.exe $WINETRICKS_QUIET
  599.  
  600.     # Not sure why this gets installed to the wrong directory
  601.     mv $WINEPREFIX/drive_c/windows/system32/unknown/cscript.exe $WINEPREFIX/drive_c/windows/system32
  602. }
  603.  
  604. #----------------------------------------------------------------
  605.  
  606. load_wsh56() {
  607.     # See also http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=C717D943-7E4B-4622-86EB-95A22B832CAA
  608.     echo "Note: Microsoft has since pulled this download.  Sorry!"
  609.     download http://download.microsoft.com/download/2/8/a/28a5a346-1be1-4049-b554-3bc5f3174353/WindowsXP-Windows2000-Script56-KB917344-x86-enu.exe f4692766caa3ee9b38d4166845486c6199a33457
  610.  
  611.     try $WINE $WINETRICKS_CACHE/WindowsXP-Windows2000-Script56-KB917344-x86-enu.exe $WINETRICKS_QUIET
  612. }
  613.  
  614. #----------------------------------------------------------------
  615.  
  616. load_wsh56js() {
  617.     # This installs jscript 5.6 (but not vbscript)
  618.     # See also http://www.microsoft.com/downloads/details.aspx?FamilyID=16dd21a1-c4ee-4eca-8b80-7bd1dfefb4f8&DisplayLang=en
  619.     download http://download.microsoft.com/download/b/c/3/bc3a0c36-fada-497d-a3de-8b0139766f3b/Windows2000-KB917344-56-x86-enu.exe add5f74c5bd4da6cfae47f8306de213ec6ed52c8
  620.  
  621.     try $WINE $WINETRICKS_CACHE/Windows2000-KB917344-56-x86-enu.exe $WINETRICKS_QUIET
  622. }
  623.  
  624. #----------------------------------------------------------------
  625.  
  626. load_wsh56vb() {
  627.     # This installs vbscript 5.6 (but not jscript)
  628.     # See also http://www.microsoft.com/downloads/details.aspx?familyid=4F728263-83A3-464B-BCC0-54E63714BC75
  629.     download http://download.microsoft.com/download/IE60/Patch/Q318089/W9XNT4Me/EN-US/vbs56men.exe 48f14a93db33caff271da0c93f334971f9d7cb22
  630.  
  631.     try $WINE $WINETRICKS_CACHE/vbs56men.exe $WINETRICKS_QUIET
  632. }
  633.  
  634. #----------------------------------------------------------------
  635.  
  636.  
  637. while test "$1" != ""
  638. do
  639.     case $1 in
  640.     -q) WINETRICKS_QUIET="/q"
  641.         WINETRICKS_UNIXQUIET="-q"
  642.         WINEDEBUG=${WINEDEBUG:-"fixme-all"}
  643.         export WINEDEBUG
  644.         ;;
  645.     -v) set -x;;
  646.     art2kmin) load_art2kmin;;
  647.     cc580) load_cc580;;
  648.     corefonts) load_corefonts;;
  649.     dcom98) load_dcom98;;
  650.     gdiplus) load_gdiplus;;
  651.     gecko) load_gecko;;
  652.     jet40) load_jet40;;
  653.     liberation) load_liberation;;
  654.     mdac27) load_mdac27;;
  655.     mdac28) load_mdac28;;
  656.     mfc40) load_mfc40;;
  657.     mono11) load_mono11;;
  658.     mono12) load_mono12;;
  659.     msi2) load_msi2;;
  660.     msxml3) load_msxml3;;
  661.     msxml4) load_msxml4;;
  662.     pdh) load_pdh;;
  663.     tahoma) load_tahoma;;
  664.     vbvm50) load_vbvm50;;
  665.     vbrun60) load_vbrun60;;
  666.     vcrun6) load_vcrun6;;
  667.     vcrun2005) load_vcrun2005;;
  668.     wsh51) load_wsh51;;
  669.     wsh56) load_wsh56;;
  670.     wsh56js) load_wsh56js;;
  671.     wsh56vb) load_wsh56vb;;
  672.  
  673.     fakeie6) set_fakeie6;;
  674.     winver=win98) set_winver win98;;
  675.     winver=winxp) set_winver winxp;;
  676.     winver=) unset_winver;;
  677.     native_mdac) set_native_mdac;;
  678.     volnum) volnum;;
  679.     *) echo Unknown arg $1; usage;;
  680.     esac
  681.     # Provide a bit of feedback
  682.     test "$WINETRICKS_QUIET" = "" && case $1 in
  683.     -q) echo Setting quiet mode;;
  684.     -v) echo Setting verbose mode;;
  685.     *) echo "Install of $1 done" ;;
  686.     esac
  687.     shift
  688. done
  689.  
  690. # cleanup
  691. rm -rf $WINETRICKS_TMP/*
  692.  
  693. test "$WINETRICKS_QUIET" = "" && echo winetricks done. || true

advertising

Create a Paste

Please enter your new post below (or upload a file instead):





Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.

worth-right