Jump to content
Sign in to follow this  
Elbereth

Newbie question

Recommended Posts

Elbereth

This will probably make you lough, but I cannot see what is wrong with this script:

RunWait ("L:\saplogon.exe")

WinActivate ("Archivio auto-estraente WinRAR")

If WinActive("Archivio auto-estraente WinRAR") Then

MsgBox(0, "", "La finestra è attiva")

EndIf

Send ("!i")

Send ("!t")

RunWait ("msiexec SAPSSO.msi", "L:")

Send ("{ALT}e")

Send ("{ALT}f")

I always get to the program window, but it stops without receiving the ALT+i signal and hangs there. What am I missing?

Thanks a lot

Share this post


Link to post
Share on other sites
nobby

Have you tried without the message box?

Or reactivate the window after the message box?

sometimes it is good to put some sleep statments in as well.

RunWait ("L:\saplogon.exe")
WinActivate ("Archivio auto-estraente WinRAR")
If WinActive("Archivio auto-estraente WinRAR") Then
MsgBox(0, "", "La finestra è attiva")
EndIf
WinActivate ("Archivio auto-estraente WinRAR")
sleep(250)
Send ("!i")
sleep(250)
Send ("!t")
RunWait ("msiexec SAPSSO.msi", "L:")
Send ("{ALT}e")
Send ("{ALT}f")

You may also check Winrar as you can compress with options to run after exctraction.


CheersNobby

Share this post


Link to post
Share on other sites
Elbereth

Yes, I had inserted some waiting instructions and eliminated the IF clause, but it still stops at the same point in execution.

Thanks for your quick support.

Share this post


Link to post
Share on other sites
SlimShady

Don't use RunWait if you want to send keystrokes to the application.

Try this:

$Title = "Archivio auto-estraente WinRAR"
Run ("L:\saplogon.exe")
WinWait ($Title)
Sleep(500)
WinActivate ($Title)
sleep(250)
Send ("!i")
sleep(250)
Send ("!t")
Run ("msiexec SAPSSO.msi", "L:")
Send ("{ALT}e")
Send ("{ALT}f")
Edited by SlimShady

Share this post


Link to post
Share on other sites
Elbereth

Thanks SlimShady, I have done as you suggested, I now have this code in use:

Run ("L:\saplogon.exe")
WinWait("Archivio auto-estraente WinRAR")
Sleep(500)
WinActivate ("Archivio auto-estraente WinRAR")
sleep(250)
Send ("!i")
sleep(250)
WinWait("Conferma sosituzione file")
Sleep(500)
WinActivate ("Conferma sosituzione file")
sleep(250)
Send ("{ALT}t")
Run ("L:\msiexec SAPSSO.msi")
WinWait("SAP Kerberos SSO Support Setup")
Sleep(500)
WinActivate ("SAP Kerberos SSO Support Setup")
sleep(250)
Send ("{ALT}e")
sleep(250)
Send ("{ALT}f")

And it seems to work, except for an MSI error message that I will try to debug by myself.

Thanks again to all of you.

Share this post


Link to post
Share on other sites
midiaxe

For running MSI installers, I usually use the following:

RunWait(@SystemDir & "\msiexec.exe /i filename.msi")

Hope this helps!

=MX=

Edited by midiaxe

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.