I am creating an application and I want it to automatically check the web to see if there is an update.
I have been successful using the following:
At Application start:
%FileInfo% = File.GetInformation (Existence, "%SrcDir%\Updates\test.zip")
IF (%FileInfo%=TRUE)
ZipFile.Extract ( "%SrcDir%\Updates\test.zip", "*.*", "%SrcDir%")
File.Delete ("%SrcDir%\Updates\test.zip")
END IF
At Application exit:
%Result% = Dialog.MessageBox ("E Update", "Would you like to check for an...", Yes|No, Question)
IF (%Result%=NO)
Application.Exit
ELSE
Internet.DownloadWebFile ("http://www.myweb.com/update.zip", "%SrcDir%/Updates")
%UpdateSuccessful% = Dialog.MessageBox ("Title", "Your Ellusionist Interface has...", Ok, Information)
IF (%UpdateSuccessful%=OK)
Application.Exit
END IF
END IF
However the problem is that everytime the user exits the program, he will receive a dialog box asking him if he wants to check for an update.
I want to make it so the dialog box will appear every 30 days instead of everytime the user exits the app.
Looking at the Knowledge Base, I found the following:
%Date% = System.GetDateTime ( "Date", "Julian Date")
%ExpDate% = "FALSE"
%ExpDate% = Registry.GetValueData ("HKEY_CURRENT_USER\HiddenKey", "Date")
IF (%ExpDate% = FALSE)
%ExpDate% = Evaluate (%Date% + 30)
Registry.SetValue ("HKEY_CURRENT_USER\HiddenKey", "Date", "%ExpDate%")
END IF
IF (%Date% >= %ExpDate%)
%Result% = Dialog.MessageBox ("Expired", "This application has expired.", Ok, Stop)
Application.Exit
END IF
I was wondering how I can modify it so that I can have the app check the web for an update instead of having the app expire.
Thanks for your help.
Roy
I have been successful using the following:
At Application start:
%FileInfo% = File.GetInformation (Existence, "%SrcDir%\Updates\test.zip")
IF (%FileInfo%=TRUE)
ZipFile.Extract ( "%SrcDir%\Updates\test.zip", "*.*", "%SrcDir%")
File.Delete ("%SrcDir%\Updates\test.zip")
END IF
At Application exit:
%Result% = Dialog.MessageBox ("E Update", "Would you like to check for an...", Yes|No, Question)
IF (%Result%=NO)
Application.Exit
ELSE
Internet.DownloadWebFile ("http://www.myweb.com/update.zip", "%SrcDir%/Updates")
%UpdateSuccessful% = Dialog.MessageBox ("Title", "Your Ellusionist Interface has...", Ok, Information)
IF (%UpdateSuccessful%=OK)
Application.Exit
END IF
END IF
However the problem is that everytime the user exits the program, he will receive a dialog box asking him if he wants to check for an update.
I want to make it so the dialog box will appear every 30 days instead of everytime the user exits the app.
Looking at the Knowledge Base, I found the following:
%Date% = System.GetDateTime ( "Date", "Julian Date")
%ExpDate% = "FALSE"
%ExpDate% = Registry.GetValueData ("HKEY_CURRENT_USER\HiddenKey", "Date")
IF (%ExpDate% = FALSE)
%ExpDate% = Evaluate (%Date% + 30)
Registry.SetValue ("HKEY_CURRENT_USER\HiddenKey", "Date", "%ExpDate%")
END IF
IF (%Date% >= %ExpDate%)
%Result% = Dialog.MessageBox ("Expired", "This application has expired.", Ok, Stop)
Application.Exit
END IF
I was wondering how I can modify it so that I can have the app check the web for an update instead of having the app expire.
Thanks for your help.
Roy
Comment