Guest timbale Posted December 15, 2003 Share Posted December 15, 2003 (edited) Sample of what I've done. Have you any suggestion ? (Sorry the comments are in french...) expandcollapse popup;-------------------------------------------------------------- ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Paramètre: Chemin du Setup.exe ; Script Function: Migration V4 vers Lotus Notes V5011 ; ;-------------------------------------------------------------- ;Initialisation ;-------------------------------------------------------------- ; Ligne de commande ;-------------------------------------------------------------- If $CmdLine[0] > 0 Then $PathSetupExe = $CmdLine[1] Else $PathSetupExe = @SCRIPTDIR EndIf $LanceurInstall = $PathSetupExe & "\Setup.exe -s -f1c:\setup.iss -f2c:\notes.log" ;-------------------------------------------------------------- ; Chemins possible pour le Notes.ini ;-------------------------------------------------------------- Dim $NotesIniPath[14] $NotesIniPath[1]="c:\windows\" $NotesIniPath[2]="c:\winnt\" $NotesIniPath[3]="c:\lotus\" $NotesIniPath[4]="c:\lotusnt\" $NotesIniPath[5]="c:\lotus\notes\" $NotesIniPath[6]="c:\lotusnt\notes\" $NotesIniPath[7]="u:\lotus\" $NotesIniPath[8]="u:\lotusnt\" $NotesIniPath[9]="u:\lotus\notes\" $NotesIniPath[10]="u:\lotusnt\notes\" $NotesIniPath[11]="c:\notes\lotus\" $NotesIniPath[12]="c:\notes\" $NotesIniPath[13]="" $i = 0 $Trouver = "PasTrouve" ;-------------------------------------------------------------- ;Plus d'entrée clavier et souris ;-------------------------------------------------------------- ;BlockInput(1) ;-------------------------------------------------------------- ;Barre de progresssion ;-------------------------------------------------------------- ProgressOn("", "Mise à jour du client Notes V4", "Montée de version de 4.x en 5.0.11", 0, @DesktopHeight - 150) Sleep(500) ;-------------------------------------------------------------- ;Recherche d'un Notes.ini et on s'arrête au premier trouvé ;-------------------------------------------------------------- while $Trouver="PasTrouve" AND $i<=8 $i = $i + 1 If FileExists($NotesIniPath[$i] & "notes.ini") $NotesIni = $NotesIniPath[$i]& "notes.ini" $Trouver="Oui" ProgressSet( 1 , "Préparation de l'installation" , "Recherche du Notes.ini") ExitLoop EndIf wend ;-------------------------------------------------------------- ;Cas où rien n'est trouvé ;-------------------------------------------------------------- if $Trouver == "PasTrouve" then MsgBox(0, "Le notes.ini n'a pas été trouvé !! ", "Arrêt !") ProgressOff( ) exit endif ;-------------------------------------------------------------- ;Chemin de rep Data ;-------------------------------------------------------------- $DataDir = IniRead($NotesIni, "Notes", "Directory", "NotFound") ProgressSet( 2 , "Préparation de l'installation" , "Recherche du Rép. des Data") sleep(1000) ;-------------------------------------------------------------- ;Chemin des Exes et DLL ;-------------------------------------------------------------- $ExeDir="" if $i=1 OR $i=2 then $Temp = StringSplit($DataDir, "\") $ExeDir = $Temp[1] for $j = 2 to $Temp[0]-1 $ExeDir = $ExeDir & "\" & $Temp[$j] Next else $ExeDir = $NotesIniPath[$i] EndIf ;-------------------------------------------------------------- ; Espace libre sur le disque des exes (espace disque libre en Mo) ;-------------------------------------------------------------- $ExeFree = DriveSpaceFree( StringLeft( $NotesIni, 3 ) ) ProgressSet( 3 , "Préparation de l'installation" , "Espace libre sur le Disque") Sleep(1000) if $ExeFree < 85 then MsgBox(4096, "Pas assez d'espace libre", " Pas assez d'espace libre ! ") ProgressOff( ) exit endif ;-------------------------------------------------------------- ; On fait une copie de sauvegarde les fichiers indispensables ;-------------------------------------------------------------- ; notes.ini, dekstop.dsk, names.nsf, *.id, ;-----> Titre de fenêtre : match si sous chaîne dedans.... ;-------------------------------------------------------------- AutoItSetOption("WinTitleMatchMode",2) ProgressSet( 4 , "Préparation de l'installation" , "Sauvegarde des anciens fichiers") sleep(2000) DirRemove("c:\lotussave", 1) DirCreate( "c:\lotussave\" ) ;-----> Notes.ini Sleep(1000) ProgressSet( 5 , "Préparation de l'installation" , "Sauvegarde du Notes.ini") FileCopy($NotesIni,"c:\lotussave\*.*",1) ;-----> desktop.dsk Sleep(1000) ProgressSet( 6 , "Préparation de l'installation" , "Sauvegarde du desktop.dsk") If FileExists($DataDir & "\dekstop.dsk") FileCopy($DataDir & "\dekstop.dsk","c:\lotussave\*.*",1) EndIf ;-----> fichiers ID Sleep(1000) ProgressSet( 7 , "Préparation de l'installation" , "Sauvegarde des ID's") If FileExists($DataDir & "\*.id") FileCopy($DataDir & "\*.id","c:\lotussave\*.*",1) EndIf ;-----> Names.nsf Sleep(1000) ProgressSet( 8 , "Préparation de l'installation" , "Sauvegarde du Names.nsf") If FileExists($DataDir & "\names.nsf") FileCopy($DataDir & "\names.nsf","c:\lotussave\*.*",1) EndIf Send ("exit{ENTER}") Sleep(1000) ;-------------------------------------------------------------- ;Ménage ;-------------------------------------------------------------- ProgressSet( 9 , "Préparation de l'installation" , "Destruction du répertoire Notes V4") FileDelete ( $DataDir ) Sleep(1000) FileDelete ( $ExeDir ) Sleep(1000) ;-------------------------------------------------------------- ;Copie de fichiers clés ;-------------------------------------------------------------- ProgressSet( 10 , "Préparation de l'installation" , "Fichiers d'installation") FileCopy($PathSetupExe & "\setup.iss", "c:\*.*",1) ; Fichier réponse Sleep(1000) FileCopy($PathSetupExe & "\Audiens\*.*", "c:\lotussave\*.*",1); Autres fichiers spécifiques Sleep(1000) FileDelete ( "c:\lotussave\*.exe" ) Sleep(1000) ;-------------------------------------------------------------- ; Lancement de l'installation de Lotus Notes 5.0.11 ;-------------------------------------------------------------- ProgressSet( 11 , "Installation silencieuse de Lotus Notes 5011 fr" , "Installation silencieuse en cours") Run ($LanceurInstall) Sleep(3000) Do Sleep(2000) Until FileFindFirstFile ($DataDir & "\bookmark.ntf") ProgressSet( 40 , "Installation silencieuse de Lotus Notes 5011 fr" , "Installation silencieuse en cours") Do Sleep(2000) Until FileFindFirstFile ($ExeDir & "\nlogasio.*") ProgressSet( 50 , "Installation silencieuse de Lotus Notes 5011 fr" , "Installation silencieuse en cours") Do Sleep(2000) Until FileFindFirstFile ($ExeDir & "\ninotes.dll") ProgressSet( 60 , "Installation silencieuse de Lotus Notes 5011 fr" , "Installation silencieuse en cours") Do Sleep(2000) Until FileFindFirstFile ($DataDir & "\*.dic") ProgressSet( 70 , "Installation silencieuse de Lotus Notes 5011 fr" , "Installation silencieuse en cours") Sleep(2000) ProgressSet( 80 , "Installation silencieuse de Lotus Notes 5011 fr" , "Installation silencieuse en cours") Sleep (1000) ;-------------------------------------------------------------- ; Remplacement de quelques fichiers ;-------------------------------------------------------------- ProgressSet( 95 , "Finalisation" , "Remplacement de fichiers") FileCopy("c:\lotussave\*.*", $DataDir & "\*.*",1) Sleep(1000) ;-------------------------------------------------------------- ; Suppression de quelques fichiers ;-------------------------------------------------------------- ProgressSet( 96 , "Finalisation" , "Suppression de fichiers") Sleep(1000) If FileExists($ExeDir & "\amovie.exe") FileDelete($ExeDir & "\amovie.exe") EndIf Sleep(1000) If FileExists($ExeDir & "\sload.exe") FileDelete($ExeDir & "\sload.exe") EndIf Sleep(500) FileDelete("c:\setup.iss") Sleep(500) If FileExists($DataDir & "\modems\hayes12.mdm") DirRemove($DataDir & "\modems", 1) EndIf If FileExists($DataDir & "\doc\readme.nsf") DirRemove($DataDir & "\doc", 1) EndIf Sleep(500) ;-------------------------------------------------------------- ; Ajout-Modifications de clés dans le Notes.ini ;-------------------------------------------------------------- ProgressSet( 97 , "Finalisation" , "Modification du Notes.ini") If FileExists($ExeDir & "\notes.ini") IniWrite($ExeDir & "\notes.ini", "Notes", "DeskIconColors", "0") IniWrite($ExeDir & "\notes.ini", "Notes", "Preferences", "-2147464079") EndIf Sleep(1000) ;-------------------------------------------------------------- ; Lancement de Lotus ;-------------------------------------------------------------- ProgressSet( 97 , "Lancement du client Lotus Notes" , "Cela peut prendre 2 minutes") Run ($ExeDir & "\nlnotes.exe") WinWaitActive( "Mot de passe","",120) ;-------------------------------------------------------------- ;Rétablissement des entrées clavier et souris ;-------------------------------------------------------------- ;BlockInput(0) ;-------------------------------------------------------------- ;Barre de progresssion ;-------------------------------------------------------------- ProgressOff( ) MsgBox(4096, "MAJ Terminée.", "Mise à jour terminée. Merci.") Edited December 16, 2003 by timbale Link to comment Share on other sites More sharing options...
nobby Posted December 16, 2003 Share Posted December 16, 2003 Joli travail, Pas besoin d'excuses pour le français... Nobby CheersNobby Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now