Death259 Posted November 6, 2006 Share Posted November 6, 2006 I was just wondering if there was a way to change the icon in the top left of the GUI, and if there is a way to change the icon of the compiled EXE. If this has already been asked, im sorry, i searched for a bit and wasn't able to find it. Link to comment Share on other sites More sharing options...
BigDod Posted November 6, 2006 Share Posted November 6, 2006 1) GUISetIcon("D:\AutoIT\difference.ico") 2) When you use the compiler from the AutoIt program folder you get the option to use a different icon. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Death259 Posted November 6, 2006 Author Share Posted November 6, 2006 Awesome. Thank you soo much! Link to comment Share on other sites More sharing options...
Death259 Posted November 8, 2006 Author Share Posted November 8, 2006 (edited) This a very general question, but i was wanting to add an update function to my program so that it checks to see if the program is the latest version. so like i would host it on my webspace and then people could download it from there install it using the installer i made. Then within the program there would be a menuitem that would check for the latest version and if there is a newer version then it would replace the current. What's the general way to go about this? Edited November 8, 2006 by Death259 Link to comment Share on other sites More sharing options...
Somniis Posted November 9, 2006 Share Posted November 9, 2006 This a very general question, but i was wanting to add an update function to my program so that it checks to see if the program is the latest version. so like i would host it on my webspace and then people could download it from there install it using the installer i made. Then within the program there would be a menuitem that would check for the latest version and if there is a newer version then it would replace the current.What's the general way to go about this?You could store the version # in a INI (written upon startup of the program). Store another INI on the web for a version that is higher or equal to the one already out. Then do a InetGet() for the INI on the web, compare the value with that of the stored INI on the computer, and download a newer version if necessary. Just don't forget to delete the INI downloaded from the web afterward. There are many ways to do it, I imagine. Just need to think a bit. Link to comment Share on other sites More sharing options...
Death259 Posted November 9, 2006 Author Share Posted November 9, 2006 (edited) alright that would work, thanks i just didn't know how to really check on the web for the version, but placing it in the ini and then using inetget sounds like it will definately solve the problem. i've never used initget() before. But thanks alot! i will do this and return if i have anymore questions. Edited November 9, 2006 by Death259 Link to comment Share on other sites More sharing options...
Somniis Posted November 9, 2006 Share Posted November 9, 2006 (edited) alright that would work, thanks i just didn't know how to really check on the web for the version, but placing it in the ini and then using inetget sounds like it will definately solve the problem. i've never used initget() before. But thanks alot! i will do this and return if i have anymore questions. It's pretty simple to do. I've written some code for the exact thing you are needing and posted it in the forums. Here's something to get ya started, or to give you an idea of what you need to do: expandcollapse popup;$CURRENT = "the web address to the new(er) file" ;$CVER = "the webaddress to the INI with current version in it" ;$INI = path to the INI on computer with version in it ;$DLDIR = path to save the newer version ;$sd = server is down if 1 ;$nv = new version is available if 1 Case $msg = $BUTTON Dim $sd = 0 Dim $nv = 0 ;retrieve INI from web and place in the script dir as "check.ini" Dim $d = InetGet($CVER, @ScriptDir & "\data\check.ini") If $d = 0 Then MsgBox(16, "Error", "Cannot connect to server. Please check internet settings!") FileDelete(@ScriptDir & "\data\check.ini") $sd = 1 EndIf If $sd = 0 Then ; INI downloaded from web; getting version number Dim $c_Ini = IniRead(@ScriptDir & "\data\check.ini", "Data", "Ver", "") ; INI written by program on startup Dim $this_Ini = IniRead($INI, "Data", "Ver" , "") ; compares version numbers If $this_Ini < $c_Ini Then $nv = 1 ElseIf $this_Ini = $c_Ini Then $nv = 0 EndIf If $nv = 1 Then Dim $size = InetGetSize($CURRENT) If $size < 100000 Then ;retrieves webpage instead of file if small size - only have this here because the file I used was on geocities free :-) Msgbox(16, "Error", "Download server is down. Please try again later.") FileDelete(@ScriptDir & "\data\check.ini") $sd = 1 EndIf If $sd = 0 And $nv = 1 Then Dim $kb = Round($size / 1024, 0) ;convert to kilobytes and chop off decimal places $m1 = MsgBox(4, "New version available", "New version(" & $c_Ini & ") is " & $kb & "kb. Download?") If $m1 = 6 Then ;Yes Dim $dl = InetGet($CURRENT, $DLDIR, 1, 1) If $dl = 0 Then MsgBox(16, "Error", "Cannot connect to server. Please check internet settings!") EndIf ProgressOn("Downloading...", "Retrieving new version.") While @InetGetActive Dim $p = (100 * @InetGetBytesRead) / $size ProgressSet($p, @InetGetBytesRead & "/" & $size & " bytes", "Download in progress.") Sleep(250) WEnd ProgressOff() FileDelete(@ScriptDir & "\data\check.ini") MsgBox(64, "Done", "The file was downloaded to: " & $DLDIR) EndIf EndIf ElseIf $nv = 0 Then MsgBox(64, "Update complete", "No newer version available.") FileDelete(@ScriptDir & "\data\check.ini") EndIf EndIf Inis have this format in the above: [Data] Ver=1.0 (or 1.2, 1.3, etc.) Edited November 9, 2006 by Somniis Link to comment Share on other sites More sharing options...
Death259 Posted November 17, 2006 Author Share Posted November 17, 2006 (edited) well, i just finally implemented that code. Thank you soo much. that worked perfectly, and was better then what i had even thouhgt of implementing. I'd also never used the progress bar before, so this was a nice way to show me how to use both properly. The only thing i really changed, was that i just checked the donloaded ini with the $version number i had within the program itself, but it worked like a charm. Thanks man. Edited November 17, 2006 by Death259 Link to comment Share on other sites More sharing options...
Somniis Posted November 17, 2006 Share Posted November 17, 2006 well, i just finally implemented that code. Thank you soo much. that worked perfectly, and was better then what i had even thouhgt of implementing. I'd also never used the progress bar before, so this was a nice way to show me how to use both properly. The only thing i really changed, was that i just checked the donloaded ini with the $version number i had within the program itself, but it worked like a charm. Thanks man.I'm glad I could help. I'm sure there are even better ways to do what the above code does, but it works. 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