View Full Version : Problem: Comparing CRC value
brianlesker
10-18-2004, 03:17 AM
Good morning!
I have a little problem....
Have a textfile with a CRC value in it AND my installer gets the CRC value of the installer himself.
Want to compare those value's with each other, but one is numberic and the other "characters".
How can i convert one of those value's to compare them correctly?
Brian
Brett
10-18-2004, 09:15 AM
They should work properly with normal comparison (==). The Lua engine is pretty smart about runtime type conversion.
brianlesker
10-18-2004, 09:30 AM
Doesn't work here :(
The dialog box returns same value's, so normaly he don't go in the if loop "if (strCRCPreInstaller ~= strCRCCheckPreInstaller) then"
You c the problem????? :huh
<code>
strCRCPreInstaller = File.GetCRC(_SourceFolder.."\\UserPreInst"..strAppVer..".exe");
-- CRC waarde uit file lezen
tableCRCCheckPreInstaller = TextFile.ReadToTable(_SourceFolder.."\\UserPreInst"..strAppVer..".txt"); -- Tekstfile inlezen in een table
strCRCCheckPreInstaller = tableCRCCheckPreInstaller[1]; -- Regel 1 in variabele zetten
if (strCRCPreInstaller ~= strCRCCheckPreInstaller) then
result = Dialog.Message("Debug", strCRCPreInstaller..".\n"..strCRCCheckPreInstaller..".", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
result = Dialog.Message("Waarschuwing", "CRC doesnt match", MB_OK, MB_ICONSTOP, MB_DEFBUTTON1);
Application.Exit(PreInstInvalidCRCCheck);
end
</code>
Darryl
10-18-2004, 09:58 AM
Take a look at the "String.ToNumber" action. That should allow you to compare the two numbers.
Hope that helps.
Darryl
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.