ricktendo

Using AutoIt for silent install

63 posts in this topic

hi all , i am making this little guide to help making autoit scripts , to avoid the troubles of finding switches and so on .....

==============================================

here we go .....

=============================================

-----------------------

what is an Autoit Script

------------------------

it is a simple script , made to do jobs automatically , u write down the script (the script is mainly a robot that will tell the system what to do ) , then compile it , the resulting exe will do what u specifed in the code each time the program runs,

----------------------------

What is the relation between Auto it and silent install:

---------------------------

simply , u wil make the installation go smoothly , without ur interaction , the script u make will do the job ..... u may see examples in this topic :

http://www.msfn.org/board/index.php?showtopic=20197

---------------------

OHH dear , shall i write scripts and think of coding

----------------------

Answer is , NO , u will see in this guide , how will we make scripts for silent installs without writing code.

------------------------

Why and when shall i use autoit for silent install ?

------------------------

when u don't find the silent switch u need , u are pushed to use the autoit method ..

==============NOW LET US GOOO!!!!================

firstly we need the program ,,, get it here

http://www.autoitscript.com/cgi-bin/getfil...it-v3-setup.exe

and we need the Scite tool , to use the script recorder::

Scite

---------

http://www.autoitscript.com/cgi-bin/getfil...iTe4AutoIt3.exe

install both programs ,,,

now go to :

Start >>programs>>autoit V3>>scite>>Script Writer

u will see this :

post-29-1186075177_thumb.png

1- select the installation package which u r going to make the script for , it shall be an EXE which the script will call each time it runs ..........

2- make the check boxes , as made in the pic

3- click the "A" button

once we click the "A" button,the exe(which is the installation package) we specifed will run, and every movement we make on our pc using the keyboard will be recorded,

During the record of this code , Take care of :

1-Avoid Alt+tab, or navigating to othr windows

2- use " Alt+N" to choose "next" ، Alt+y to choose " Yes" , and so on ..

3- u may use the Tab button to navigate between buttons

After u completly installed the application , we have to stop the record operation by clicking the "A" button at the upper left of the screen , now u must see some code written like this ....

post-29-1186075155_thumb.png

Now , we have to add little code to our app , to avoid hassles , and running same application again and again

-------------------------------------

$SF_1 = "app.exe"

If WinExists ( $SF_1 ) Then Exit

AutoItWinSetTitle ( $SF_1)

---------------------------------------

** u may ask , what is this attented for , the answer is , this code is just a safety measure during the testing period , i once used a script which don't have this code (or similiar) and a big trouble occourded , the compiled EXE kept running it self again and again , and at last , 101 process where running on my poor pc :no: , i used taskkill to

get rid of those processes and i succeded :thumbup

---------------------------------

replace app.exe by the installation package exe u selected when recording the script, now save the file near by ur EXE package as u see in the pic , then compile the script ....

post-29-1186075406_thumb.png

NOW all is done we have the compiled EXE , try running it now , u will see every thing in the setup going automatically

without ur interaction , once u test and find every thing working good , u may make a RARsfx which will have the compiled EXE to run after the extraction process

I found this useful when I cant find any silent switches for my installers :thumb_yello:

Share this post


Link to post
Share on other sites

The pics aren't showing up, unfortunately...

(I'd like to use this!)

Share this post


Link to post
Share on other sites

A great tutorial ricktendo64, but I'm having a little bit of trouble, when Autoit is recording the install at the end

it has finish that you would normally click, I have tried Alt+F with no luck but if I hit Enter, the program

box disappears, but when I compile the script and run the .exe autoit created, everything goes well until the end, the

program dialog box doesn't close.

I was wondering have you got any ideas??

Share this post


Link to post
Share on other sites

Is there a guide for making the RARsfx ? So it installs automatically when I click it without having to hit install button?

Share this post


Link to post
Share on other sites
Is there a guide for making the RARsfx ? So it installs automatically when I click it without having to hit install button?
In the advanced SFX options there is a setting

hidexa3.jpg

Run your installer silently add the switch

runli1.jpg

Or you can add it manually like this in the comment section

;The comment below contains SFX script commands

Setup=Program.exe /S
Silent=1
Overwrite=1

Edit: You may wanna check extract to temp folder also

Share this post


Link to post
Share on other sites

cool thanks Rick, just tried it worked perfect

Edited by dkrus

Share this post


Link to post
Share on other sites

Hi ricktendo64

Very Good Guide.

I made a silent install of irfanview410 as a Test and everything go right, by following this excellent guide.

But now i have a problem i dont know how to resolve, and i ask for your help...

I compiled the au3 file to "exe" file.

How do i now make a cab file from this "exe" file to put in nlite addons?

Can anyone help please?

I'm new in those things...

Thanks in advanced...Sorry about my poor english...

Share this post


Link to post
Share on other sites

hi Kelsenellenelvian!

Thanks for your help...

Just only more one question...

when i finished instaling the programm Irfarview410.exe and i recorded with Autoit ScriptWritter last window terminated with a "Finish".

Ok, after instalation, If i want to copy a dll file to the instalation folder of the aplication how did i proceed in the au3 file?

can you help...

ths...

Share this post


Link to post
Share on other sites

hi Kelsenellenelvian!

I made a silent install for iview410.exe.

I added it to nlite addons, hotfixes etc.

Made iso file

And run Virtual Pc 2004.

But the program was not installed.

What can be wrong?

Can you help...I send the addon to be analised...

Here is the ini:

[general]

BuildDate = 7 Janeiro de 2008

Description = IView 4.10

Language = English

Title = Irfan View 4.10

Version = 4.10

Website =

[EditFile]

I386\SVCPACK.INF,SetupHotfixesToRun,AddProgram

[AddProgram]

Irfan.exe /S

And here the script:

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode",4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

$SF_1 = "iview410_setup.exe"

If WinExists ( $SF_1 ) Then Exit

AutoItWinSetTitle ( $SF_1)

Run('E:\incoming\nlite_guide\irfan\iview410_setup.exe')

WinWait("IrfanView Setup","Create IrfanView sho")

If Not WinActive("IrfanView Setup","Create IrfanView sho") Then WinActivate("IrfanView Setup","Create IrfanView sho")

WinWaitActive("IrfanView Setup","Create IrfanView sho")

Send("{ALTDOWN}n{ALTUP}")

WinWait("IrfanView Setup","What's new in this v")

If Not WinActive("IrfanView Setup","What's new in this v") Then WinActivate("IrfanView Setup","What's new in this v")

WinWaitActive("IrfanView Setup","What's new in this v")

Send("{ALTDOWN}n{ALTUP}")

WinWait("IrfanView Setup","Do you want to assoc")

If Not WinActive("IrfanView Setup","Do you want to assoc") Then WinActivate("IrfanView Setup","Do you want to assoc")

WinWaitActive("IrfanView Setup","Do you want to assoc")

Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ALTDOWN}n{ALTUP}")

WinWait("IrfanView Setup","* Instantly find you")

If Not WinActive("IrfanView Setup","* Instantly find you") Then WinActivate("IrfanView Setup","* Instantly find you")

WinWaitActive("IrfanView Setup","* Instantly find you")

Send("{SHIFTDOWN}{SPACE}{SHIFTUP}{TAB}{SHIFTDOWN}{SPACE}{SHIFTUP}{TAB}{TAB}{ALTDO

WN}n{ALTUP}")

WinWait("IrfanView Setup","Press the ""Next"" but")

If Not WinActive("IrfanView Setup","Press the ""Next"" but") Then WinActivate("IrfanView Setup","Press the ""Next"" but")

WinWaitActive("IrfanView Setup","Press the ""Next"" but")

Send("{ALTDOWN}n{ALTUP}")

WinWait("IrfanView Setup","Open IrfanView &FAQs")

If Not WinActive("IrfanView Setup","Open IrfanView &FAQs") Then WinActivate("IrfanView Setup","Open IrfanView &FAQs")

WinWaitActive("IrfanView Setup","Open IrfanView &FAQs")

Send("{SHIFTDOWN}{SPACE}{SHIFTUP}{ALTDOWN}d{ALTUP}")

WinWait("IrfanView Frequently Asked Questions - Windows Internet Explorer","Favorites Command Ba")

If Not WinActive("IrfanView Frequently Asked Questions - Windows Internet Explorer","Favorites Command Ba") Then WinActivate("IrfanView Frequently Asked Questions - Windows Internet Explorer","Favorites Command Ba")

WinWaitActive("IrfanView Frequently Asked Questions - Windows Internet Explorer","Favorites Command Ba")

Send("{ALTDOWN}{F4}{ALTUP}")

Thanks for your help...

Share this post


Link to post
Share on other sites

Change this

Run('E:\incoming\nlite_guide\irfan\iview410_setup.exe')

to this

Run('iview410_setup.exe')

Share this post


Link to post
Share on other sites

HI Sm0k3r!

thanks for your help...

Another problem i had ..is that i also add RVMUPDATEPACK2.1.11.7z in nlite addons and

Programaddons_Adobe_Reader_8.1.1.cab.

Only adobe 8.1.1 succeed to instal.

RVMUPDATEPACK did'nt succeed...

I don't Know why not...

Can you give me a help...

ths...

Share this post


Link to post
Share on other sites

How do you know it didn't install? Its not supposed to have a glaring banner or anything...

Share this post


Link to post
Share on other sites

hi Kelsenellenelvian!

I think it not installed because i went to windows folder and i thought the updates were there...

i did not see anything there...

perhaps i made a confusion...

if it is normal how do we know that run ok?

where can we go to see that them were installed ok?

sorry about this but i am realy confused...

Share this post


Link to post
Share on other sites
HI Sm0k3r!

thanks for your help...

Another problem i had ..is that i also add RVMUPDATEPACK2.1.11.7z in nlite addons and

Programaddons_Adobe_Reader_8.1.1.cab.

Only adobe 8.1.1 succeed to instal.

RVMUPDATEPACK did'nt succeed...

I don't Know why not...

Can you give me a help...

ths...

RVMUPDATEPACK2.1.11.7z isn't nlite addons, you must use RVM integrator to add it.

after integrate RVMUPDATEPACK2.1.11.7z to your windows directory, you can use nlite to add programs, then make an iso

Edited by chaox2

Share this post


Link to post
Share on other sites

hi everybody..

Can anyone tell me where i can download Universal silent switch installer?

Ths in advance...

Share this post


Link to post
Share on other sites

What would be the path to have script run exe from

source cd?

$INSTALLLOCATION =

In case it's drive E instead of D, sorry I'm a newb at this :D

Share this post


Link to post
Share on other sites
I found this useful when I cant find any silent switches for my installers :thumb_yello:

$SF_1 = "app.exe"

If WinExists ( $SF_1 ) Then Exit

AutoItWinSetTitle ( $SF_1)

is this added after the script or before

Share this post


Link to post
Share on other sites

I don't think it matters where you put it, its just a variable. But put it at the begging

Share this post


Link to post
Share on other sites

after i finish this script and i get the execute script file,so how can i do for this to make cab nlite addon ?Its that just put the execute script file and the installation file together and make the cab file. At the ini file call the execute script file?can show me the step please

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