0

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.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Liverpool
  • 131
  • 7
  • 12

2 Answers2

2

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.

Community
  • 1
  • 1
Bigger
  • 1,807
  • 3
  • 18
  • 28
2

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.
foxidrive
  • 40,353
  • 10
  • 53
  • 68