Sign in to follow this  
Followers 0
houghl

AdlibEnable problems

7 posts in this topic

Hi there im having trouble with the adlibenable function. I have read other posts whch i thought would help but still not working. I must be missing something here but here goes, you help would be greatly appreciated.

I am trying to install some software and during the install process a window appears asking whether i want to keep or overwrite files because they exist. I thought the script below would do this but no such luck i have included a win spy screen aswell. I want the check to run during the whole script to pick these errors up

AdlibEnable("conflict", 1000)

Func conflict()

If WinActive("Version Conflict") Then

Send("{ENTER}")

EndIf

EndFunc

Run("setup.exe")

WinWaitActive("Neoteric AutoCard Viewer Setup", "OK")

Send("{ENTER}")

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: Version Conflict

Class: ThunderRT6Form

Size: X: 465 Y: 366 W: 350 H: 291

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 5 Y: 562

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xBCBCBC Dec: 12369084

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:

Control ID:

ClassNameNN:

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

No to &All

&No

&Yes

Share this post


Link to post
Share on other sites

#2 ·  Posted (edited)

How exactly does the script fail? Does the Conflict window popup and the script get stuck at that point?

1) You might want to use WinExists instead of WinActive in your func.

2) The following might help you debug. Check that the window title does not contain an extra space at the end, and make sure Adlib enable is being called every second:

Func conflict()
  Local $title = WinGetTitle('');title of active window
  Tooltip(">>" & $title & "<< " & @SEC, 0, 0)
  If WinActive("Version Conflict") Then
    Send("{ENTER}")
  EndIf
EndFunc

3) Your script might be finishing right away....

Does the conflict window appear BEFORE or AFTER the "Neoteric AutoCard Viewer Setup" window appears. If answer is AFTER, then your script is probably ending too soon.

You might need to add WinWaitClose("Neoteric AutoCard Viewer Setup") OR you might want to get rid of AdlibEnable, and just call WinExists a few times at the start of the script.....

Edit: Added comments about WinWaitClose

Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Thanks for your reply CyberSlug much appreciated

After reading your reply i used your bit of code for the debuging of my function this worked a treat, and as you also suggested my script was simple ending before the conflict windows appeared. I am now using the winwaitactive as you can see alot more often to control the script properley instead of just sending enters when i think they are needed. My script (sorry our script) now looks like this.

AdlibEnable("conflict")

Func conflict()

If WinActive("Version Conflict") Then

Send("{ENTER}")

EndIf

EndFunc

Run("setup.exe")

WinWaitActive("Neoteric AutoCard Viewer Setup", "OK")

Send("{ENTER}")

WinWaitActive("Neoteric AutoCard Viewer Setup", "Directory:")

Send("{ENTER}")

WinWaitActive("Neoteric AutoCard Viewer - Choose Program Group")

Send("{ENTER}")

WinWaitActive("Neoteric AutoCard Viewer Setup", "completed successfully")

Send("{ENTER}")

This now works like a charm. thankyou once again for your help you guided me down the right path cheers.

PS how do you do the bit where your post has the code in a window rather than just as message text? As im hoping to use this wonderful tool alot more and would make my posts easier to read.

Share this post


Link to post
Share on other sites

[ code ] stuff goes here [ /code ]

Be sure to remove the spaces around the brackets.

You should also see buttons near the top of the window when you create a new post...

The buttons look like:

B I U FONT SIZE COLOR

htp:// IMG @ QUOTE CODE


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

While you seem to be my online support specialist CyberSlug ive got another question for you not strictly related to adlib but a continuation of my script.

My script now functions if i run it on my PC i now need to roll this out to a number of machines (140) i normally use beyondexec which is a neat tool (http://www.beyondlogic.org) to issue commands to be run at remote machines but for some reason it wont run the au3 files.

From your experience are there better ways of doing this. I could get the users to click on a shortcut but would prefer it to do this automaticaly.

And i know ive said it allready but thanks for your replies

PS Heres my bit of code hopefully in a pretty window....lol

@echo off
REM Script to send the autocard viewer to desktops (LPH, 24/05/2004)

:loop
dir d:\3gpatch\sendautocard /b>%temp%\sendautocard.txt
FOR /F "TOKENS=1,*" %%k IN (%temp%\sendautocard.txt) DO (

echo About to send Autocard to %%k.

if not exist "\\%%k\C$\VISION\bin\vision.exe" (
echo %%k is inaccessable or no VISION installed.
cls
) ELSE (
copy d:\3gpatch\autoview.reg \\%%k\C$
beyondexec \\%%k REGEDIT /S c:\autoview.reg
del \\%%k\C$\autoview.reg /q
beyondexec \\%%k -c d:\3gpatch\autocard\autoit-v3-setup.exe autoit-v3-setup.exe /S
copy d:\3gpatch\autocard\autocard.au3 \\%%k\C$
beyondexec \\%%k autocard.au3
del \\%%k\c$\autocard.au3 /q
now %%k has autocard installed>>sendautocard.log
del d:\3gpatch\sendautocard\%%k
cls
)
)
goto loop

and the result is as follows

BeyondExec V2.05 - Spawn Remote Processes on Windows NT/2000/XP WorkStations.
Copyright(C) 2002-2003 Craig.Peacock@beyondlogic.org
[p64143] Establishing Connection . . .
[p64143] BeyondExec service already installed on remote machine.
[p64143] Copying d:\3gpatch\autocard\autoit-v3-setup.exe to \\p64143\ADMIN$\tem
\autoit-v3-setup.exe
[p64143] Command Successfully Issued to p64143 on Pipe 1.
[p64143] Process started, ProcessID = 1656, ThreadID = 1784
[p64143] Process terminated with exit code 0 after 00:00:01.015s
[p64143] Removing C:\WINNT\temp\autoit-v3-setup.exe
        1 file(s) copied.

BeyondExec V2.05 - Spawn Remote Processes on Windows NT/2000/XP WorkStations.
Copyright(C) 2002-2003 Craig.Peacock@beyondlogic.org
[p64143] Establishing Connection . . .
[p64143] BeyondExec service already installed on remote machine.
[p64143] Command Successfully Issued to p64143 on Pipe 1.
[p64143] Error while Starting Process. 0xC1

as you can see the first beyondexec command runs without error but the one launching the au3 script fails with an error

Any ideas or help would be once again greatly appreciated

Thankyou.

PS I know its nothing to do with my au3 script because i tried running the msgbox.au3 example and it fails too.

Share this post


Link to post
Share on other sites

Are you trying to run the .au3 script file? I doubt that will work.

Compile the script into an Executable.... Right click the AU3 and see if "Compile Script" is an option.... or look for Aut2Exe in "C:\Program Files\AutoIt3\" or in the Start Menu.....


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

God you can tell im a nooob cant you i forgot about the compile bit dooooohhhhhh so now i dont need to install autoit like i was....hehehehhee

god i bet you wonder why you people write helpfiles

cheers CyberSlug

PS i posted another prob just now....lol once i get all this sorted ill be sending all sorts using this cool tool

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  
Followers 0