Problems with UpgradeDLL and MSXML4
I have problems with the installation of msxml4 using UpgradeDLL.
This code works for MSXML3 but it fails for MSXML4.
(msxml4.dll will not be registered after this code)
:rolleyes:
!include UpgradeDLL.nsh
!ifndef MSXML_VERSION
!define MSXML_VERSION "msxml4"
!endif
!define REDIST_PATH "Redist\${MSXML_VERSION}"
!define PRODUCT_EXE "MyApp.exe"
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Section "-Install ${MSXML_VERSION}"
MessageBox MB_OK "*** Prepare setup for installing ${MSXML_VERSION} ***"
!insertmacro UpgradeDLL "${REDIST_PATH}\${MSXML_VERSION}.dll" "$SYSDIR\${MSXML_VERSION}.dll" "$SYSDIR"
#1 RegDLL "$SYSDIR\${MSXML_VERSION}.dll"
!define UPGRADEDLL_NOREGISTER
!insertmacro UpgradeDLL "${REDIST_PATH}\${MSXML_VERSION}a.dll" "$SYSDIR\${MSXML_VERSION}a.dll" "$SYSDIR"
!insertmacro UpgradeDLL "${REDIST_PATH}\${MSXML_VERSION}r.dll" "$SYSDIR\${MSXML_VERSION}r.dll" "$SYSDIR"
!undef UPGRADEDLL_NOREGISTER
; Only increase DLL count on new installation
IfFileExists $INSTDIR\${PRODUCT_EXE} skipAddSharedDLL
Push $SYSDIR\${MSXML_VERSION}.dll
Call AddSharedDLL
Push $SYSDIR\${MSXML_VERSION}a.dll
Call AddSharedDLL
Push $SYSDIR\${MSXML_VERSION}r.dll
Call AddSharedDLL
skipAddSharedDLL:
SectionEnd
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Section "-un.Uninstall ${MSXML_VERSION}"
Push $SYSDIR\${MSXML_VERSION}.dll
Call un.DecrementSharedDLL
Push $SYSDIR\${MSXML_VERSION}a.dll
Call un.DecrementSharedDLL
Push $SYSDIR\${MSXML_VERSION}r.dll
Call un.DecrementSharedDLL
SectionEnd
The msxml files will be copied to system32 but my app fails if it uses xml functionallity.
If I try "regsvr32.exe msxml4.dll" my app works successfully.
Uncommenting comment #1 has the same effect,
the msxml4.dll will be registered sucessfully.
What is wrong with this code?