Jump to content

simple question


 Share

Recommended Posts

Been following autoit for a while, but only just decided to dabble, hope to use it to automate some process's of a PC Roll out,

simple question, a script works and runs all the steps if i run the .au3 file, but if i compile it and run it, it dosent do all the mouse clicks, its a realy simple script to automate the install of remote desktop software.

Run("RADMIN22.EXE")

WinWaitActive("Remote Administrator v2.2")

ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)

ControlClick ( "Remote Administrator v2.2", "I &agree with the above terms and conditions", 1027)

ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)

ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)

ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)

thats all it is so far, if i run the .au3 it does all steps, if i compile and run the exe it dosent do the last controlclick it looks like. any ideas ?

does the control number change? the 1008 ? because it does the first few clicks fine

Edited by tachi
Link to comment
Share on other sites

Your using Control*() functions which does not need activated windows, so just use WinWait(). It is not good how the window text is the same all the way through. Just added some WinWait() functions and added a Sleep(). If the script is in the same directory as the script, you should consider using the @ScriptDir macro to set the fullpath to the installer. Not sure if the Sleep() will help but without known how the installer operates, then I can only try.

With mentioned changes done

Run("RADMIN22.EXE")
WinWait("Remote Administrator v2.2")
ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)
WinWait("Remote Administrator v2.2")
ControlClick ( "Remote Administrator v2.2", "I &agree with the above terms and conditions", 1027)
ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)
WinWait("Remote Administrator v2.2")
ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)
Sleep(1000)
WinWait("Remote Administrator v2.2")
ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)

:whistle:

Link to comment
Share on other sites

thanks for ya help, but funnily enough it started working all of a sudden, and now it works fine, all the way through with my origional code, but i will put in your changes

on a side note, as i am new to autoit, how do i go about merging the RADMIN22.EXE into the autoit script and compiling, so i have a single .exe which i just double click, this runs the RADMIN22.EXE with the script all the way through?

i found the FileInstall ( "source", "dest" [, flag] ) documentation, but ime not quite sure how to implement it, so its a single exe file

Edited by tachi
Link to comment
Share on other sites

Just use FileInstall

If FileInstall("RADMIN22.EXE", @ScriptDir & "\RADMIN22.EXE") Then
    $pid = Run(@ScriptDir & "\RADMIN22.EXE")
    WinWait("Remote Administrator v2.2")
    ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)
    WinWait("Remote Administrator v2.2")
    ControlClick ( "Remote Administrator v2.2", "I &agree with the above terms and conditions", 1027)
    ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)
    WinWait("Remote Administrator v2.2")
    ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)
    Sleep(1000)
    WinWait("Remote Administrator v2.2")
    ControlClick ( "Remote Administrator v2.2", "&Next >", 1008)
    ProcessWaitClose($pid)
EndIf

Have "RADMIN22.EXE" in the same directory as the script when compiling.

:whistle:

Edited by MHz
Link to comment
Share on other sites

works perfect, thanks !

Ive added a delete file at the end to delete the extracted file, i thought it like ran the file from within the compiled exe but it extracts it, so to clean up it deletes it.

after the install it asks for a reboot, it there anyway to like continue the automated proccedure after a restart, maybie compile into the main exe another exe that gets put in startup and detetes its self after it has run through once - after the restart the radmin pops up and asks for final confiruration, which is what i want to automate

Link to comment
Share on other sites

Depending where in the registry key that this program runs from with the restart. If it starts from HKLM\...\RunOnce then it would be differcult as you would have to delete the value before reboot and insert your script to replace it with a switch to start and set the script to run the installer again. If HKCU\...\RunOnce then you can set your install with a switch and automate the installer as HKCU\...\RunOnce does not wait for end of execution.

Understand?

I have done it a couple of scripts.

Link to comment
Share on other sites

well is there any reason why i cant just extract an exe to startup that does the following:

waits for the setup window to popup again, or if the window is already up when the script is called, then just starts, goes through the rest of the setup, and then deletes itsself from startup?

also i cant get Run("RADMIN22.EXE","",@SW_HIDE) to work, it is still running nice and visible and full screen?

Link to comment
Share on other sites

well is there any reason why i cant just extract an exe to startup that does the following:

waits for the setup window to popup again, or if the window is already up when the script is called, then just starts, goes through the rest of the setup, and then deletes itsself from startup?

also i cant get Run("RADMIN22.EXE","",@SW_HIDE) to work, it is still running nice and visible and full screen?

Depends on what is entered into registry by the installer. For your script to wait, the following applies. If it restarts from HKLM then no, if from HKCU, then yes. At HKLM, the system will wait until the installer has finished, but your exe will be after or before with the system waiting for completion of it also.

Best chance of hiding the installer is using WinMove and move it off screen. WinSetState normally only works for each window instance, so you have to keep calling it.

Edit:

Link removed.

Edited by MHz
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...