PDA

View Full Version : Web Update. What am I doing wrong?



NewsArchive
04-03-2007, 10:52 AM
I am not sure what my problem is, but if I call WUpdate with the /C switch,
I always got 0 as an answer, while if I just start Wupdate normally, it
does find that there is an update.

here is my code ( I commented out the part i do want to work...)

of 'UpdateSelected'
RUN(FullPath & '\WUpdate.exe')
! RUN(Fullpath & '\WUpdate.exe /C')
! X# = Runcode()
! IF X# = 1
! RUN(FullPath & '\WUpdate.exe')
! POST(Event:CloseDown)
! ELSIF x# = 0
! Message('There is no update available at this time.','No
Update!', ICON:EXCLAMATION)
! ELSE
! Message('An error make it impossible to update.','Error!',
ICON:HAND)
! END

Bernard Grosperrin

NewsArchive
04-04-2007, 07:39 AM
Hi Bernard,

>I am not sure what my problem is, but if I call WUpdate with the /C switch,
>I always got 0 as an answer, while if I just start Wupdate normally, it
>does find that there is an update.
>
>here is my code ( I commented out the part i do want to work...)
>
> of 'UpdateSelected'
> RUN(FullPath & '\WUpdate.exe')
>! RUN(Fullpath & '\WUpdate.exe /C')

Here is the code I use. Your problem, I think, is that you don't
provide the WAIT parameter in the RUN, i.e. you fire off the
wupdate.exe and since RUN doesn't wait for it, WUpdate.exe has no time
to set up the return code before you check it.

CheckForUpdates ROUTINE
Data
Rc Long
Ec Long
Code

Run('wupdate.exe /C /S',1) ! Note the second parameter set to 1
RC = RunCode()
If RC = 1
If Message('There are new updates to the Broker Intellect II 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_house.ico',|
Button:Yes+Button:No)=Button:Yes
Run('wupdate.exe')
Halt()
End
Else
Message('No updates to download','No new updates','~RO-Mx1_house.ico')
End

This seems to work perfectly and I have had no problems with it.

Best regards,

Arnór Baldvinsson
Icetips Creative, Inc.
San Antonio, Texas, USA
www.icetips.com


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

NewsArchive
04-04-2007, 07:40 AM
Arnor,


> Here is the code I use. Your problem, I think, is that you don't
> provide the WAIT parameter in the RUN, i.e. you fire off the
> wupdate.exe and since RUN doesn't wait for it, WUpdate.exe has no time
> to set up the return code before you check it.

Thanks, I'll try, I am sure that's it. Don't even know why I did not think
about this, guess I am doing too many things at once these days...

Bernard