Newsgroup: it.comp.software.newsreader
Titolo: MesNews su Ubuntu

Per chi vuole installare MesNews su Ubuntu c'è un aggiornamento dello script per automatizzare le varie azioni.
Testato con wine 1.2, bash 4.1.5(1), Ubuntu 10.04, MesNews 1.8.3.0,
ma funziona su molte altre distribuzioni (con modifiche anche su OsX)
Salvare il testo qui sotto come script, eseguirlo e rispondere affermativamente a tutte le richieste che si verificheranno.
Buon divertimento.
--8<-----------------------------------------------------------------------
#! /bin/bash
# mn2wine (
http://www.alain-beguin.be/mn2wine
)
# A MesNews Linux Team product
# Install script for MesNews in Wine
#  
http://www.mesnews.net
# To run :
#  bash mn2wine
# Script version 0.0.7
# January 2009
# Tested with wine version 1.0.1
#             bash version 3.2.39(1)
#             Ubuntu Intrepid 64 bits
#             MesNews version 1.8.3.0
# December 2010
# Tested with wine version 1.2
#             bash version 4.1.5(1)
#             Ubuntu 10.04
#             MesNews version 1.8.3.0
#--------------------------------
#------8<---LOCALES------------
localiz(){
 case $1 in
  FR)
   IE_LOC="FR"
   MAIN_MESS="Installation de MesNews dans Wine"
   WINE_BKP="Sauvegarde du .wine existant"
   WAIT="... patientez ..."
   NEW_WINE="CrÃ©ation du nouveau .wine"
   PREP="PrÃ©paration"
   INS_GEN="Installation de"
   GET_GEN="RÃ©cupÃ©ration de"
   GET_HELP="l'aide HTML"
   PREP_RBT="PrÃ©paration avant redÃ©marrage"
   WINE_RBT="RedÃ©marrage de Wine"
   WINE_FIN="Finalisation de Wine"
   END_MESS="C'est fini";;
  NL)
   IE_LOC="NL"
   MAIN_MESS="Installatie van MesNews in Wine"
   WINE_BKP="Bewaren van bestaande .Wine"
   WAIT="... wachten ..."
   NEW_WINE="Maken van nieuwe .Wine"
   PREP="Voorbereiding"
   INS_GEN="Installatie van"
   GET_GEN="Recupereren van"
   GET_HELP="de HTML help"
   PREP_RBT="Herstarten voorbereiden"
   WINE_RBT="Herstarten Wine"
   WINE_FIN="Finaliseren Wine"
   END_MESS="Het is voorbij";;
  EN)
   IE_LOC="EN-US"
   MAIN_MESS="Intallation of MesNews in Wine"
   WINE_BKP="Saving existing .Wine"
   WAIT="... wait ..."
   NEW_WINE="Creating new .wine"
   PREP="Preparation"
   INS_GEN="Installation of"
   GET_GEN="Recovering of"
   GET_HELP="the HTML help"
   PREP_RBT="Preparing before restart"
   WINE_RBT="Restarting Wine"
   WINE_FIN="Finalisation of Wine"
   END_MESS="It's over";;
  IT)
   IE_LOC="IT"
   MAIN_MESS="Installazione di MesNews sotto Wine"
   WINE_BKP="Backup della .wine esistente"
   WAIT="... attendere ..."
   NEW_WINE="Creazione della nuova .wine"
   PREP="Preparazione"
   INS_GEN="Installazione di"
   GET_GEN="Recupero di"
   GET_HELP="aiuto HTML"
   PREP_RBT="Preparazione prima del riavvio"
   WINE_RBT="Riavvio di Wine"
   WINE_FIN="Finalizzazione di Wine"
   END_MESS="Completato";;
 esac
}
#------>8---LOCALES------------
#------8<---VARS---------------
insdir="$PWD"
hwine="$HOME/.wine"
drivec="$hwine/drive_c"
win="$drivec/windows"
sys32="$win/system32"
pfiles="$drivec/Program Files"
wu="$sys32/wupdate"
owin="$win/oldwin"
osys="$sys32/oldsys"
#------>8---VARS---------------
#------8<---FUNCTIONS----------
message(){
 clear
 echo '-------------------< mn2wine >--------------------'
 echo -e '      \E[1;37;44m'"$1"'\E[0m'
 echo '--------------------------------------------------'
 sleep $2
}
warning(){
 echo -e '\E[1;31m'"$1"'\E[0m'
 sleep $2
}
dir2lower(){
 for F in `ls $1 $2`
  do
  if [ ! -f $F ]; then
   continue
  fi
  FM=`echo $F | tr '[A-Z]' '[a-z]'`
  if [ $FM != $F ]; then
   mv -i $F $FM
  fi
 done
}
reboot(){
 wineserver -k
 wineboot
}
[regstart](){
 echo 'REGEDIT4'$'\r'> tmp.reg
 echo $'\r'>>tmp.reg
}
[regend](){
 echo $'\r'>>tmp.reg
 wine regedit tmp.reg
 rm -f tmp.reg
}
verwin(){
 [regstart]
 echo '[HKEY_CURRENT_USER\Software\Wine]'$'\r'>>tmp.reg
 echo '"Version"="'"$1"$'"\r'>>tmp.reg
 [regend]
}
verie(){
 [regstart]
 echo '[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer]'$'\r'>>tmp.reg
 echo '"Build"="'"$1"$'"\r'>>tmp.reg
 echo '"Version"="'"$2"$'"\r'>>tmp.reg
 [regend]
}
setfiles(){
 [regstart]
 echo '[HKEY_CURRENT_USER\Software\Wine\DllOverrides]'$'\r'>>tmp.reg
 for F in $1
  do
  if [ ${F#*.} == 'dll' ]
   then
    echo '"'"${F%.*}"'"="'"$2"$'"\r'>>tmp.reg
   else
    echo '"'"$F"'"="'"$2"$'"\r'>>tmp.reg
  fi
 done
 [regend]
}
set_cur_builtin(){
 [regstart]
 if [ $3 ] ; then
  echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\'"$1"']'$'\r'>>tmp.reg
  echo '"Version"="'"$3"'"'$'\r'>>tmp.reg
 fi
 echo '[HKEY_CURRENT_USER\Software\Wine\AppDefaults\'"$1"'\DllOverrides]'$'\r'>>tmp.reg
 for D in $2; do
  echo '"'$D'"="builtin"'$'\r'>>tmp.reg
 done
 [regend]
}
transfert(){
 curdir="$PWD"
 for F in `ls *.*`
  do
  if [ ! -f "$1/$F" ]; then
   mv -f "$F" "$1/$F"
   if [ $2 ]; then
   if [ ${F#*.} == 'dll' ]; then
    cd "$1"
    cd "$curdir"
   fi
   fi
  fi
 done
}
clean_backup(){
 cd $1
 IFS=$'\n'
 for D in `find -type d -not -empty -not -iregex '.*\(\.$\|gecko\|mozilla\).*'`
  do
  cd "$1${D#*.}"
  F=(`find -maxdepth 1 -type f`)
  if [ ${#F[@]} == 0 ] ; then
   continue
  fi
  chmod +rwx *.*
  dir2lower
  mkdir 'old_files'
  transfert "$1${D#*.}/old_files"
 done
 unset IFS
}
washit(){
 cd "$1"
 IFS=$'\n'
 for D in `find -type d`
  do
  D="${D#.}"
  if [ `echo "$D"|grep -i 'old_files'` ] ; then
   cd "$1${D%/*}"
   dir2lower
   setfiles "`ls *.{dll,ocx,tlb,ax,exe}|grep -v 'advapi32.dll\|comctl32.dll\|ntdll.dll'`" native
   cd "$1$D"
   dir2lower
   transfert "$1${D%/*}" "ok"
   cd "$1${D%/*}"
   rm -r "$1${D%/*}/old_files"
  else
   if [ ! `echo "$D"|grep -i '.*\(\.$\|gecko\|mozilla\).*'` ] ; then
    cd "$1$D"
    dir2lower
    setfiles "`ls *.{dll,ocx,tlb,ax,exe}|grep -v 'advapi32.dll\|comctl32.dll\|ntdll.dll'`" native
   fi
  fi
 done
 unset IFS
}
csht(){
 cat>csht.vbs<<VBS
 N=WScript.Arguments(0)
 F=WScript.Arguments(1)
 Set FSO=CreateObject("Scripting.FileSystemObject")
 FSO.DeleteFile("csht.vbs")
 If FSO.FileExists(F) Then
  With CreateObject("WScript.Shell")
   WH=.Environment("PROCESS")("wh")
   NS=.SpecialFolders("Desktop")&"\"&N&".lnk"
   With .CreateShortCut(NS)
    .TargetPath=F
    .IconLocation=F&",0"
    .Save
   End With
  End With
  While Not FSO.FileExists(wh&"\Desktop\"&N&".desktop")
   WScript.Sleep 0
  Wend
  FSO.DeleteFile(NS)
 End If
VBS
 wine wscript csht.vbs "$1" "$2"
}
#------>8---FUNCTIONS----------
clear
if [ -z `which wine` ];then
 warning 'Wine not installed' 2
 exit
fi
#if [ -z `wine --version|grep '\(1\.0\|1\.0\.1\)$'` ];then
# warning 'Bad Wine version\nUse 1.0 or 1.0.1' 3
# exit
#fi
echo $'\E[1;34m1 FranÃ§ais\n2 Nederlands\n3 English\n4 Italiano\E[0m'
read -n 1 LOC
case $LOC in
 1) localiz "FR" ;;
 2) localiz "NL" ;;
 3) localiz "EN" ;;
 4) localiz "IT" ;;
 *) clear;exit
esac
message "$MAIN_MESS" 2
cd $HOME
if [ -e '.wine' ]
then
add=$(date +.wine-%Y%m%d%H%M%S)
message "$WINE_BKP $HOME/$add" 2
mv .wine $add
fi
message "$NEW_WINE $WAIT" 0.5
cd $HOME
rm -fr .wine
reboot &> /dev/null
message "$PREP" 0.5
verwin win98
verie 1.1 1.1.1.1
rm -fr "$win/system"
ln -s "$sys32" "$win/system"
mkdir "$wu"
clean_backup "$drivec"
setfiles 'advpack.dll atl.dll' 'native'
setfiles 'advapi32.dll ntdll.dll' 'builtin'
set_cur_builtin 'wineboot.exe' 'ole32 oleaut32 rpcrt4'
set_cur_builtin 'services.exe' 'ole32 oleaut32 rpcrt4'
set_cur_builtin 'winedevice.exe' 'ole32 oleaut32 rpcrt4'
message "$GET_GEN DCOM" 1
cd "$wu"
wget '
http://download.microsoft.com/download/d/1/3/d13cd456-f0cf-4fb2-a17f-20afc79f8a51/DCOM98.EXE
'
wine DCOM98.exe /C /T:"c:\windows\system32\wupdate\dcom" &> /dev/null
cd dcom
chmod +rw *.*
dir2lower
wine rundll32.exe advpack.dll,LaunchINFSection "dcom98.inf",UninstallOLDOLE &> /dev/null
cd "$wu/dcom"
wine rundll32.exe advpack.dll,LaunchINFSection "dcom98.inf",DefaultInstall &> /dev/null
message "$GET_GEN $GET_HELP" 1
cd "$wu"
wget '
http://download.microsoft.com/download/platformsdk/Redist/1.3/WIN98MeXP/EN-US/hhlpinst.EXE
'
wine hhlpinst.EXE /C /T:"c:\windows\system32\wupdate\hh" &> /dev/null
cd hh
unzip htmlhelp.exe &> /dev/null
cd x86
dir2lower
wine hhupd.exe &> /dev/null
message "$GET_GEN Internet Explorer 6" 1
cd $wu
wget '
http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/
'"$IE_LOC"'/ie6setup.exe'
message "$INS_GEN Internet Explorer 6" 1
wine ie6setup.exe -r:n &> /dev/null
cd "$wu"
regedit -e ronce.reg 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce'
regedit -e roncex.reg 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx'
[regstart]
echo '[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce]'$'\r'>>tmp.reg
echo '[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnceEx]'$'\r'>>tmp.reg
echo '[HKEY_CURRENT_USER\Software\Microsoft\Internet Connection Wizard]'$'\r'>>tmp.reg
echo '"Completed"=hex:01,00,00,00'$'\r'>>tmp.reg
echo '[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]'$'\r'>>tmp.reg
echo '"Start Page"="
http://www.mesnews.net/
"'$'\r'>>tmp.reg
[regend]
message "$GET_GEN MFC40" 1
cd "$wu"
wget '
http://activex.microsoft.com/controls/vc/mfc40.cab
'
wine extract mfc40.cab &> /dev/null
wine mfc40.exe -r:n &> /dev/null
message "$PREP_RBT" 1
cd "$wu"
grep -v 'initpki' "$wu/roncex.reg" > ronceex.reg
wine regedit ronce.reg
wine regedit ronceex.reg
message "$WINE_RBT $WAIT" 0.5
wineboot &> /dev/null
message "$WINE_FIN $WAIT" 0.5
washit "$drivec" &> /dev/null
set_cur_builtin 'regsvr32.exe' 'ole32 oleaut32 rpcrt4' 'nt351'
set_cur_builtin 'rundll32.exe' 'ole32 oleaut32 rpcrt4' 'nt351'
# pstorec pstrorerc
regsvr32 -s -i shdocvw.dll &> /dev/null
regsvr32 -s -i urlmon.dll &> /dev/null
regsvr32 -s -i initpki.dll &> /dev/null
if [ -f "$win/inf/icw.inf" ];then
 if [ -f "$sys32/icfg95.dll" ];then
  cp -f "$sys32/quartz.dll" "$sys32/icfgnt.dll"
 fi
 wine rundll32 advpack.dll,LaunchINFSectionEx "c:\windows\inf\icw.inf",,,256 &> /dev/null
fi
#set_cur_builtin 'pstores.exe' 'advapi32 rpcrt4'
[regstart]
echo '[HKEY_CURRENT_USER\Software\Microsoft\Internet Account Manager\Accounts\00000001]'$'\r'>>tmp.reg
echo '"Account Name"="ZOO"'$'\r'>>tmp.reg
echo '"NNTP Display Name"="<mn2wine>"'$'\r'>>tmp.reg
echo '"NNTP Email Address"="inv...@invalid.invalid"'$'\r'>>tmp.reg
echo '"NNTP Password2"=hex:01,01,0c,00,00,00,18,7d,66,7a,08,12,00,01,0b,1b,0a,6f'$'\r'>>tmp.reg
echo '"NNTP Prompt for Password"=dword:00000000'$'\r'>>tmp.reg
echo '"NNTP Server"="
news.zoo-logique.org
"'$'\r'>>tmp.reg
echo '"NNTP Use Sicily"=dword:00000000'$'\r'>>tmp.reg
echo '"NNTP User Name"="MesNewsOnly"'$'\r'>>tmp.reg
[regend]
if [ -d "$insdir/MesNews" ]
then
 ln -s "$insdir/MesNews" "$pfiles/MesNews"
else
 cd "$wu"
 message "$GET_GEN MesNews" 0.5
 wget '
http://www.mesnews.net/x-chargement.php?fichier=setup-complet
' -O 'mnsetup.exe'
 message "Installation de MesNews" 0.5
 wine mnsetup.exe &> /dev/null
fi
if [ -f "$win/wscript.exe" ];then
 if [ -n `which xdg-user-dir` ];then
  wpf="c:\Program Files"
  wh=`echo 'z:'$HOME|sed "s/\//\\\\\/g"`
  export wh
  csht 'MesNews' "$wpf\MesNews\MesNews2.exe" &> /dev/null
  csht 'Internet Explorer' "$wpf\Internet Explorer\iexplore.exe" &> /dev/null
  csht 'Outlook Express' "$wpf\Outlook Express\msimn.exe" &> /dev/null
  unset wh
  DSK=`xdg-user-dir DESKTOP`
  if [ "$DSK" != "$HOME/Desktop" ];then
   if [ -d "$HOME/Desktop" ];then
    cd "$HOME/Desktop"
    cp *.desktop "$DSK"
   fi
  fi
 fi
fi
rm -fr "$wu"
message '_________'"$END_MESS"'_________' 1
exit
# HKEY_USERS\S-1-5-4\Identities\{EB94C59E-7F6F-4A71-94C9-B69CD50EBBC0}\Software\Microsoft\Outlook Express\5.0\Mail
--8<-----------------------------------------------------------------------
-- 
Sans
Riassunto delle puntate precedenti: 
http://beam.to/mesnews

 per automatizzare le varie azioni.
GRAZIE!!!
-- 
Umin