|
-
Jul 29th, 2008, 10:56 PM
#1
Thread Starter
Lively Member
[RESOLVED] An Online Update?
So I am constantly working on my programs, and making new versions.
I have made an updater for my program, but I'm not to sure it is the proper way to do it.
This is what it does:
- Downloads and checks a "update.txt", hosted online with a version number in it
- If the version number is higher than the current app's version number alerts the user to the update
- When the message is clicked, the new version is downloaded
- once download is finished, the app closes and the new installer is run
This works very well and all, but the first part, were it downloads the txt file, for some reason windows continually use's the temp files once it has downloaded once. So when I update that txt file, its not for a day or two until windows actually downloads a new copy of the updated text file?
This may just be the way I'm downloading the file? I'm really not sure?
Any suggestions?
Thanks
-
Jul 30th, 2008, 03:20 AM
#2
Re: An Online Update?
And how are you downloading your file?
-
Jul 30th, 2008, 03:39 AM
#3
Re: An Online Update?
I had a similar problem and the way to resolve it is to clear the Cache before you redownload & check the new file.
Code:
'Declare
Private Declare Function DeleteUrlCacheEntry Lib "Wininet.dll" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long
Private Const ERROR_SUCCESS As Long = 0
Private Const BINDF_GETNEWESTVERSION As Long = &H10
'In a Sub
Dim xPath as String
xPath = fso.GetSpecialFolder(2) & "\update.tmp"
Call DeleteUrlCacheEntry(xPath)
getResult = URLDownloadToFile(0, getURL, xPath, BINDF_GETNEWESTVERSION, 0) = ERROR_SUCCESS
_____________________________________________________________________
----If this post has helped you. Please take time to Rate it.
----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.

-
Jul 31st, 2008, 05:37 AM
#4
Lively Member
Re: An Online Update?
before downloading you can write a function to :
check if theres already a txt file in the temp dir.
and if there is delete it.
-
Jul 31st, 2008, 06:29 AM
#5
Thread Starter
Lively Member
Re: An Online Update?
Thanks a whole heap guys! I didn't think that the cache could be so easy to work with!
works great now thanks
Rated you all
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|