Page 1 of 2

Upgrading a distributed Publication

PostPosted: Tue Oct 11, 2005 8:48 am
by domino
My pub needs to be 'updateable' in three distinct ways...

#1. Database Info on a regular basis - This is OK thanks to help from colleagues on the forum.

#2. The Application (..exe) on the users PC on an occasional basis. (for example to add new features - fix problems and generally keep the thing fresh)

#3. Occasions where a new full installer package would need to be run with app restart etc.


Concerning #2. Below is a simple routine that seems to work OK and do the business (at least on my PC's) but it seems too simplistic to be effective.

I`d appreciate some feedback on whether this is a valid method for users to get their apps updated...


Code: Select all
DownloadFile "http://www.xyz.com/update/prog.exe" "!C:\Program Files\prog\prog.exe" ""
CloseApp "[PubDir]prog.exe" "ForceClose"
RunNeoBook "[PubDir]prog.exe" "ClearVars+CloseWindows"


Cheers
Dave

PostPosted: Thu Aug 03, 2006 4:09 pm
by domino
issam1979

Thanks I appreciate your time and feedback on this... but as you probably noticed my post was dated last October 2005.. and I`ve actually implemented a system very much like yours.

Having said that I think your code is worthy of a place in the archives as I`m sure others will need to do the same thing and would find your code
very useful

http://www.software-zone.com/~neosoft/

PostPosted: Wed Aug 09, 2006 5:45 pm
by mote
Issam1979

Please tell me what I am doing wrong with the code you displayed? When I enter this part of the code:

:CheckLastVersion
DownloadFile "http://www.motesoft.org/USC/update/LatestVersion.txt" "[TempDir]LatestVersion.txt" ""
FileRead "[TempDir]Latest_version.txt" "1.0" "[LatestVersion]"


It returns with "Cannot open File . . ." Then it tells me that I have the lastest version when I don't.

Questions:
What exactly do you put int the .txt file? I put "1.0"
Is it looking for the version placed in the "Version Info"?
And, when you are updating, do you have to download the whole program with the updates or is there a way to just download the changes you have made?

I hope this sounds correct. Thank you for any help you can give me.

Mote

PostPosted: Thu Aug 10, 2006 3:13 pm
by mote
"the version you've hard coded in your program.. "

Is this done at Book--->Book Properties---General-->Version Info?

PostPosted: Thu Aug 10, 2006 4:39 pm
by domino
Mote - Issam

and for downloading the whole program or not as an update...


Just for info you can combine Albertos (Techmedia) tmStorage & tmftp for to achieve routine updates ....

Briefly...
Place files to be updated into stream
Upload Stream (s)

Then proceed along these lines....

Make Update Button (ftp or NB download) to....
1. Download files to be updated
2. Close any databases (if necessary)
3. Extract files to appropriate directories
4. Reopen databases (if necessary)
5. Reset any variables
6. Reset version numbers
7. Delete stream file

I'm not sure you whether you can update the exe itself this way... I never needed to do that very often so just gave people a link...

PostPosted: Thu Aug 10, 2006 6:30 pm
by mote
"in order to use the version in "Version Info..." replace [InstalledVersion] with [PubVersion] ."

Well when I do this, the response is still "New Update Available" even though the .txt file is 1 and the Version Info is 1.

Any help?

PostPosted: Thu Aug 10, 2006 7:12 pm
by Gaev
mote:
Well when I do this, the response is still "New Update Available" even though the .txt file is 1 and the Version Info is 1.

If you place this command ...
Code: Select all
AlertBox "PubVersion" "[PubVersion]"
somewhere in your pub's Startup section, you will see that the value of [PubVersion] is 1.0.0.0 ... which is the combination of Major version, Minor Version, Build and Release components of the Version Info facility.

So either place this complete value in your .txt file ... or parse out the part before the first dot in [PubVersion] and compare it against the (major) version number you pass in the .txt file.

PostPosted: Thu Aug 10, 2006 7:52 pm
by mote
AlertBox "PubVersion" "[PubVersion]"


Nothing seems to work correctly. I have put the above code in the startup section of NeoBook. The PubVersion is 1.0.0.0 and my .txt file as 1.0.0.0 on the first line and still the respose is, "New updates available."

Is it the way I have inputed on the .txt file, which looks just like this:
1.0.0.0

Other than this problem, everything esle is working great. Any other suggestions?

Mote

PostPosted: Thu Aug 10, 2006 8:34 pm
by Gaev
mote:
Nothing seems to work correctly.

a) did you use a similar AlertBox command to see what the exact value of the variable [LatestVersion] is ?

b) in a previous post you said that you were using ...
Code: Select all
:CheckLastVersion
DownloadFile "http://www.motesoft.org/USC/update/LatestVersion.txt" "[TempDir]LatestVersion.txt" ""
FileRead "[TempDir]Latest_version.txt" "1.0" "[LatestVersion]"
... you are downloading to [TempDir]LatestVersion.txt but then reading line 1 of [TempDir]Latest_version.txt ... with the extra underscore character !!!

Why don't you paste an exact copy of your current routine here (do a copy and paste so there are no typos)

PostPosted: Thu Aug 10, 2006 9:08 pm
by mote
Gaev,

Here is the Code section that is not working correctly.


:CheckLastVersion
DownloadFile "http://www.motesoft.org/motejr/USCupdate/LatestVersion.txt" "[TempDir]LatestVersion.txt" ""
FileRead "[TempDir]LatestVersion.txt" "1" "[LatestVersion]"

If "[LatestVersion]" "<>" "[PubVersion]"
AlertBox "Info" "New update available!"
GotoLine "StartUpdate"
Else
AlertBox "Info" "You have the latest version!"
GotoLine "End"
EndIf



So then I added this line as you suggested:

AlertBox "PubVersion" "[PubVersion]"
AlertBox "LatestVersion" "[LatestVersion]"


PubVersion comes up with 1.0.0.0
LatestVersion comes up with nothing.

Let me know what I am doing wrong.

Mote

PostPosted: Thu Aug 10, 2006 9:25 pm
by mote
Gaev,

I placed the Alert box for [LastestVersion] here:

Code: Select all
:CheckLastVersion
DownloadFile "http://www.motesoft.org/motejr/USCupdate/LatestVersion.txt" "[TempDir]LatestVersion.txt" ""
FileRead "[TempDir]LatestVersion.txt" "1" "[LatestVersion]"

AlertBox "LatestVersion" "[LatestVersion]"

If "[LatestVersion]" "<>" "[PubVersion]"
   AlertBox "Info" "New update available!"
   GotoLine "StartUpdate"
   Else
   AlertBox "Info" "You have the latest version!"
   GotoLine "End"
EndIf


And the Alert Box now reads:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 TRANSITIONAL//EN"


Somehow its reading an HTML code. For your information, I am useing Notepad to place my LatestVersion in.

Mote