Sign in to follow this  
Followers 0
Bio

Software Installation Console(My dream)

15 posts in this topic

I am working in an IT company where I install several computers everyday. All of the computers have different hardware model and different configuration and different applications installed.

I would like to use AutoIt to bring something in reality which is in my mind.

Problem description: After installing Windows, I have to install several applications which require a lot of Next, Next, select a check box, agree the license agreement, Next, Next. This is time consuming and requires manual work a lot. After applications, I need to install printers as well.

Project(my dream): I want a console/window where I will see all the applications with a check box near them.

All the applications have to be scripted so they will run unattended.

I will also see the printers with a check box near them. Once I will select all the applications user wants, and all the printers user wants, I will press a key and process will start and will install the applications and printers without me being there.

I started to play with AutoIt and went through the Tutorials from help and sucessfully finished HelloWorld, Notepad and Winzip installation.

Questions:

1-) During some software installations, I need to select a check box or choose an option from dropdown list, is it possible to implement it in installation?

2-) Could you please let me know which tutorails I need to read to be able to achieve this?

Are all these possible?

Thank you

Regards,

Bio

Share this post


Link to post
Share on other sites



Hello and welcome..

All that you want to do is possible but for someone... probably you! it's going to be a lot of hard work.

I'll point out this post to you as it's probably similar to what your trying to achieve. http://www.autoitscript.com/forum/index.php?showtopic=19771

I think that you will need to look at creating individual scripts for each installer to start with, you'll need to work out when a restart is really needed and then try and mash the whole lot together.

You'll need the help file in the installer and I suggest you download the Beta build of AutoIT as it has more features in it.

Your going to be needing WinWaitActive() and ControlClick() for most of your installer clicking, start off with one of your simpler installers and see if you can script it, people on here will help you but most of them like to see what you have tried yourself.

Hope this helps you on your way and good luck..

Chris

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Another tutorial is here: http://www.autoitscript.com/forum/index.php?showtopic=21048

Also download SciTe and check out the AutoItMacroGenerator in the extras folder. I use it alot for program installations.

Edited by Stumpii

“Give a man a script; you have helped him for today. Teach a man to script; and you will not have to hear him whine for help.”AutoIt4UE - Custom AutoIt toolbar and wordfile for UltraEdit/UEStudio users.AutoIt Graphical Debugger - A graphical debugger for AutoIt.SimMetrics COM Wrapper - Calculate string similarity.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Stumpii is right get scite and use some sort of recorder, i like to use AU3Record for simple things. Once the macro is made make sure to change all the speeds to 0 for the fastest movements.

MouseClick ( "button" [, x, y [, clicks [, speed ]]] )

MouseMove ( x, y [, speed] )

Opt("SendKeyDelay", 0) ;only need this once

Both programs are under tools in scite. Good Luck!

EDIT

If you want to look slick check out Controls in the help, if not you should use BlockInput

Edited by mikeytown2

Share this post


Link to post
Share on other sites

Also, try to rely more on keystrokes and less on mouse movements. If you keep this in mind, a lot of the individual installation routines (as you have already noticed) will consist mainly of "Send("!n")"

Best of luck,

Def

Share this post


Link to post
Share on other sites

Also, if your application setup file is in MSI (microsoft installer) format, all you usually have to do is

MSIEXEC.EXE /I "path and filename of MSI" /QB-

Its also possible to convert non-MSI format installers to msi

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Well first of all write what kinda programs you wish to install? A lot, if not all applications can be installed silently without user interaction. I created app in au3 that might some use for you (i use it in my IT Department and we're gonna implement it to other IT Departments when it's 1.0 ;p). Check .jpg if it's any use for you. Don't mind the polish language. What you can do with it is to choose one of 6 profiles that have 'diffrent apps' for diffrent users. Standard user, Advanced user or Super user (like some BOSS or so). Mobile is just VPN added.

On the right part of the screen there's option to choose "checkbox" for apps you want to install (if it's non-standard user). I haven't fully finished the app yet but i'm planning to in near future. It will have few nice things. Well anyways.. Lemme know if it's something like that you're looking for. I can give you source then although i would prefer you to wait for 1.0 version, because right now few things aren't working 100% as they should.

I would suggest you to not use "mouse movements" or "send" lines or shit like that. Like i said 90% of apps can be isntalled silently with options you want them to install. You just gotta find the right way.

Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I'm working on something like this also, with a folder structor that allows for quick adding of programs. It is still in devolopment, but from the looks of it, alot of us are working on the same thing, or have already have done it. I know there is a place to put this stuff, but it would be nice to have a place that simply listed types of apps that pointed to where you can get then without all the searching.

Edited by vollyman

Share this post


Link to post
Share on other sites

Thank you for the replies.

I spent few hours and got successed to create most of my applications as unattended. Till now, I have Microsoft Office, Visio, Project, Adobe Reader, Winzip, VPN Client, some financial applications. This is really cool. I did not work with mouse-movements but I got help from AutoItMacroGenerator021 to learn some tricks like unchecking boxes,etc...

Now I have nearly 10 applications indiviually/seperate which are executable and unattended means when you double click, it installs itself automatically.

Now what I would like to do is, I want a GUI console, where I will see the applications with a check box near them, once I will click it will start to install automatically "one after other" means one installation will finish and then the other will start(question 1)

(question 2)How can I create my own GUI console interface like you created? I appreciate any trick or tutorial.

@Madboy: I would like to have a look at your source, your GUI looks nice.

@vollyman: You GUI looks nice but I could not guess what every button does. Is there chance to have a look at the source?

@tonedeaf: Thank you for MSI tip, any recommended tool which I can use?

@Stumpii: Thank you for the Macrogeneratot, it helped me a lot.

Share this post


Link to post
Share on other sites

I discovered something called Koda Form Designer, I started to play, it is amazing :-) I just need more "professional look" for GUI.

The more I get into this, the more different questions I start to get.

Question1:

I could not find, how can set an option/rule like if you the check box is ticked/checked, do this/start this executable.

Question2: is there any way to set a rule saying that install this application, once it is finished, start installing the ther one. I do not want to set a timer because some machines are faster then the other ones, so I just need the action, not a specific time like after 5 minutes start the other but after it is finished, start the other one.

Thank you

Share this post


Link to post
Share on other sites

This is my script, it needs a applist.ini file in the same diectory, that lists the apps to install,

(this is something i threw together, sorry for any shite code)

code:

#include <GUIConstants.au3>

#include <file.au3>

Break(1)

$appdir=@ScriptDir &"\"

dim $apparray

$appfile=$appdir&"applist.ini"

if Not _FileReadToArray($appfile,$apparray) Then

MsgBox (1,"","error reading "&$appfile)

Exit

EndIf

;1-Application, 2-run if this ends in .exe it will run it, else run the function in this script (or include)

$maxline=0

$ubapp= UBound($apparray)-1

for $f = 1 to $ubapp

if not StringIsSpace($apparray[$f]) then $maxline=$maxline+1

Next

;ConsoleWrite("maxline is: "&$maxline&" limit is: "&($maxline/2)+1&" ")

dim $inf[($maxline/2)+1][3]

$i=0

$iflag=0

for $al = 1 to $ubapp

$aline=StringStripWS($apparray[$al],1)

if $aline= "" or StringLeft($aline,1)=";" then ContinueLoop

If $iflag = 0 Then

$i=$i+1

$inf[$i][1]=$aline

$iflag=1

ContinueLoop

EndIf

If $iflag = 1 Then

$inf[$i][2]=StringStripWS($aline,2)

$iflag=0

EndIf

Next

$numapps=$i

dim $con [$numapps+1]

; Create the dialogue box

$guiheight=($numapps*20)+100

GUICreate("Application Install", 250, $guiheight) ; will create a dialog box that when displayed is centered

$install = GUICtrlCreateButton("Install above", 10, $guiheight-50, 70)

$exit = GUICtrlCreateButton("Exit", 90, $guiheight-50, 50)

$updateapp= GUICtrlCreateButton("Ammend list", 150,$guiheight-50,70)

$label1 = GUICtrlCreateLabel("Please select applications to install", 10, 10)

GUISetState(@SW_SHOW) ; will display an empty dialog box

for $i=1 to $numapps

$con[$i]=GUICtrlCreateCheckbox($inf[$i][1],50,($i*20)+15)

Next

$stg = 0

$diff = 0

dim $last[$numapps+1]

While 1

$msg = GUIGetMsg()

If $msg = $exit Or $msg = $GUI_EVENT_CLOSE Then Exit

Select

Case $stg = 0

If $msg = $install Then

$cnt = 0

for $i = 1 to $numapps

if GUICtrlRead($con[$i]) = $gui_checked then

$cnt=$cnt+1

$ext=StringRight($inf[$i][2],4)

;ConsoleWrite (" ext is "&$ext&", ")

$last[$cnt]=GUICtrlCreateLabel("running", 5, ($i*20)+15)

if $ext=".exe" or $ext=".com" or $ext=".bat" Then

;ConsoleWrite(" is "& $inf[$i][2]&" ran, ")

RunWait($inf[$i][2])

Else

Call($inf[$i][2])

EndIf

GUICtrlSetData($last[$cnt],"done")

EndIf

Next

if $cnt=0 then

MsgBox(1," Error"," Please choose at least one application ",1.5)

$stg=0

EndIf

Sleep(1000)

for $i= 1 to $cnt

GUICtrlSetData($last[$i],"")

Next

EndIf

IF $msg=$updateapp Then Run("notepad.exe "&$appfile)

case $stg = 1

; any next stage is placed here!

EndSelect

WEnd

Exit

;; test app for the application

func testapp()

MsgBox(1,"test apps run", "hello")

EndFunc

an example of appinst.ini:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Appinst.ini ;;

;; ;;

;; Each application is stored on two lines, ;;

;; the first line is the title that appears ;;

;; in the installer, the second is the ;;

;; program or function that run when the app ;;

;; is selected, .exe .com or .bat are ;;

;; are treated as programs, otherwise a ;;

;; function of that name will be run ;;

;; ;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

notepad

notepad.exe

test2

notepad.exe

test3

test3

Share this post


Link to post
Share on other sites

Well Bio.. In my opinion using AutoItmacro generator is not best choice in your situation. All apps you mentioned can be installed very easly/preconfigured and automated without use of it. For example VPN Client is just one .ini file that you add 2 variables and it goes automagically. All microsoft apps can also be easly automated with use of microsoft office resource kit :o If you need help on that np i can help.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

I discovered something called Koda Form Designer, I started to play, it is amazing :-) I just need more "professional look" for GUI.

The more I get into this, the more different questions I start to get.

Question1:

I could not find, how can set an option/rule like if you the check box is ticked/checked, do this/start this executable.

Question2: is there any way to set a rule saying that install this application, once it is finished, start installing the ther one. I do not want to set a timer because some machines are faster then the other ones, so I just need the action, not a specific time like after 5 minutes start the other but after it is finished, start the other one.

Thank you

look at the help on:

1) use GUICtrlSetState

2) use RunWait

good luck

Share this post


Link to post
Share on other sites

Adobe_Acrobat\Adobe_Reader_7.0.msi -qn" --> to automagically install Adobe Reader

----

VPN CLIENT --> create oem.ini and add those lines there (won't say it needs reboot at the end but it does. And mind that if you're using instalation over LAN u should place VPN last since it disconnects for 1 sec connection.

[brand]CompanyText = CompanyName

ProductText = VPN Client

[Default]

SilentMode = 1

InstallPath = C:\Program Files\VPN Client

DefGroup = VPN Client

Reboot = 2

Microsoft Office,Visio,Project can be done with Microsoft Resource Kit (XP needs XP version, 2003 needs 2003 version of RK). You created unattended.mst file with that and then u use it like

\Advanced\Microsoft_Office2003\setup.exe TRANSFORMS=Unattended.MST /qb-"

\Advanced\Microsoft_Project2003\setup.exe TRANSFORMS=Unattended.MST /qb-"

But first you gotta do administrative instalation from it using setup.exe /a ;p But i guess you can read about it :o

\Main\Symantec_Antivirus\Symantec_AntiVirus.msi /qn RUNLIVEUPDATE=0 REBOOT=REALLYSUPPRESS"

Winzip i don't remember but probably easy to find.. as for other applications you gotta search some internet.


My little company: Evotec (PL version: Evotec)

Share this post


Link to post
Share on other sites

Mine is pretty strait forward. You follow the folder structor on adding a program. It will show up on the list in the left collum. Click on the ones you want to install, and they will show up in the right collum. If you need to run a application with admin rights, check the runas box to enter the logon ID. You can do auto logon if needed, and it will log what you install.

If you have a program that needs a key, you can add it to the apps needing keys folder, and when you select it from the left collum, you get a input box asking for a key. You will need to configure your script to look for it, but that is no biggy.

Most all options can be set in the options GUI.

I do need help in compleating it. IF anyone wants to help, you can get the current source code here:

http://www.autoitscript.com/forum/index.ph...27entry145227

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