I'm experiencing a strange behaviour of GettDLLVersion on Windows Server 2003/Windows XP 64bit versions.
My installer installs network drivers according the OS found.
Before installing I test if I have to perform an update/repair or if the driver on the system is newer.
I do this by comparing the version numbers of the driver in the installer and on the system.
The driver to be installed is written to $APPDATA\TMP and its version is retrieved vie GetDLLVersion. Then i try to get the version from "$SYSDIR\drivers\$DriverName" also via GetDLLVersion.
This works on all OSes from W2K ...Vista64 except for W2K3 Server 64bit and XP 64 bit. On these OSes the returned value is always empty.
Even putting a ClearError before the call doesn't help.
In a very much stripped-down version of the installer GetDLLVersion works as expected.
in my .oninit function i have:
I can check the driver.sys file's version using properties|version but $R0 and $R1 are always undef after GetDllVersion...
Check OS
Check for AdminAccount
Unpack driver.sys file to $AppData\TMP setting $SysName to driver.sys
GetDllVersion "$TMPDIR\$SysName" $R0 $R1
IntOp $R6 $R0 / 0x00010000
IntOp $R7 $R0 & 0x0000FFFF
IntOp $R8 $R1 / 0x00010000
IntOp $R9 $R1 & 0x0000FFFF
StrCpy $DriverVersion "$R6.$R7.$R8.$R9"
(this one works fine)
Check for installed version of the driver package in the registry
Open a log file
and then
MessageBox MB_ICONINFORMATION|MB_OK "Looking for $SYSDIR\drivers\$SysName"
ClearErrors
GetDllVersion "$SYSDIR\drivers\$SysName" $R0 $R1
MessageBox MB_ICONINFORMATION|MB_OK "Version ($SYSDIR\drivers\$SysName) = $R0 $R1"
(this one always fails on W2k3Srv/XP 64bit)
:
:
Any hints??