Guest User

Untitled

a guest
Mar 11th, 2010
288
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Date:                     2010-03-11
  3. # Last revision:                2010-03-11
  4. # Wine version used:                1.1.27
  5. # Distribution used to test:            Ubuntu 9.10 32-bit
  6. # Author:                   Simon Johansson - simon [AT] forintens [DOT] se
  7. # Depend:                      
  8.  
  9. # Licence:                  GNU General Public License version 3
  10. # Copyright 2010 Simon Johansson
  11.  
  12.  
  13. ####    PlayOnLinux ####
  14.  
  15. [ "$PLAYONLINUX" = "" ] && exit 0
  16. source "$PLAYONLINUX/lib/sources"
  17.  
  18.  
  19. ####    VARIABLES   ####
  20.  
  21. TITLE="Lingoes"
  22. ORGANISATION="Lingoes Project"
  23. SITE="http://www.lingoes.net/"
  24.  
  25. PREFIX="$REPERTOIRE/wineprefix/LINGOES"
  26. WINEVERSION="1.1.27"
  27. RESOURCES="$REPERTOIRE/ressources/"
  28. PROGRAMFILES="Program Files"
  29. POL_LoadVar_PROGRAMFILES
  30.  
  31. URL_TTS="http://dict.hjenglish.com/publish/Microsoft_TTS_51_eng.msi"
  32. URL_3="http://www.slymandata.com/lingoes_usa_mirror/lingoes_2.6.3.exe"
  33. FILE_TTS="Microsoft_TTS_51_eng.msi"
  34. FILE_3="lingoes_2.6.3.exe"
  35. MD5_TTS="c157bca19f2b46b7ab3ed7c8d29dc912"
  36. MD5_3="754443ad2d924af1b329be61c060954c"
  37.  
  38.  
  39. ####    LANG-VARS   ####
  40.  
  41. LANG_DL_TTS="Downloading Text-To-Speech engine..."
  42. LANG_DL_3="Downloading version 2.6.3-exe..."
  43. LANG_INST="Press forward to start the installation."
  44. LANG_WINETRICKS="Downloading Winetricks..."
  45. LANG_INST_TTS="Installing Text-To-Speech..."
  46. LANG_INST_3="Installing Lingoes..."
  47. LANG_INST_IE6="Press forward to install Internet Explorer 6."
  48. LANG_INST_VCRUN6="Press forward to install Visual C++-runtimes."
  49.  
  50.  
  51. ####    FUNCTIONS   ####
  52.  
  53. #Requires to be in the right directory already.
  54. #If the file exists: take a md5sum.
  55. #If wrong md5sum, download new file.
  56. #Repeat.
  57. #Return 0
  58.  
  59. Download_File()
  60. {
  61.     if [ -z "$1" ]
  62.     then
  63.         return 1
  64.     fi
  65.    
  66.     FILENAME="FILE_$1"
  67.     FILENAME="${!FILENAME}"
  68.    
  69.     URL="URL_$1"
  70.     URL="${!URL}"
  71.    
  72.     MD5="MD5_$1"
  73.     MD5="${!MD5}"
  74.    
  75.     DL="LANG_DL_$1"
  76.     DL="${!DL}"
  77.    
  78.     while [ "`md5sum $FILENAME | cut -c -32`" != "$MD5" ]
  79.     do
  80.         rm ./"$FILENAME"
  81.         POL_SetupWindow_download "$DL" "$TITLE" "$URL"
  82.     done   
  83.     return 0
  84. }
  85.  
  86.  
  87. ####    THE REAL START  ####
  88.  
  89. POL_SetupWindow_Init
  90. POL_SetupWindow_presentation "$TITLE" "$ORGANISATION" "$SITE" "Dr Phil" "$PREFIX"
  91.  
  92. select_prefix "$PREFIX"
  93. POL_SetupWindow_prefixcreate
  94. fonts_to_prefix
  95.  
  96. POL_SetupWindow_install_wine "$WINEVERSION"
  97. Use_WineVersion "$WINEVERSION"
  98.  
  99. cd "$RESOURCES"
  100. if [ ! -d "LINGOES" ]
  101. then
  102.     mkdir "LINGOES"
  103. fi
  104. cd "LINGOES"
  105.  
  106. Download_File "TTS"
  107. Download_File "3"
  108.  
  109. #I am too tired right now to fix ie6 and C++-libs without winetricks.
  110. POL_SetupWindow_message "$LANG_INST_IE6" "$TITLE"
  111. cd "$RESOURCES"
  112. wget http://www.kegel.com/wine/winetricks
  113. sh winetricks ie6
  114.  
  115. POL_SetupWindow_message "$LANG_INST_VCRUN6" "$TITLE"
  116. sh winetricks vcrun6
  117.  
  118. #POL_SetupWindow_wait_next_signal "$LANG_INST_TTS" "$TITLE"
  119. #cd "$RESOURCES/LINGOES/"
  120. #wine start "$FILE_TTS"
  121. #POL_SetupWindow_detect_exit
  122. #This is for the TTS-engine, which I haven't got to work.
  123.  
  124. cd "$RESOURCES/LINGOES/"
  125. POL_SetupWindow_wait_next_signal "$LANG_INST_3" "$TITLE"
  126. wine "$FILE_3"
  127. POL_SetupWindow_detect_exit
  128.  
  129. POL_SetupWindow_make_shortcut "LINGOES" "$PROGRAMFILES/Lingoes/Translator2" "Lingoes.exe" "" "Lingoes"
  130.  
  131. POL_SetupWindow_Close
  132. exit
RAW Paste Data