Newsgroup: it.comp.software.newsreader
Titolo: Mesnews su ubuntu?

� utopia o posso continuare a sperare?
p.

 � utopia o posso continuare a sperare?
ma.. quoto! non c'� nulla di decente che possa lontanamente assomigliargli.

 ï¿œ utopia o posso continuare a sperare?
per ora, o via virtualbox con una macchina guest win (e con MesNews);
o via wine con la seguente procedura:
Testato con :
wine versione 1.0.1
bash versione 3.2.39(1)
ubuntu Intrepid (gnome) 64 bits
MesNews versione 1.8.3.0
Wine deve essere giï¿œ installato.
Eseguire lo script in allegato che installa IE e MesNews.
L'installazione di IE e dei componenti si fa con l'interfaccia "Windos".
Per eseguire lo script, aprire un terminale e digitare :
       bash <percorso dello script>/mn2wine
-----------------
Segue altro messaggio con lo script nel corpo (10 KB) da salvare in un 
file di testo col nome *mn2wine*
-- 
Sans
Riassunto delle puntate precedenti: 
http://beam.to/mesnews

# ### da salvare in un file di testo col nome *mn2wine* ###
#! /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.6
# 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
#--------------------------------
#------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 [ $2 ] ; then
  echo 
'[HKEY_CURRENT_USER\Software\Wine\AppDefaults\'"$1"']'$'\r'>>tmp.reg
  echo '"Version"="'"$2"'"'$'\r'>>tmp.reg
 fi
 echo 
'[HKEY_CURRENT_USER\Software\Wine\AppDefaults\'"$1"'\DllOverrides]'$'\r'>>tmp.reg
 echo '"ole32"="builtin"'$'\r'>>tmp.reg
 echo '"oleaut32"="builtin"'$'\r'>>tmp.reg
 echo '"rpcrt4"="builtin"'$'\r'>>tmp.reg
 [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'
set_cur_builtin 'services.exe'
set_cur_builtin 'winedevice.exe'
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' 'nt351'
regsvr32 -s -i shdocvw.dll &> /dev/null
regsvr32 -s -i urlmon.dll &> /dev/null
regsvr32 -s -i initpki.dll &> /dev/null
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
