Function FuncUpgrade ReadRegDWORD $R0 HKLM "Software\HT\RCS" "installed" ; RCS is not installed IntCmp $R0 1 +2 0 0 Abort StrCpy $upgradeComponents "" ; check which components we have ReadRegDWORD $R0 HKLM "Software\HT\RCS" "collector" IntCmp $R0 1 0 +4 +4 StrCpy $upgradeComponents "$upgradeComponentsCollector$\r" Push ${BST_CHECKED} Pop $installCollector ReadRegDWORD $R0 HKLM "Software\HT\RCS" "master" IntCmp $R0 1 0 +4 +4 StrCpy $upgradeComponents "$upgradeComponentsMaster$\r" Push ${BST_CHECKED} Pop $installMaster ReadRegDWORD $R0 HKLM "Software\HT\RCS" "shard" IntCmp $R0 1 0 +4 +4 StrCpy $upgradeComponents "$upgradeComponentsShard$\r" Push ${BST_CHECKED} Pop $installShard !insertmacro MUI_HEADER_TEXT "Installation Type" "Upgrade" nsDialogs::Create /NOUNLOAD 1018 CreateFont $R1 "Arial" "8" "600" ${NSD_CreateLabel} 0 5u 100% 20u "The setup has detected that at least one RCS component is installed on this machine." ${NSD_CreateLabel} 0 25u 100% 20u "If you continue the following components will be upgraded:" ${NSD_CreateLabel} 20u 40u 100% 50u $upgradeComponents Pop $1 SendMessage $1 ${WM_SETFONT} $R1 0 ${NSD_CreateCheckBox} 20u 100u 200u 12u "YES, Upgrade." Pop $1 SendMessage $1 ${WM_SETFONT} $R1 0 nsDialogs::Show FunctionEnd Function FuncUpgradeLeave ${NSD_GetState} $1 $installUPGRADE ${If} $installUPGRADE != ${BST_CHECKED} MessageBox MB_OK|MB_ICONSTOP "Please check the upgrade option. If you don't want to upgrade exit the installer now." Abort ${EndIf} SetCurInstType 1 FunctionEnd .