Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Howto use the Updater
Howto use the Updater [message #23858] Fri, 27 November 2009 10:02 Go to next message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
has anyone a example package on how to use the Updater functionality? the infos in the Manual are somewhat slight.

http://www.ultimatepp.org/srcdoc$CtrlLib$Updater$en-us.html

as far as i got to know from forum, it cant support http/ftp connection for now.. should be extended.. it's a pretty important function.
Re: Howto use the Updater [message #23867 is a reply to message #23858] Fri, 27 November 2009 23:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kohait00 wrote on Fri, 27 November 2009 04:02

has anyone a example package on how to use the Updater functionality? the infos in the Manual are somewhat slight.

http://www.ultimatepp.org/srcdoc$CtrlLib$Updater$en-us.html

as far as i got to know from forum, it cant support http/ftp connection for now.. should be extended.. it's a pretty important function.


Yep, it is intended for LAN usage in controlled enviroment...

I guess that updating over inet should be a little bit less heavyhanded.

Writing example package is tricky - because in fact, only code you need is "SelfUpdate" at the start of APP_MAIN. The problem is configuration...

Mirek
Re: Howto use the Updater [message #26623 is a reply to message #23867] Mon, 17 May 2010 10:41 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Uno

Could you give a more detailed explanation of Updater ?.

I could use it now but I do not understand how to use it.


Best regards
Iñaki
Re: Howto use the Updater [message #26632 is a reply to message #26623] Mon, 17 May 2010 15:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
I believe the link above is quite explaining...

It is no magic, update only makes sure you have actual files on local HD same as placen on LAN drive. SelfUpdate / Updater.exe do that for .exe itself, which is bit more tricky - you cannot overwrite running process. That is why Updater.exe is called by program, program is terminated, updater copies the actual version and then program is restarted.

Mirek
Re: How to use the Updater [message #26655 is a reply to message #26632] Tue, 18 May 2010 09:54 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Mirek

Thank you for your support.

However I still cannot understand how it works.

Going here: http://www.ultimatepp.org/srcdoc$CtrlLib$Updater$en-us.html , it appears this sample code:

GUI_APP_MAIN
{
    SelfUpdate(); // SelfUpdate updates updater.exe first and then app itself
    Update("cs-cz.scd"); // Update czech spelling checker
    Update("logo.bmp"); // Update company logo to be used in reports


The first problem is that it seems Update() function does not exist.

We could consider that that function is really called UpdateFile(). Version used in example void UpdateFile(const char *filename) not always can be used, as it reads data from an .ini file that is a readable text file.

Unfortunately SelfUpdate() calls UpdateFile("UPDATER.EXE"); and GetIniKey("UPDATE"), so it has the above problem.

In addition "updater.exe" name is hardcoded. It could be better to be changed by the programmer because now it is too clear the purpose of that program Smile .

In summary, in actual implementation, although Update.cpp is in CtrlLib, it seems to require some changes to be adapted to programmer needs. It seems that with a very little bit of programming and documenting effort it would be more usable.



Best regards
Iñaki
Re: How to use the Updater [message #26664 is a reply to message #26655] Tue, 18 May 2010 17:17 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 18 May 2010 03:54

Hello Mirek

Thank you for your support.

However I still cannot understand how it works.

Going here: http://www.ultimatepp.org/srcdoc$CtrlLib$Updater$en-us.html , it appears this sample code:

GUI_APP_MAIN
{
    SelfUpdate(); // SelfUpdate updates updater.exe first and then app itself
    Update("cs-cz.scd"); // Update czech spelling checker
    Update("logo.bmp"); // Update company logo to be used in reports


The first problem is that it seems Update() function does not exist.

We could consider that that function is really called UpdateFile(). Version used in example void UpdateFile(const char *filename) not always can be used, as it reads data from an .ini file that is a readable text file.



Ops, sorry. Old docs...

Quote:


Unfortunately SelfUpdate() calls UpdateFile("UPDATER.EXE"); and GetIniKey("UPDATE"), so it has the above problem.



Sure, it has to know where files are placed on LAN, right?

Quote:


In addition "updater.exe" name is hardcoded. It could be better to be changed by the programmer because now it is too clear the purpose of that program Smile .



Not sure I am getting this point?

Quote:


In summary, in actual implementation, although Update.cpp is in CtrlLib, it seems to require some changes to be adapted to programmer needs. It seems that with a very little bit of programming and documenting effort it would be more usable.



I have tried to improve docs a tiny bit.

Mirek
Re: How to use the Updater [message #26668 is a reply to message #26664] Tue, 18 May 2010 17:56 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Mirek

Thank you for your support.

In addition I mean it is interesting to do:

- Now functions consider as only option that LAN folder is located in an .ini file. It would be interesting that network folder would be an argument.

- Now program name "updater.exe" is hardcoded. It would be good to be in an argument (perhaps with "updater.exe" as a default value)


Best regards
Iñaki
Re: How to use the Updater [message #26703 is a reply to message #26668] Thu, 20 May 2010 07:00 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Tue, 18 May 2010 11:56

Hello Mirek

Thank you for your support.

In addition I mean it is interesting to do:

- Now functions consider as only option that LAN folder is located in an .ini file. It would be interesting that network folder would be an argument.



OK.

Quote:


- Now program name "updater.exe" is hardcoded. It would be good to be in an argument (perhaps with "updater.exe" as a default value)


Still not really getting this point. There is Updater package in uppsrc, what is the point of renaming the application? The interfaces between the application and updater.exe is fixed, so can be the name IMO.
Re: How to use the Updater [message #26704 is a reply to message #26703] Thu, 20 May 2010 08:18 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Mirek

Quote:

Still not really getting this point. There is Updater package in uppsrc, what is the point of renaming the application? The interfaces between the application and updater.exe is fixed, so can be the name IMO.


As updater.exe has to be shipped with the application exe and files, somebody could consider for security to change updater.exe name to other name, let's say, more hidden for the final program user Smile


Best regards
Iñaki
Re: How to use the Updater [message #26705 is a reply to message #26703] Thu, 20 May 2010 08:21 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
( Never mind, already answered by Koldo)

[Updated on: Thu, 20 May 2010 08:23]

Report message to a moderator

Re: How to use the Updater [message #26733 is a reply to message #26705] Sun, 23 May 2010 09:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Whatever...

void   UpdateSetDir(const char *path);
void   UpdateSetUpdater(const char *exename);
Re: How to use the Updater [message #26734 is a reply to message #26733] Sun, 23 May 2010 09:55 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
BTW, there is also "SelfUpdateSelf" where application itself serves as updater Smile (no updater.exe needed in that case).
Re: How to use the Updater [message #26735 is a reply to message #26733] Sun, 23 May 2010 15:13 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
luzr wrote on Sun, 23 May 2010 09:53

Whatever...

void   UpdateSetDir(const char *path);
void   UpdateSetUpdater(const char *exename);


It seems very well Smile.


Best regards
Iñaki
Previous Topic: UWord bug
Next Topic: PromptOK in a thread. Bug?
Goto Forum:
  


Current Time: Fri Mar 29 05:54:36 CET 2024

Total time taken to generate the page: 0.01742 seconds