PDA

View Full Version : Get the new version no from server



NewsArchive
09-06-2008, 10:34 AM
Hallo,


When I check for a new version and if there is a new version on server
there is a way to get the new version no ? (get in a global variable ?)


Thank you,

Regards,
Robert Iliuta

NewsArchive
09-06-2008, 10:35 AM
Robert,

I assume you mean from within the wupdate.exe?

The server version is stored in the %HOST_VERSION% (see wupdate.sb6 source
codes).

Does this help?

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
09-06-2008, 10:36 AM
Hallo Friedrich,


Yes it's about wupdate.exe . I found %HOST_VERSION% , but how it works ?
:-) I don't know how to get that version no from %HOST_VERSION% and to
display in my program ...... Do I have to put on INI and then to get
from INI ?

Thank you ,

Regards,
Robert

NewsArchive
09-06-2008, 10:36 AM
Hello Robert,

Yes, you have to develop and deploy a custom wupdate.exe. Then write (from
the wupdate.exe to an INI or another text file) the version value and read
it from your application.

Does this help?

Friedrich

NewsArchive
09-06-2008, 10:37 AM
Hi Friedrich,

> Yes, you have to develop and deploy a custom wupdate.exe. Then write (from
> the wupdate.exe to an INI or another text file) the version value and read
> it from your application.

SB also has a wonderful function to download a file, so you could write a
stub in SB that just downloads the .ini file:)

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
09-06-2008, 10:38 AM
Arnór,

>> Yes, you have to develop and deploy a custom wupdate.exe. Then write
>> (from the wupdate.exe to an INI or another text file) the version value
>> and read it from your application.
>
> SB also has a wonderful function to download a file, so you could write a
> stub in SB that just downloads the .ini file:)

Well, of course, that is the *perfect* solution. Sometimes the simple is
often overlooked <g>

Friedrich

NewsArchive
09-06-2008, 10:38 AM
> Well, of course, that is the *perfect* solution. Sometimes the simple is
> often overlooked <g>

Hmmm, what a strange sentence. It's either too much coffee or not enough.

What I mean is: "Sometimes the simple ideas are the good ones."

Friedrich

NewsArchive
09-06-2008, 10:39 AM
Hi Friedrich,

> What I mean is: "Sometimes the simple ideas are the good ones."

You have to be careful. The way you are going with SB we soon will be able
to do all our programming AND our installs with it!<g>

Best regards,

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
09-06-2008, 10:39 AM
>> What I mean is: "Sometimes the simple ideas are the good ones."
>
> You have to be careful. The way you are going with SB we soon will be
> able to do all our programming AND our installs with it!<g>

<VBG> :)

Friedrich

NewsArchive
09-08-2008, 02:39 AM
Hi Arnor,

Surely you want the ini file downloaded in the app, and not in the
installer.
When the app starts up, that is when it needs to know whether there is an
update.
How to download the in file in the main procedure, IMHO is more to the
point.

Sim Sherer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~

NewsArchive
09-08-2008, 02:40 AM
> Surely you want the ini file downloaded in the app, and not in the
> installer.

Actually the wupdate.exe ( Web Update Client ) program that you ship with
your full installer does that.

> When the app starts up, that is when it needs to know whether there is an
> update.

You simply run the wupdate.exe program when your program starts (Shell
Execute instead of the Clarion RUN command). An even easier option is to
use Arnor's IceTips Utilities ITRun class.

There is a /S parameter lets you do this silently.


If there is an update available, the wupdate.exe will let the customer know
it.


> How to download the in file in the main procedure, IMHO is more to the
> point.

The wupdate.exe downloads the updater and runs it.

In your update installer you should detect that the app is still running,
then prompt the user to close it. Then you continue the update.


Does that help?

Charles





--
-------------------------------------------------------------------------------------------------------
Charles Edmonds
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.clarionproseries.com - "Serious imaging tools for Clarion Developers"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms!"
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
09-08-2008, 02:41 AM
Hi Charles,

> You simply run the wupdate.exe program when your program starts (Shell
> Execute instead of the Clarion RUN command). An even easier option is to
> use Arnor's IceTips Utilities ITRun class.
>
> There is a /S parameter lets you do this silently.

And you can use the /C /S to make it check for the webupdate silently and
not do anything. In that phase it just downloads the ini file, compares and
returns a dos ERRORLEVEL:)

Just an additional note about the RUN: The WebUpdate exe will automatically
require elevation when it's run under Vista. If I remember correctly this
has something to do with the FTP side of things but also because it writes
the ini file to the install folder which would in most cases be under
Program Files, which is off limits for anyone on Vista unless they have
admin rights. So the Web update required elevation. Clarion RUN() uses
CreateProcess api which CANNOT handle elevating the executable.
ShellExecute and ShellExecuteEx do and that is what I use in the ITRun
method in the Icetips Utilities, so it is very capable of running programs
that require elevations. It even has an option to force elevation!

Best regards,

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
09-08-2008, 02:41 AM
> And you can use the /C /S to make it check for the webupdate silently and
> not do anything. In that phase it just downloads the ini file, compares and
> returns a dos ERRORLEVEL:)
>
> Just an additional note about the RUN: The WebUpdate exe will automatically
> require elevation when it's run under Vista. If I remember correctly this
> has something to do with the FTP side of things but also because it writes
> the ini file to the install folder which would in most cases be under
> Program Files, which is off limits for anyone on Vista unless they have
> admin rights. So the Web update required elevation. Clarion RUN() uses
> CreateProcess api which CANNOT handle elevating the executable.
> ShellExecute and ShellExecuteEx do and that is what I use in the ITRun
> method in the Icetips Utilities, so it is very capable of running programs
> that require elevations. It even has an option to force elevation!

Thanks,

I knew about the /C option.

Glad to see you got the other things working with ITRun (and appreciate the
code sample). I knew you were working on some things there last time we
chatted about it (which are obviously sorted out now<g>).

;-)

Take care,

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.clarionproseries.com - "Serious imaging tools for Clarion Developers"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms!"
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
09-08-2008, 02:42 AM
Hi Charles,

> Glad to see you got the other things working with ITRun (and appreciate the
> code sample). I knew you were working on some things there last time we
> chatted about it (which are obviously sorted out now<g>).

It works as expected now as far as I know. At least I have not run into any
problems with it in the Build Automator which makes heavy use of that
particular method;)

Best regards,

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php

NewsArchive
09-08-2008, 02:42 AM
> It works as expected now as far as I know. At least I have not run into any
> problems with it in the Build Automator which makes heavy use of that
> particular method;)

Cool - thanks for the confirmation!

Charles


--
-------------------------------------------------------------------------------------------------------
Charles Edmonds
www.pagesnip.com - "Print and Save the Web, just the way you want it!"
www.clarionproseries.com - "Serious imaging tools for Clarion Developers"
www.ezround.com - "Round Corner HTML tables with matching Banners, Buttons
and Forms!"
www.lansrad.com - "Intelligent Solutions for Universal Problems"
www.fotokiss.com - "World's Best Auction Photo Editor"
-------------------------------------------------------------------------------------------------------

NewsArchive
09-08-2008, 02:43 AM
Hi Sim,

> Surely you want the ini file downloaded in the app, and not in the
> installer.

You can write a lot more than just installers with SetupBuilder!

> When the app starts up, that is when it needs to know whether there is an
> update.
> How to download the in file in the main procedure, IMHO is more to the
> point.

I just call WUPDATE.EXE to check for updates. This is what I use in the
Build Automator:

CheckforWebUpdates ROUTINE
Data
Rc Long
Ec Long
PP CString(2049)
pF CString(50)
Code
pF = 'autoupdate.exe' !! renamed WUPDATE.EXE
PP = Upper(ShortPath(ITU.ProgPath & '\' & pF))
If Exists(PP)
PP = '"' & ITU.ProgPath & '\' & pF & '"'
RC = ITU.ITRun(PP,true,'/C /S',,True) !! Elevate if needed
If RC = 1
If Message('There are new updates to the Build Automator program
available for download. ' &|
'If you want to update the program, the program will shut
down automatically and ' &|
'run the web update wizard.' &|
'||Do you want to update the program now?',|
'Updates Available - download now?',|
'~RO-Mx1_internet-america.ico',|
Button:Yes+Button:No)=Button:Yes
ITU.ITRun(PP)
Halt()
End
Else
Message('No updates to download for the Build Automator','No new
updates','~RO-Mx1_internet-america.ico')
End
Else
If Message('The AutoUpdate.EXE file could not be found in the "' &
ITU.ProgPath & '" folder. ' &|
'Please download and install the latest build from
www.buildautomator.com. ' &|
'||Do you want to go to our download page now?',|
'Automatic update program not found.',|
'~RO-Mx1_internet-america.ico',|
BUTTON:Yes+BUTTON:No,BUTTON:Yes) = BUTTON:Yes
ITU.OpenUrl('http://www.buildautomator.com/downloads.php')
End
End

This checks for an update by calling the web update executable with /C /S.
/C is for CHECK (I think;) and S is for Silent. The web update downloads
the ini but by default it deletes it when it's done comparing the versions.
You could modify it so that it would leave the ini file so you could inform
the user of the version that is available. Or you could write a little stub
in SB to just download it when your app opens.

With a tool as powerful as Setup Builder there are many ways you can skin
this proverbial cat:)

Best regards,

--
Arnór Baldvinsson - Icetips Creative, Inc.
www.icetips.com - www.buildautomator.com

Subscribe to information from Icetips.com:
http://www.icetips.com/subscribe.php