Jump to content

Script (WinExists) runs fine on my PC but other PCs no go.


randee
 Share

Recommended Posts

I am a NOOB so don't beat me up to bad.

Trying to make a script to install several pieces of software.

Script works fine on my machine and works up until a certain point on other PCs.

The "WinExists" command doesn't seem to work on non-AutoIT installed PCs.

Spent the last few days trying to figure it out and searching the forum, couldn't find anything.

I thought it was a problem between XP and Vista, but then I tried it on another XP machine and still no response. Am I not including something I should?

I would appreciate any help, thanks!

RandEE

EDIT: I should add that AutoIT rocks... I think it's going to help me out immensely!

If GUICtrlRead($I_shockwave) = $GUI_CHECKED Then
;msgbox (0,"msg","install " & GUICtrlRead($I_shockwave,1))
GUICtrlSetData($lbl_status,"Installing " & GUICtrlRead($I_shockwave,1))
;RunWait("Shockwave_Installer_Slim.exe /S")
    RunWait("Shockwave_Installer_Full.exe")
   Local $Done = False
   While Not $Done
    If WinExists("Installing Adobe Shockwave Player") Then
     sleep(1000)
     ControlSend("Installing Adobe Shockwave Player", "","", "{TAB}")
     sleep(1000)
     ControlSend("Installing Adobe Shockwave Player", "","", "{SPACE}")
     sleep(1000)
     ControlSend("Installing Adobe Shockwave Player", "","", "{TAB}")
     sleep(1000)
     ControlSend("Installing Adobe Shockwave Player", "","", "{SPACE}")
     sleep(1000)
 
    ElseIf WinExists("Adobe Shockwave Player Setup", "Successfully Completed") Then
     sleep(1000)
     ControlSend("Adobe Shockwave Player Setup", "", "","{ENTER}")
     sleep(1000)
     ;ControlClick($title, "", "Button1")
     $Done = True
    Else
     Sleep(500)
     ContinueLoop
    EndIf
   WEnd
    sleep(1000)
   Else
    ;msgbox (0,"msg","skipping " & GUICtrlRead($I_shockwave,1))
   EndIf

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Edited by randee
Link to comment
Share on other sites

Welcome to Autoit!

I may not be exactly correct! but i can give small suggestion instead of using Sleep() function why don't you use Winwait() function to get the window and do your command?

Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font]

Link to comment
Share on other sites

I dont think you should be using RunWait(). RunWait() should be stopping your script until Shockwave_Installer_Full.exe has finished (not allowing it to go into the while loop). Try changing that to just Run(). I agree with Syed23 that you should be using either WinWait() or WinWaitActive() instead of WinExist(). Controls can resist commands like ControlSend() or ControlClick() if they are not the active window.

Edit: About the winexist() only working on some pc's, I highly doubt thats the problem. To verify thats not it you can simply launch the installer manually, then run a small script that just checks winexist().

If WinExists("Installing Adobe Shockwave Player") Then msgbox(0,'','Window Exists')
Edited by Beege
Link to comment
Share on other sites

I dont think you should be using RunWait(). RunWait() should be stopping your script until Shockwave_Installer_Full.exe has finished (not allowing it to go into the while loop). Try changing that to just Run(). I agree with Syed23 that you should be using either WinWait() or WinWaitActive() instead of WinExist(). Controls can resist commands like ControlSend() or ControlClick() if they are not the active window.

Edit: About the winexist() only working on some pc's, I highly doubt thats the problem. To verify thats not it you can simply launch the installer manually, then run a small script that just checks winexist().

If WinExists("Installing Adobe Shockwave Player") Then msgbox(0,'','Window Exists')

Doh!

I wonder why it worked on my machine? I am sure I screwed something up...

That makes complete sense though. Spent a lot of time looking at that code, can't believe I didn't think about that. Really appreciate the 2nd set of eyes! Thanks Beege & Syed23

Link to comment
Share on other sites

I know this may be a little late, but I use silent install options for installing software most of the time. It makes it easier when I have to push the software to hundreds of PCs. Check this out for Shockwave.

Silent installation and configurations of Shockwave player

Also look at AppDeploy.com on how to silently install other software packages.

Adam

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...