Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Question about silent wucheck?

  1. #1

    Default Question about silent wucheck?

    Hello all,

    This is what I want:

    I want wuckeck to do its thing completely silent.

    If an update is available, I want to display a message, "An update is
    available. Do you you want to update XXXXXX?"

    I know how to do the silent part. How do I do the message part?

    Th SB docs say:
    wucheck.exe /C /S - Check for a web update in silent mode. Returns "1" if an
    update is available. Returns "0" if no update is available.

    I don't know how to use the Returns "1", Returns "0" part.

    Do I use the return value in the clarion EXE or in the SB setup?

    Thanks,
    Don

  2. #2

    Default Re: Question about silent wucheck?

    Hi Don,

    > This is what I want:
    >
    > I want wuckeck to do its thing completely silent.
    >
    > If an update is available, I want to display a message, "An update is
    > available. Do you you want to update XXXXXX?"
    >
    > I know how to do the silent part. How do I do the message part?
    >
    > Th SB docs say:
    > wucheck.exe /C /S - Check for a web update in silent mode. Returns "1" if
    > an update is available. Returns "0" if no update is available.
    >
    > I don't know how to use the Returns "1", Returns "0" part.
    >
    > Do I use the return value in the clarion EXE or in the SB setup?

    You call (run) wucheck.exe from your own application and "wait" for it. If
    it returns "1" then an update is available -- display your "An update is
    available. Do you want to update XXXXXX?" message. If it returns "0" then
    no update is available.

    Does this help?

    Friedrich

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

    SetupBuilder is Windows 7 installation -- "point. click. ship"

    -- Official Comodo Code Signing and SSL Certificate Partner

  3. #3

    Default Re: Question about silent wucheck?

    How do know what it returned? Or should I say, how do a capture the return
    value to do what I want?

    If ReturnValue = 1
    message('YadaYadaYada')
    Else
    !Do nothing
    End

    Donald Ridley

  4. #4

    Default Re: Question about silent wucheck?

    > How do know what it returned? Or should I say, how do a capture the
    > return value to do what I want?
    >
    > If ReturnValue = 1
    > message('YadaYadaYada')
    > Else
    > !Do nothing
    > End

    It depends on what you are using to launch the external program:
    ShellExecute(Ex), CreateProcess, Clarion RUN(), a 3rd-party tool, etc.

    In Windows, if you use ShellExecuteEx, you have to "wait" for the launched
    application to retrieve the return value from that app. You have to use the
    WaitForSingleObject Windows API to wait and then GetExitCodeProcess to
    retrieve the exit code.

    BTW, this is not only for wupdate.exe or wucheck.exe. This is for all
    Windows applications.

    Here is a quick and dirty ShellExecute demo for Clarion developers:

    http://www.lindersoft.com/forums/sho...cute#post44868
    http://www.lindersoft.com/projects/ClarionShellExec.zip

    If you are using the Clarion RUN() command with the waitflag option enabled,
    then (IIRC) you can use the RUNCODE() function to retrieve the exit code.

    Does this help?

    Friedrich

  5. #5

    Default Re: Question about silent wucheck?

    Hey Friedrich,

    There should be an award for best customer service..... :-)

    I'm not too familiar with ShellExecute at this moment. I'm using the RUN
    command.

    I read the docs on RUNCODE() and I see where I can execute code based upon
    the returned code.

    Wucheck returns 0 if no update and 1 if there is an update. Can I use that
    0 or 1 with RUNCODE or do I have to use the codes listed in the Clarion
    docs?

    Just needing a little education here..

    THANKS!
    Don

  6. #6

    Default Re: Question about silent wucheck?

    Hi Donald,

    > Wucheck returns 0 if no update and 1 if there is an update. Can I use that
    > 0 or 1 with RUNCODE or do I have to use the codes listed in the Clarion
    > docs?
    >
    > Just needing a little education here..

    Run('wucheck.exe /S /C')
    If RunCode() = 1
    If Message('There is a new version available for download. Do you want to
    install it now?','New version
    available',ICON:Exclamation,BUTTON:Yes+BUTTON:NO,B UTTON:Yes) = BUTTON:Yes
    Run('wupdate.exe')
    Halt()
    End
    End

    This will check for update and if an update is available it will download it
    and install it. The Halt() will stop the program so you can install the new
    version without rebooting

    Note that Run() (at least in C6) is not reliable under UAC on Vista/Win7 if
    the program you are running is not elevated (manifested asInvoker) and the
    install is manifested as RequireAdministrator. What happens is that the
    Run() command will NOT trigger the elevation prompt and simply not do
    anything. To solve that you need to use ShellExecute/ShellExecuteEx.

    Hope this helps

    Best regards,

    --
    Arnór Baldvinsson - Icetips Alta LLC
    Port Angeles, Washington
    www.icetips.com - www.buildautomator.com - www.altawebworks.com

    Icetips product subscriptions at http://www.icetips.com/subscribe.php

  7. #7

    Default Re: Question about silent wucheck?

    LOL! Hey Arnor,

    I had coded something almost identical to what you did.

    You know what I learned?

    You HAVE to spell "wucheck" correctly!

    Thanks Arnor!!

    Don

  8. #8

    Default Re: Question about silent wucheck?

    Hi Don,

    > There should be an award for best customer service..... :-)

    Thank you!!! :-)

    > I'm not too familiar with ShellExecute at this moment. I'm using the RUN
    > command.
    >
    > I read the docs on RUNCODE() and I see where I can execute code based upon
    > the returned code.
    >
    > Wucheck returns 0 if no update and 1 if there is an update. Can I use
    > that 0 or 1 with RUNCODE or do I have to use the codes listed in the
    > Clarion docs?
    >
    > Just needing a little education here..

    You can use something like this to check if an update is available. If it
    is available, call wucheck.exe again to download and execute it.

    RUN('wucheck.exe /S /C')
    IF RUNCODE() = 1 THEN
    MESSAGE('Update available - download and install...', 'Update available')
    RUN('wucheck.exe /S')
    END

    The problem with RUN() in Clarion 6 is, that it is a wrapper around the
    CreateProcess Windows API. CreateProcess will always fail if a non-elevated
    application under Vista/2008/Win7 attempts to launch another application
    whose manifest requires elevation. GetLastError will return 740
    (ERROR_ELEVATION_REQUIRED) in this case. In other words, you can't use the
    Clarion RUN() command with wupdate.exe on UAC-aware operating systems. But
    wucheck.exe does not require administrator execution level privileges, so
    this should work fine here.

    Friedrich

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

    SetupBuilder is Windows 7 installation -- "point. click. ship"

    -- Official Comodo Code Signing and SSL Certificate Partner

  9. #9

    Default Re: Question about silent wucheck?

    I'm running C7.2 7653. Did SV fix it in my version?

    I've seen some negative comments toward RUN in the NG's even for C7.

    Thanks again!
    Don

  10. #10

    Default Re: Question about silent wucheck?

    Hi Don,

    > I'm running C7.2 7653. Did SV fix it in my version?
    >
    > I've seen some negative comments toward RUN in the NG's even for C7.

    Yes, as far as I know, SV changed the RUN() command in C7 to exactly solve
    this UAC "elevation" problem.

    Friedrich

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •