PDA

View Full Version : Web Update program



NewsArchive
04-09-2010, 02:31 AM
Friedrich,

I've a client that on one machine, the wupdate.exe does not appear to run
anymore. This is the code I've placed in my app that calls it:

IF EXISTS(CLIP(GLOV:RootEXEPath) & '\wupdate.exe')
!If wupdate.exe exists, which it should
RUN(CLIP(GLOV:RootEXEPath) & '\wupdate.exe')
!Run it and it checks for updates
END

This works fine on other workstations and used to work on this one. If they
open the program location folder with Windows Explorer and double-click on
wupdate.exe, it then runs perfectly. The above also works perfectly on my
machine.

Any ideas?

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 02:32 AM
Russ,

>
> Any ideas?
>

It's not a good idea to use the RUN() command. The Clarion RUN() command 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.

It's not a wupdate.exe problem but an issue with how you launch an
application.

Does this help?

Friedrich

NewsArchive
04-09-2010, 02:32 AM
BTW, ShellExecuteEx is the way to go!

Here is a quick and dirty demo (for Clarion developers).

http://www.lindersoft.com/projects/ClarionShellExec.zip

Friedrich

NewsArchive
04-09-2010, 02:32 AM
Thanks!

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 02:33 AM
Since wupdate always works except in one isolated case of how I called it, I never
lost faith in it <g>. I was just curious why this one workstation (Win7) suddenly
can't run it anymore from the RUN command. I figured it had something to do with
elevation and your reply strengthens that suspicion.

Do you have any theories why the sudden change? I've not changed anything in this
area of the program I quite some time. I don't even think I changed the
manifest - maybe <g>.

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 02:33 AM
> Since wupdate always works except in one isolated case of how I called it,
> I never lost faith in it <g>. I was just curious why this one workstation
> (Win7) suddenly can't run it anymore from the RUN command. I figured it
> had something to do with elevation and your reply strengthens that
> suspicion.
>
> Do you have any theories why the sudden change? I've not changed anything
> in this area of the program I quite some time. I don't even think I
> changed the manifest - maybe <g>.

Perhaps he played with his UAC level or launched your application elevated
(instead of non-elevated) in the past?

If 1.) UAC is enabled and 2.) your application is running non-elevated and
3.) tries to launch wupdate.exe (an application whose manifest requires
elevation) then CreateProcess will always fail on an UAC-aware operating
system (Vista, Windows 2008, Windows 7 and Windows 2008 R2).

BTW, you can also use the wucheck.exe client to "check for updates"
non-elevated and there is no elevation prompt on UAC-aware systems.

Friedrich

NewsArchive
04-09-2010, 02:34 AM
Funny thing is that there is no indication of failure, no messages of any kind.
Its like a menu item that is merely defined - no code or procedure calls under it.
IOW - nothing happens.

>
> BTW, you can also use the wucheck.exe client to "check for updates" non-elevated
> and there is no elevation prompt on UAC-aware systems.
>
> Friedrich
>

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 02:34 AM
> Funny thing is that there is no indication of failure, no messages of any
> kind. Its like a menu item that is merely defined - no code or procedure
> calls under it. IOW - nothing happens.

Do you check the RUN error code? Windows will silently return Error 740 (it
will not display a message box) in this case and will not launch the
application at all!

Friedrich

NewsArchive
04-09-2010, 02:40 AM
As you can see from my code, I'm missing the RunCode check. I'm adding it <g>

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 02:40 AM
>
> As you can see from my code, I'm missing the RunCode check. I'm adding it
> <g>
>

<G> And I bet you'll see error 740 after doing this :)

Friedrich

NewsArchive
04-09-2010, 02:40 AM
Won't give it the chance - I'm replacing it with the ShellExecuteEx code. :-)

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 02:41 AM
FWIW, Russ... one of my old clarionmag articles has an example showing that
ShellExecute does work to launch an elevated app from a non-elevated app,
whereas RUN or CHAIN fail silently (unless you check for runcode)
(toward the bottom): http://www.clarionmag.com/cmag/v9/v9n04vista2b.html

Jane

NewsArchive
04-09-2010, 02:42 AM
I've not used CHAIN since the DOS days <g>.

But too late - converted to ShellExecute already, about to deliberately sabotage
the program to see if it reacts as I think it should. <g>

Seriously, appreciate the reference. I always fall back to those articles when I
need to remember that "elevated" is not referring to my blood pressure! <g>

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 02:44 AM
And they're great for insomnia (not to mention non-habit-forming <g>)

Jane Fleming

NewsArchive
04-09-2010, 02:44 AM
I'm waiting for the books on tape or the DVD version. Director's cut of course!

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 11:01 AM
On one machine, I'm getting the manifest not found message with a return code
of -7. The same code works on all other machines. If memory serves, you have an
entry under Lindersoft with the GUID of my web update; could it be pointing to the
wrong location?

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 11:01 AM
Russ,

> On one machine, I'm getting the manifest not found message with a return
> code of -7. The same code works on all other machines. If memory serves,
> you have an entry under Lindersoft with the GUID of my web update; could
> it be pointing to the wrong location?

It should display something like that:

---
Cannot download server manifest file.

Network Communication Error: %_SB_ERRORCODE%
---

%_SB_ERRORCODE% should be a WinSock error code. IMO, the machine blocks
access from wupdate.exe to your server (firewall problem, etc.).

Friedrich

NewsArchive
04-09-2010, 11:02 AM
Thanks - will investigate the firewall. The error code I think is 501.

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 11:03 AM
BTW - I've added the firewall exception in the install script some time ago:

%_SB_INSTALLDIR%\wupdate.exe

Are there conditions that would prevent this from happening?

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-09-2010, 11:03 AM
Russ,

> BTW - I've added the firewall exception in the install script some time
> ago:
>
> %_SB_INSTALLDIR%\wupdate.exe
>
> Are there conditions that would prevent this from happening?

The firewall exception is for the Windows firewall only. If there is
another "firewall thing" (e.g. ZoneAlarm) involved then the exception does
not help. And it's also possible that it is a proxy server issue.

Friedrich

NewsArchive
04-10-2010, 02:01 AM
I think we are speaking of Windows' firewall and its in there. I'll just be sure
it's the correct version.

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-11-2010, 05:12 AM
Friedrich,

The thot plickens <g>.

Can't find anything that is blocking the wupdate.exe program on this one machine.
Its XP, so no UAC issues. My XP machine works perfectly (one of my test systems).
Still gets the manifest not found 503 error message. No virus programs running.
Just got word one other XP machine is also having this problem. No idea yet if
other XP machines have this issue. I do know a Vista and one Win7 machine works
fine.

My only workaround right now is to have these users download a new install and run
it instead.

I'm convinced this their local environment, but stumped as what to look for next.
If you have any guesses (even wild a** ones <g>), I'm willing to look into
anything right now. I know its not wupdate.exe, I've proven that. But something
is blocking its outside access and it could be anything. No Zone Alarm, Norton
turned off, there are firewall exceptions for it.

Also, just now had him install on another XP machine and it worked. Clearly, not
all XP systems are created equally <g>

Guesses anyone?

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-11-2010, 05:13 AM
Russell - this may not help but then again ...

Is this a XP Pro machine? If so read on!

I have recently been having issues running apps on XP that work on
Vista/Win7. They install fine and whatever I try could not find a solution.

Eventually I narrowed it down to Win XP PRO. The same application worked on
standard Win XP.

So I knew that 7 of my clients could not run my applications and ALL were on
XP Pro (SP2 or SP3).

So I reformatted a machine here with XP Pro with a normal setup and guess
what - my applications worked. 2 of my clients also reported spurious issues
so they reformatted their own machines and the SAME application worked that
time for them.

So the only conclusion I could come up with is that some versions of XP Pro
are prone to some weird setup issues. Firewalls and anti virus/spyware
solutions could be ruled out and I am suspecting something to do with
permissions. But again ONLY ever on XP Pro.

I am not sure if this helps at all but is this machine an XP Pro machine????

HTH

John Fligg

NewsArchive
04-11-2010, 05:15 AM
Russ,

> My XP machine works perfectly (one of my test systems). Still gets the
> manifest not found 503 error message.

I assume "503" is: "503 Service Unavailable -- The server is currently
unavailable (because it is overloaded or down for maintenance)".

Three digit response status codes beginning with the digit "5" indicate
cases in which the server is aware that it has encountered an error or is
otherwise incapable of performing the request.

As I interpret it, it is a server problem. Just for fun, ask him to install
SetupBuilder (he can uninstall it later <g>) and to use the "Check for
Update" functionality. If it also returns "503" then it is a problem with
his machine. If it works okay, then it's a problem with your server.

Friedrich

NewsArchive
04-12-2010, 01:35 AM
John,

I've no idea, I can check. But if it is, I don't think formatting is a viable
solution! <g>

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-12-2010, 01:37 AM
Actually, he's thinking of upgrading to Win7 - if his machine can handle it.

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-12-2010, 01:40 AM
My apologies Friedrich, I used a typical American (and British) custom -
abbreviated the long error number into something shorter. It is the error code
beginning with 503 (manifest not found).

He then installed my program on another XP machine and the update worked. Same
network. So its definitely *not* anything you supply. Please understand that I'm
not reporting a bug here, just trying to get some ideas in my limited knowledge of
networks. Figured there would be others here that could jump in.

So apologies again if I am not using your newsgroup correctly.

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm

NewsArchive
04-12-2010, 01:40 AM
Russ,

> My apologies Friedrich, I used a typical American (and British) custom -
> abbreviated the long error number into something shorter. It is the error
> code beginning with 503 (manifest not found).
>
> He then installed my program on another XP machine and the update worked.
> Same network. So its definitely *not* anything you supply. Please
> understand that I'm not reporting a bug here, just trying to get some
> ideas in my limited knowledge of networks. Figured there would be others
> here that could jump in.
>
> So apologies again if I am not using your newsgroup correctly.

You are using the newsgroup correctly ;-)

I think you mentioned Error -7 (that is returned to your app from
wupdate.exe).

The wupdate.exe displays:

---
Cannot download server manifest file.

Network Communication Error: %_SB_ERRORCODE%
---

As I understand it, %_SB_ERRORCODE% is "503". But that would be HTTP error
503 and is reported from your server.

Or is it "5030", followed by a 5 digit WinSock Error code?

Friedrich

NewsArchive
04-12-2010, 01:41 AM
BTW, the first 4 digits tell us where in the HTTP component the error
happened (e.g. 5030 = "connect" WinSock API). The code after that is the
WSAGetLastError() API return code.

For example, 100054 = WSAECONNRESET = "Connection reset by peer (server
process failed)"

The following HTTP component errors are defined:

5020 - After the "socket" API call.
5030 - After the "connect" API call.
5040 - After the "send" API call which returned a SOCKET_ERROR.
5050 - After the "recv" API call which returned a SOCKET_ERROR and
WSAGetLastError returned WSAETIMEDOUT.
5060 - HTTP stream did not include data package size information.
5070 - After the "recv" API call (Atomic clock functionality only).

So the last 5 digits are the WinSock error. Do you know what is returned?

Friedrich

NewsArchive
04-12-2010, 01:43 AM
Let me get the exact error code for you.

--
Russell B. Eggen
www.radfusion.com
Clarion developers: www.radfusion.com/devs.htm