I'm having a problem with System::Call that in some machines works ok but in other computer's it fails the call returning 'error'. Is there some kind of requisite for using this function?
The code looks like this:
Now I've tested this on a cleaned machine installed with the first version of Windows XP and though I set a correct serial number there is no validation (the value in $1 is always 'error'), then I gradually updated it, when finally installed Service Pack 2 the serial validation occured correctly.
Function wndSerial_ValidateCustom
; Serial number reading
ReadINIStr $R1 "$PLUGINSDIR\wndSerial.ini" "Field 2" "State"
ReadINIStr $R2 "$PLUGINSDIR\wndSerial.ini" "Field 3" "State"
ReadINIStr $R3 "$PLUGINSDIR\wndSerial.ini" "Field 4" "State"
ReadINIStr $R4 "$PLUGINSDIR\wndSerial.ini" "Field 5" "State"
; Call the function to validate the serial number
SetPluginUnload alwaysoff
System::Call "$PLUGINSDIR\ValidateSN::ValidateSN(t r11, t r12,t r13,t r14)i .r1"
MessageBox MB_OK "$1"
IntCmp $1 1 serial_ok serial_wrong
serial_wrong:
System::Free $1
MessageBox MB_OK|MB_ICONEXCLAMATION $(WNDSERIAL_INVALIDSN)
Abort
serial_ok:
; Continue installation
System::Free $1
SetPluginUnload manual
FunctionEnd
Does the System::Call function need the Service Pack 2 installation (does it use some funcion that was only available through the SP2)? or am I missing something in my code.
If there's the need to install SP2 could there be another way of calling an external DLL function?
Thanks for your time, best regards,
Samuel Moura