I need to be able to run this batch fine on both x86 and x64 machines to check if a program has been installed correctly .
We have an app that installs in x86 in the standard program files directory, and when installed in x64 it installs in the x86 program files directory.
Currently it reports false
, displays the echo that the app is installed and the echo that the app is not installed when run on x86 and x64.
if /i "%processor_architecture%"=="x86" GOTO X86DC
if /i "%processor_architecture%"=="X64" GOTO X64DC
:X86DC
if exist "C:\Program Files\installeddir\app.exe" ( echo ***App is Installed Successfully*** )
if not exist "C:\Program Files\installeddir\app.exe" ( echo ***App is not installed *** )
:X64DC
if exist "C:\Program Files(x86)\installeddir\app.exe" ( echo ***App is Installed Successfully*** )
if not exist "C:\Program Files(x86)\installeddir\app.exe" ( echo ***App is not installed*** )