So I've had a quick look over the script, and there doesn't appear to be anything wrong with it. You haven't said what version you're using so I'll try to be as generic as possible.
I would be pointing my finger at this (try commenting it out and testing if $instdir changes):
Section "Pro" SEC01
SetOverwrite ifnewer
!include "InstallSections\InstallProfiles.nsh"
SectionEnd
;
Section "ProQcm" SEC02
SetOverwrite ifnewer
!include "InstallSections\InstallProQcmfiles.nsh"
SectionEnd
Also, why is a section calling page funtions?
Section "Database" SEC03
IfSilent sqlTL sqlPL
sqlTL:
call SqlPageTmpLeave
call SqlPageLeave
Goto sqlend
sqlPL:
call SqlPageLeave
Goto sqlend
sqlend:
SectionEnd
One or two other things:
This $instloc code doesn't do anything because the code in between doesn't modify $instdir.
StrCpy $INSTLOC $INSTDIR
; capture the details Write to registry
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Data Source" "$R1"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "initial catalog" "$R2"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "User ID" "$R3"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Password" "$R4"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "WebServiceURL" "$R5"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "ClientName" "$R6"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Data Source" "$R1"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "initial catalog" "$R2"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "User ID" "$R3"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Password" "$R4"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "WebServiceURL" "$R5"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "ClientName" "$R6"
StrCpy $INSTDIR $INSTLOC
This StrCpy doesn't have it's opposite in this code block. $instdir isn't modified in this codeblock, so it can be removed. In fact, $instloc appears to do nothing in this script, so I would remove it.
sqlnorm1:
${NSD_GetText} $txtServer $R1
${NSD_GetText} $txtDatabase $R2
StrCpy $INSTDIR $INSTLOC
${NSD_GetText} $txtUsername $R3
${NSD_GetText} $pwdPassword $R4
Also this is irrelevent, you only need the second one.
SetOutPath "$INSTDIR\_${PRODUCT_VERSION}_bkp\Database"
SetOutPath "$INSTDIR\_${PRODUCT_VERSION}_bkp\Database\Common"
Unless you're using a really old NSIS version, this should be "MUI2.nsh":
; MUI 1.67 compatible ------
!include "MUI.nsh"
And this can be removed since you're not using InstallOptions:
; Reserve files
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
This script only has three sections, so I don't know why there is a SectionGroup here?
; Installation features
SectionGroup "MainSection" GRP_1
;
...
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${GRP_1} ""
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Also, I don't know what this is about
:
; Finish page
!insertmacro MUI_PAGE_FINISH
;page custom SqlPageLeave
But the better way to do it is:
; Finish page
;!define MUI_PAGE_CUSTOMFUNCTION_LEAVE SqlPageLeave
!insertmacro MUI_PAGE_FINISH