Hi,
I'm having a problem trying to see if two variables are equal, I've googled and searched the forum. I know that using % around the variable will use the value, since If var, value is the correct method of writing a statement. I read 0.0.2 from conf.ini file and checks it with update.ini
I'm trying to check if there's a newer version of some files available, this is checked in two IF-statements. But eventhough it's up-to-date and it tries to check if 0.0.2 equals 0.0.2 it continues to update the files?
Code:
updatecheck:
UrlDownloadToFile, http://www.XXXXXX.com/update/update.ini, update.ini
IniRead, tempupdateversion, update.ini, updatecheck, updateversion
updateversion = tempupdateversion
version = tempversion
If version = updateversion && ErrorLevel = 0
{
SB_SetText("Build " . %version%)
SB_SetIcon("updated.ico")
}
else if updateversion != version && ErrorLevel = 0
{
SB_SetIcon("warning.ico")
SB_SetText("Updating to " . %updateversion%)
TrayTip, Program, Updating, 10, 1
Sleep 4000
Gosub, update
}
return
update:
IniRead, tempupdateversion, update.ini, updatecheck, updateversion
updateversion = %tempupdateversion%
version = %tempversion%
IniRead, currentProgramURL, conf.ini, Configuration, ProgramURL
IniRead, updateProgramURL, update.ini, update, Program
IniRead, updateConfURL, update.ini, update, Conf
UrlDownloadToFile, updateProgramURL, TankBot.exe
UrlDownloadToFile, updateConfURL, conf.ini
iniWrite, %currentProgramURL%, conf.ini, Configuration, ProgramURL
iniWrite, %updateversion%, conf.ini, Configuration, version
SB_SetText("Build " . updateversion)
SB_SetIcon("updated.ico")
The code is pretty dirty after all the debugging and fixing - I hope you can help me out here.
Thanks in advance,
C