I am working on product testing automation. I just want to ask is there anyway to check that product has installed successfully by using Batch script?
I am using Win7 64-bit.
I am working on product testing automation. I just want to ask is there anyway to check that product has installed successfully by using Batch script?
I am using Win7 64-bit.
It depends on the way your product installs. Your check script could check for the existence of files:
IF EXIST filename (
REM Do one thing
) ELSE (
REM Do another thing
)
(from How to check if a file exists from inside a batch file)
You could also check for registry keys, for example:
REG QUERY HKLM\Software\Microsoft\Office
will output something like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\12.0
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Excel
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\MS Project
HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook
depending on what's installed on your computer.
(from Reading child registry key from regedit in batch file)
There are numbers of options, it's better if you can modify/work with the internals of your the installer to know what to check for.
See if your installer returns an errorlevel. Errorlevel zero is generally an indicator of success
@echo off
setup.exe /switches
if not errorlevel 1 echo installation succeeded.