Jump to content

A little bit of help needed


Recommended Posts

Hi Guys, i'm new to AutoIT muttley , i'm still in the learning process, im trying to implement more automation to my daily IT work .

i want to say that im not a programmer and im just playing with it learning it as i'm going trough.

as you can see i'm trying to automate software to install automatically.

i have many questions, but for now ill ask some:

1.how to get rid of the "Open File - Security Warning" that windows open me? ruins my script it just stop work after this, i cant seem to automate it.

2.i dont know if i did good at the first part of the script and the 2nd part also lol , i dont know when to use the '&' when control click.

it worked, but after many tries, if you have any better suggestion please let me know.

3.how to proper use of the winwait ,winactive, all of those windows commands.

4.how to implement that after a completion the script if it succeeded or not , it will generate a log or write it into a file so ill know what has been installed and if any errors.

5.if i want to build many scripts and put them inside 1, major 1 that will hold them all , the code will be one after the other or is there other design to it?

6.how to close a or explorer window or any window that pops up after installtion?

thats it for now , i will be sure to have more questions but ill save em for other time

i appreciate any help given.

thank you,

; CUTEPDF
Run("\\software\CutePDF\CuteWriter.exe")
WinWait("CutePDF Writer 2.6 (x64)")
ControlClick("CutePDF Writer 2.6 (x64)","","OK")
winwait("CutePDF Writer Setup","Yes")
ControlClick("CutePDF Writer Setup","","&Yes")
winwait("Software License Agreement","Yes")
controlclick("Software License Agreement","","&Yes")
Winwait("CutePDF Writer Setup", "To create PDF document", "OK")
ControlClick("CutePDF Writer Setup","","OK")
SplashTextOn("cutepdf", "CutePDF Automated Installation Complete", 200, 100, -1, -1, 4, "",10)
Sleep(2000)
SplashOff()
run("\\software\CutePDF\converter.exe")
if WinExists("Open File - Security Warning") then
    ;WinActivate("Open File - Security Warning")
    ControlClick("Open File - Security Warning","","RUN")
    WinWait("WinZip Self-Extractor - converter.exe","Setup")
    ControlClick("WinZip Self-Extractor - converter.exe","","Setup")
    else
    ;WinExists("WinZip Self-Extractor - converter.exe","Setup")
    WinActivate("Open File - Security Warning")
    ControlClick("WinZip Self-Extractor - converter.exe","","Setup")
endif

in the 2nd part nothing worked , i just dont know how to use the ifs and else properly i did by logic hehe

dont mind the ; ; ; its just me playing with it to see if it works without it.

sorry about my english :) .

Edited by wolff68
Link to comment
Share on other sites

I'll start with just one

2.i dont know if i did good at the first part of the script and the 2nd part also lol , i dont know when to use the '&' when control click.

it worked, but after many tries, if you have any better suggestion please let me know.

What do you want to use the & for? You will need to move it out of the string to begin with. For example, if you wanted to concatenate a variable and a string you would use: $var & "Text"

If you want the & to be a part of the string you would need to use Chr(38)

I'd suggest playing around with the Autoit Window Info tool to get control info for the buttons you need to click.

Oh, and as for the log, take a look at _FileCreate. But you'll need to use variables for it to be worthwhile.

Link to comment
Share on other sites

1.how to get rid of the "Open File - Security Warning" that windows open me? ruins my script it just stop work after this, i cant seem to automate it.

While 1
    If WinExists("Open File - Security Warning") Then Send("^y"); or something to click yes
    Sleep(75)
WEnd
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...