coucou Posted May 31, 2006 Share Posted May 31, 2006 Hi,I wrote a script for a silent-install an CyberLink PowerProducer update .Sometimes it ask to RESTART Windows sometimes NOT. Then I added a second "IF" condition, when the first "IF" condition is used for language select.My problem is sometimes the installation never ends. It wait for the very last command ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4")Here bellow the entire script. Do anyone can check and correct it?expandcollapse popup$Restart = "Redémarrage de Windows" $Lang = RegRead("HKEY_CURRENT_USER\Control Panel\International", "sLanguage") If $Lang = "FRA" Then ;CyberLink PowerProducer 3.0 DVD Update Installation Run("PowerProducer30Patch.exe") WinWaitActive("Sélection de la langue d'installation") sleep(1000) Send("{ENTER}") ;Bienvenue WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Bienvenue dans l'InstallShield Wizard de PowerProducer") Send("!s") ;Licence WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Contrat de licence") Send("!o") ;Installation WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation de") Send("!s") ;Restart Windows;Button2=No;Button3=OK sleep(1000) If WinWaitActive($Restart) Then sleep(1000) ControlClick("Redémarrage de Windows", "", "Button2") ControlClick("Redémarrage de Windows", "", "Button3") Else EndIf ;Installation Finished;Button4=Finish WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée") sleep(1000) ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4") EndIfRegardscoucou Link to comment Share on other sites More sharing options...
Uten Posted May 31, 2006 Share Posted May 31, 2006 I sugest that you create a loop around your code while the PID provided by Run exists. Add winwait timeouts such that your code will continue to run checks agains diffrent windows. Something like this: expandcollapse popup$Restart = "Redémarrage de Windows" $Lang = RegRead("HKEY_CURRENT_USER\Control Panel\International", "sLanguage") If $Lang = "FRA" Then ;CyberLink PowerProducer 3.0 DVD Update Installation $pid = Run("PowerProducer30Patch.exe") WinWaitActive("Sélection de la langue d'installation") sleep(1000) Send("{ENTER}") ;Bienvenue WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Bienvenue dans l'InstallShield Wizard de PowerProducer") Send("!s") ;Licence WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Contrat de licence") Send("!o") Do ;Installation WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation de",1) Send("!s") ;Restart Windows;Button2=No;Button3=OK sleep(1000) If WinWaitActive($Restart) Then sleep(1000) ControlClick("Redémarrage de Windows", "", "Button2") ControlClick("Redémarrage de Windows", "", "Button3") Else EndIf ;Installation Finished;Button4=Finish WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée",1) ; sleep(1000) ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4") Until (ProcessExists($pid) = 0) EndIf Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
coucou Posted May 31, 2006 Author Share Posted May 31, 2006 TNX for the loop advise. BTW, does the "IF" conditions (overlap each other) are correctly set? coucou Link to comment Share on other sites More sharing options...
Valuater Posted May 31, 2006 Share Posted May 31, 2006 i only found 1 Else that was not needed expandcollapse popup$Restart = "Redémarrage de Windows" $Lang = RegRead("HKEY_CURRENT_USER\Control Panel\International", "sLanguage") If $Lang = "FRA" Then ;CyberLink PowerProducer 3.0 DVD Update Installation $pid = Run("PowerProducer30Patch.exe") WinWaitActive("Sélection de la langue d'installation") Sleep(1000) Send("{ENTER}") ;Bienvenue WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Bienvenue dans l'InstallShield Wizard de PowerProducer") Send("!s") ;Licence WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Contrat de licence") Send("!o") Do ;Installation WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation de", 1) Send("!s") ;Restart Windows;Button2=No;Button3=OK Sleep(1000) If WinWaitActive($Restart) Then Sleep(1000) ControlClick("Redémarrage de Windows", "", "Button2") ControlClick("Redémarrage de Windows", "", "Button3") EndIf ;Installation Finished;Button4=Finish WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", 1) ; sleep(1000) ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4") Until (ProcessExists($pid) = 0) EndIf 8) Link to comment Share on other sites More sharing options...
PsaltyDS Posted May 31, 2006 Share Posted May 31, 2006 TNX for the loop advise. BTW, does the "IF" conditions (overlap each other) are correctly set? coucou Yes, it's OK to have IF inside another IF ('nested' is the term for it). You do have an empty ELSE statement there that isn't required, but probably doesn't cause errors. If $Color = "Red" Then If $Symbol = "Pointy" Then $Suit = "Diamonds" Else $Suit = "Hearts" EndIf Else If $Symbol = "PuppyFeet" Then $Suit = "Clubs" Else $Suit = "Spades" EndIf EndIf Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
coucou Posted May 31, 2006 Author Share Posted May 31, 2006 TNX all I'll probably test it next week and let you know Regards coucou Link to comment Share on other sites More sharing options...
coucou Posted June 9, 2006 Author Share Posted June 9, 2006 (edited) Sorry for the delay i was in vacation. I tested today the script... same problem The installation never ends. It wait for the very last command ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4") BTW, by using "Windows Task Manager" to see what process handle this installation, right click on the application "PowerProducer30Patch.exe" and select "Go to Proceess"... the process is "ikernel.exe"... strange Anyone can help? Regards coucou Edited June 9, 2006 by coucou Link to comment Share on other sites More sharing options...
Uten Posted June 9, 2006 Share Posted June 9, 2006 It's a timout on WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", 1) ; sleep(1000) ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4")oÝ÷ Ù8^Z)Öj+@r¸¯yƧ«Þ}¨¥yÒØZ³*.v÷öضØ^rX«¢+Ù%]¥¹]¥ÑÑ¥Ù ÅÕ½Ðí%¹Íѱ±Ñ¥½¸ åÉ1¥¹¬A½ÝÉAɽÕÈ̸ÀYAÑ ÅÕ½Ðì°ÅÕ½Ðí%¹Íѱ±Ñ¥½¸Ñɵ¥»¥ÅÕ½Ðì°Ä¤Q¡¸(ìͱÀ ÄÀÀÀ¤( ½¹Ñɽ± ±¥¬ ÅÕ½Ðí%¹Íѱ±Ñ¥½¸ åÉ1¥¹¬A½ÝÉAɽÕÈ̸ÀYAÑ ÅÕ½Ðì°ÅÕ½Ðí%¹Íѱ±Ñ¥½¸Ñɵ¥»¥ÅÕ½Ðì°ÅÕ½Ðí ÕÑѽ¸ÐÅÕ½Ðì¤)¹% Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
coucou Posted June 9, 2006 Author Share Posted June 9, 2006 TNX Uten, Tested... Sorry ... It does not help coucou Link to comment Share on other sites More sharing options...
Uten Posted June 9, 2006 Share Posted June 9, 2006 So what happens? Do you ever get to the line? ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4")oÝ÷ Øò¢çhjwm«ew¡ë'¢Ü(®Kaz{az·¢²èm¦åÊÊ&¶§ è"¶"{Þ²Ø j×ì"Ú0Â+aíÈúÛz'íç(ÚèZ®¢Ðn¶Ú'⫨¶·(¬¶«xƲm쨺ÈhºWn±ëaz{¦z¸ í®Hêæk&ÞÊ¡j÷¢Ç~.²Ú-ç(Úè©Ý¶§ë-ºÇ¬zwS+!jÈZ¦§vÚ&y·¢·*.v÷ö×hʽêàzÖ°whÃ×±µ©Ý¶+ezX¤zØb±«¢+Ù]¥¹á¥ÍÑÌ ÅÕ½Ðí%¹Íѱ±Ñ¥½¸ åÉ1¥¹¬A½ÝÉAɽÕÈ̸ÀYAÑ ÅÕ½Ðì°ÅÕ½Ðí%¹Íѱ±Ñ¥½¸Ñɵ¥»¥ÅÕ½Ðì Appart from this I'm all out of ideas Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling Link to comment Share on other sites More sharing options...
coucou Posted June 9, 2006 Author Share Posted June 9, 2006 Ok, Here my last test. As in this time the installation NOT ask for the restart, I put a comma in front of all the second "IF" sequence (see here bellow)... It works just fine expandcollapse popup$Restart = "Redémarrage de Windows" $Lang = RegRead("HKEY_CURRENT_USER\Control Panel\International", "sLanguage") If $Lang = "FRA" Then ;Installation de CyberLink PowerProducer 3.0 DVD Patch Run("PowerProducer30Patch.exe") WinWaitActive("Sélection de la langue d'installation") sleep(1000) Send("{ENTER}") ;Bienvenue WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Bienvenue dans l'InstallShield Wizard de PowerProducer") Send("!s") ;Licence WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Contrat de licence") Send("!o") ;Installation WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation de") Send("!s") ;;Redémarrage de Windows;Button2=Non, je redémarrerai mon ordinateur plus tard;Button3=OK ; sleep(1000) ; If WinWaitActive($Restart) Then ;;WinWaitActive("Redémarrage de Windows", "L'assistant d'installation a terminé la copie") ; sleep(1000) ; ControlClick("Redémarrage de Windows", "", "Button2") ; ControlClick("Redémarrage de Windows", "", "Button3") ; ; Else ; EndIf ;Installation terminée;Button4=Terminée WinWaitActive("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée") sleep(1000) ControlClick("Installation de CyberLink PowerProducer 3.0 DVD Patch", "Installation terminée", "Button4") EndIf I stay puzzeled, don't know what to do if the installation ask for the restart Regards coucou Link to comment Share on other sites More sharing options...
Uten Posted June 9, 2006 Share Posted June 9, 2006 If you are asked for a restart and the installation will continue with dialogs after the restart your script should place itself in [HKCU|HKCM]\Software\Microsoft\Windows\CurrentVersion\RunOnce in the registry and continue to run after the restart. You might want to add some logic and commandline switches to skip the part that is already covered. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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