0
votes

I would like to check the current version of Muvizu in the registery and then if it equals the latest version don't do anything if not install a new version. I would like this to run from batch.

I have looked at some websites such as this one :

http://www.msfn.org/board/topic/113643-batch-file-that-check-version-in-registry/

but I'm struggling to adapt the code and get it working.

The register setting that needs to be queried is : HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Muvizu and the node is DisplayValue and the value of the latest version is 2013.10.25.01R

so essentially I need some wizzy batch code that will do the following:

Check regkey, if regkey display version = 2013.10.25.01r, do nothing, else, run installer

2

2 Answers

1
votes

Something like this should work as you have described.

reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Muvizu" |find /i "2013.10.25.01R" >nul || installer.exe
1
votes

Something like this should do it:

@echo off
setlocal

set regkey="HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Muvizu" /v DisplayValue
for /f "tokens=3 delims= " %%a in ('reg query %regkey%^|Find "DisplayValue"') do (
  if errorlevel 1 ( 
     REM Run installer
     goto :eof   
  )
  if "%%a" NEQ "2013.10.25.01r" (
    REM Run installer
  ) ELSE (
    Echo You have the most recent version of Muvizu
  )
)