@echo off

set hasExists=0

reg query HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Caroonsoft\sirPos\1.0 >nul
if %errorlevel% equ 0 (
  set hasExists=1
  reg export HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Caroonsoft\sirPos\1.0 C:\tmp\export32.reg /y
)

START /WAIT setup.exe

if %hasExists%==1 (
  regedit.exe /s "C:\tmp\export32.reg"
  DEL "C:\tmp\export32.reg"
)