jackyyll Posted March 2, 2006 Share Posted March 2, 2006 (edited) Hi, im working on an autoupdater for my program... And when i run it, nothing happens Heres my code: Program Itself(MAMBoT.exe): Local $verini = 'http://acguild.ampedhost.com/bot/ver/ver.ini' Local $ping = ping ('www.google.com', 250) Select Case $ping = 0 $msg1 = MsgBox(1, "Error", "No internet connection detected. Close program now?") If $msg1 = 1 Then Exit EndIf Case $ping = 1 InetGet($verini, "\Data\ver.ini", 1) If IniRead(@ScriptDir & '\Data\ver.ini','Version','FileVer','Not Found') > IniRead(@ScriptDir & '\Data\version.ini','Version','FileVer','Not Found') Then SplashOff() SplashTextOn("MAMBoT", "A newer version has been found and is updating! Please wait, the program will now restart...") Sleep(2500) SplashOff() Run ('update.exe', @ScriptDir) Exit Else FileDelete(@ScriptDir & '\Data\temp.ini') EndIf EndSelect Updater(update.exe): ProcessClose("MAMBoT.exe") $newestver = IniRead(@ScriptDir '\Data\ver.ini','Version','FileVer','Not Found') $website = 'http://acguild.ampedhost.com/bot/' & $newestver & '/MAMBoT.exe' If FileExists(@ScriptDir & '\MAMBoT.exe') Then FileDelete(@ScriptDir & '\MAMBoT.exe') Else Sleep(10) INetGet($website, "MAMBoT.exe", 1) IniWrite(@ScriptDir & '\Data\version.ini','Version','FileVer', $newestver) FileDelete(@ScriptDir & '\Data\ver.ini') Sleep(10) SplashTextOn("MAMBoT Updater", "Successfully updated to the latest version." Sleep(5000) Run ('update.exe', @ScriptDir) Exit Do you guys see any problems? Thanks for the help in advance Edited March 2, 2006 by jackyyll Link to comment Share on other sites More sharing options...
pecloe Posted March 3, 2006 Share Posted March 3, 2006 (edited) a quick look $newestver = IniRead(@ScriptDir '\Data\ver.ini','Version','FileVer','Not Found') should be $newestver = IniRead(@ScriptDir & '\Data\ver.ini','Version','FileVer','Not Found') edit: i don't see any endif are you using scite? Edited March 3, 2006 by pecloe Link to comment Share on other sites More sharing options...
jackyyll Posted March 3, 2006 Author Share Posted March 3, 2006 Changed my code to this and still no cigar: Main Program(MAMBoT.exe) Local $verini = 'http://acguild.ampedhost.com/bot/ver/ver.ini' Local $ping = ping ('www.google.com', 250) If $ping = 0 Then $msg1 = MsgBox(1, "Error", "No internet connection detected. Close program now?") If $msg1 = 1 Then Exit EndIf EndIf If $ping = 1 Then InetGet($verini, "\Data\ver.ini", 1) If IniRead(@ScriptDir & '\Data\ver.ini','Version','FileVer','Not Found') > IniRead(@ScriptDir & '\Data\version.ini','Version','FileVer','Not Found') Then SplashOff() SplashTextOn("MAMBoT", "A newer version has been found and is updating! Please wait, the program will now restart...") Sleep(2500) SplashOff() Run ('update.exe', @ScriptDir) Exit Else FileDelete(@ScriptDir & '\Data\ver.ini') EndIf EndIf Updater(update.exe): ProcessClose("MAMBoT.exe") $newestver = IniRead(@ScriptDir & '\Data\ver.ini','Version','FileVer','Not Found') $website = 'http://acguild.ampedhost.com/bot/' & $newestver & '/MAMBoT.exe' If FileExists(@ScriptDir & '\MAMBoT.exe') Then FileDelete(@ScriptDir & '\MAMBoT.exe') Else Sleep(10) INetGet($website, "MAMBoT.exe", 1) IniWrite(@ScriptDir & '\Data\version.ini','Version','FileVer', $newestver) FileDelete(@ScriptDir & '\Data\ver.ini') Sleep(10) SplashTextOn("MAMBoT Updater", "Successfully updated to the latest version." Sleep(5000) Run ('MAMBoT.exe', @ScriptDir) EndIf Exit Can someone please help me out? Link to comment Share on other sites More sharing options...
NegativeNrG Posted March 3, 2006 Share Posted March 3, 2006 whats in the .ini file? [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
The Kandie Man Posted March 3, 2006 Share Posted March 3, 2006 Ok, try this: Local $verini = 'http://acguild.ampedhost.com/bot/ver/ver.ini' Local $ping = ping ('www.google.com', 250) If $ping = 0 Then $msg1 = MsgBox(1, "Error", "No internet connection detected. Close program now?") If $msg1 = 1 Then Exit EndIf EndIf ConsoleWrite("Ping: " & $ping) If $ping > 0 Then InetGet($verini, @ScriptDir & "\Data\ver.ini", 1) If IniRead(@ScriptDir & '\Data\ver.ini','Version','FileVer','Not Found') > IniRead(@ScriptDir & '\Data\version.ini','Version','FileVer','Not Found') Then SplashOff() SplashTextOn("MAMBoT", "A newer version has been found and is updating! Please wait, the program will now restart...") Sleep(2500) SplashOff() Run ('update.exe', @ScriptDir) Exit Else FileDelete(@ScriptDir & '\Data\ver.ini') EndIf EndIf "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire Link to comment Share on other sites More sharing options...
jackyyll Posted March 3, 2006 Author Share Posted March 3, 2006 (edited) Nevermind Kandie Mans way worked.. thanks man hehe Edited March 3, 2006 by jackyyll Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now