Sign in to follow this  
Followers 0
slickvim

Verify the success of an installation.

7 posts in this topic

Hi there,

I have to program using Autoit an installation process. I would like to know if there is a way to validate if an installation has been successful or not. Either by verifying the existence of the directories or files installed or by some other ways. Sorry if my question sounds newbie. It's just because i am one. :)

Thank You!

Share this post


Link to post
Share on other sites



Hi there,

I have to program using Autoit an installation process. I would like to know if there is a way to validate if an installation has been successful or not. Either by verifying the existence of the directories or files installed or by some other ways. Sorry if my question sounds newbie. It's just because i am one. :)

Thank You!

Well the command for checking if a file exists is called "FileExists".

If you know of a file that will exist after the install is complete, but won't if it didn't, then you could pretty well do an If...Then statement checking if that FileExists and know for sure. :)

Share this post


Link to post
Share on other sites

That's good. But suppose i have like a big amount of files and directories. Is there a better way to see if all the files has been successfully installed?

Share this post


Link to post
Share on other sites

That's good. But suppose i have like a big amount of files and directories. Is there a better way to see if all the files has been successfully installed?

Assuming you're using AutoIt to automate the installation of another program, you could always check for a "Installation Complete" type of screen that usually is the last screen of a program install... Otherwise you're kind of stuck with checking for byproducts of the installation (existence of files, registry keys, etc.) with a whole lot of FileExists. (Maybe chunk them out to their own function?)

If it's your own install type thing, you could check return codes for the FileCopy commands you'd be running. :)

Share this post


Link to post
Share on other sites

Also if you are required to check the existence of the files, then you may want to look into FileFindFirstFile() & FileFindNextFile(). Also if you put all your files into an array, you could do an array search based on the files that you find using the above FileFind*() functions. You can fail on the first file that doesn't exist unless it is an optional file. Use the function DirExists to check the existence of directories, or you can also use FileFind*() functions along with FileGetAttrib().

I hope this helps some,

Jarvis


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Assuming you're using AutoIt to automate the installation of another program, you could always check for a "Installation Complete" type of screen that usually is the last screen of a program install...

Well there is a proggy called SFXTool (i think it's even free) thats a really simple installation creator that lets you add/remove whatever dialog boxes you choose. So one could remove everything but say the 'installation complete' dialog. But if he used this method, wouldn't it be basically like "double displaying" the same information? Because the installer is verifying that all is error free, then all autoit would be doing is executing the installer, followed by verifying if a dialog box is displayed on screen which obviously, will be on the screen already.

I'd say it really depends on how exactly you are installing these files, if you are writing the entire installation into an autoit script, without any outside programs doing any of the installation, you could simply set error flags and display a msgbox if any flags go up.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

If you launch the main installer from within your script (runWait or runAsWait), it will return the error code of the installer. Usually an error code of 0 means that the install was successful.

I have in the past used this logic.

Run("helper script that uses control click to do install")

$var = RunWait("real program")

If $var <> 0 Then

Msgbox(0,"","The install Failed")

Endif

Edit: Missed a ")" and it was bugging me.

Edited by Prab

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