PDA

View Full Version : Running wupdate.exe



NewsArchive
02-26-2009, 12:55 PM
Hello,

still having problems running wupdate.exe from within my clarion app.

I tried some ways:

Run('wupdate.exe')
ShellExec
and Powerrun templates.

But i have no success to run the wupdate.exe.

Any ideas?

Thanks much

Kai

NewsArchive
02-26-2009, 12:55 PM
> still having problems running wupdate.exe from within my clarion
> app.
>
> I tried some ways:
>
> Run('wupdate.exe')
> ShellExec
> and Powerrun templates.
>
> But i have no success to run the wupdate.exe.
>
> Any ideas?

What does "no success to run the wupdate.exe" mean? It does not start, it
bombs out with an error, etc.? I think it's impossible to answer this
question without more (detailed) information. The standard wupdate.exe
gives you an exact error code and you can then check the wupdate.sb6 to see
what happens. The full wupdate.exe source code is provided in wupdate.sb6.

Of course, if you compile your own custom wupdate.exe then only you (the
developer) knows what is going on in the customized wupdate.

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-26-2009, 12:56 PM
Helle Friedrich,

sorry that i posted no details on that problem.

Now i see much more details.

The wupdate.exe will still not executed. But i have noticed if i run my clarion
app as administrator in vista wupdate will started.

Im my wupdate i have only put something to handle the subscription key.

What i have to do, that i can execute the wupdate.exe if the user is not administrator?

Thanks again

Kai

NewsArchive
02-26-2009, 12:57 PM
Kai,

> Now i see much more details.
>
> The wupdate.exe will still not executed. But i have noticed if i run my
> clarion
> app as administrator in vista wupdate will started.

See what I replied in one of my previous postings. If wupdate.exe only
starts from your elevated Clarion application, then it's caused by the
following (taken from the link I gave you before)

---

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.

---

If you check the "EXECUTE" return code, I am sure it is error 740!

> Im my wupdate i have only put something to handle the subscription key.
>
> What i have to do, that i can execute the wupdate.exe if the user is not
> administrator?

Follow my instructions <g>

And please note that there is a fundamental difference between using an
application under an Admin account and running an application with
administrator execution level privileges under Vista, Windows Server 2008,
Windows 7 and Windows Server 2008 R2!

Does this help?

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-26-2009, 12:58 PM
Hi Kai,

> still having problems running wupdate.exe from within my clarion app.
>
> I tried some ways:
>
> Run('wupdate.exe')

Here is what I suggest you do:

1. Add the "Icetips Utilities Classes Global" extension from the Icetips
Utilities to your app.

2. In the local data embed for the procedure where you are doing this:

ITS ITShellClass

3. Replace the code with:

ITS.ITRun('wupdate.exe')

This will handle it:)

Best regards,

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

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

NewsArchive
02-26-2009, 12:59 PM
Hello Arnor,

i still have the global template in my app but donīt get the ITShellClass?

Do i need a local procedure template?

Thanks much Kai

NewsArchive
02-26-2009, 12:59 PM
Hi Kai,

> i still have the global template in my app but donīt get the ITShellClass?
>
> Do i need a local procedure template?

There is nothing to "get" you just add those two lines of code in the embeds
that I suggested, local data embed and the embed where you want to run the
web update:)

>>2. In the local data embed for the procedure where you are doing this:
>>
>>ITS ITShellClass
>>
>>3. Replace the code with:
>>
>> ITS.ITRun('wupdate.exe')

ITS is now an instance of the ITShellClass and you can use it to do this
very easily. ITRun method replaces the Clarion Run and it uses
ShellExecuteEx to run the program.

Best regards,

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

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

NewsArchive
02-26-2009, 01:00 PM
Hi Arnor,

very nice :-)

That will work now.

But i have still probs to get the wupdate.exe without the vista window (if the
user allowed to run the application) running. I have no idea what happen with
this elevation stuff...

I have embeded the vista manifest in clarion. That will not work. I tried your
IT Utilities manifest also. The same problem. When i try to use the manifest
from SetupBuilder i get the message that the manifest is still at the file.
This is when i switch off all manifest stuff in clarion also. It looks that the
manifest is still complied when switched off in clarion too.

How do you do this manifest stuff?

Thanks again

kai

NewsArchive
02-26-2009, 01:01 PM
Hi Kai,

> How do you do this manifest stuff?

I use my template or let SB do it. Depends on what I'm doing.

Why do you say it does not work? If you have an app and you run it under XP
or Vista the buttons in your app will get the XP or Vista button themes if
the manifest is there. If the manifest is not there, they will not.

Best regards,

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

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

NewsArchive
02-26-2009, 01:10 PM
Arnor,

the xp themes will work on my app but i have problem with the elevation of my
app. When i call the wupdate.exe from within my app i get the elevation prompt.
only if i run my app as administrator the wupdate runs without the elevation
prompt. Friedrich give me some infos for this too. but i canīt figure out what
i have to do for the elevation...

thanks much kai

NewsArchive
02-27-2009, 01:23 AM
Hi Kai,

> app. When i call the wupdate.exe from within my app i get the elevation prompt.

That is correct. You will ALWAYS get the prompt. The manifest ONLY tells
how the program will handle when it is run, i.e. if it will force itself to
be elevated (RequireAdministrator) or if it is not elevated (asInvoker).
The web update is always run elevated, so unless your application is also
elevated running the web update will prompt the user to elevate. For
example when I run SB on Vista, if I don't run it elevated, I get an
elevation prompt when I do the "Check for updates"

See
http://www.windowsecurity.com/articles/Understanding-User-Account-Control-Vista.html
- they have a nice writeup on it with screenshots:)

The only way to NOT see the elevation prompts is to turn UAC off, which I do
not recommend.

Best regards,

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

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

NewsArchive
02-27-2009, 01:24 AM
Hello Arnor,

ok, but why some webUpdates still looks if an update is available without
elevation prompt? Ok, when an update is available itīs ok to verify the
program with the elevation prompt but i like a background updatecheck without
user input....

best regards

Kai

NewsArchive
02-27-2009, 01:25 AM
Hi Kai

> ok, but why some webUpdates still looks if an update is available without
> elevation prompt? Ok, when an update is available itīs ok to verify the
> program with the elevation prompt but i like a background updatecheck without
> user input....

Can you name a sample? I don't recall seeing SB webupdate without elevation
prompt unless the program calling it was elevated.

Best regards,

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

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

NewsArchive
02-27-2009, 01:25 AM
Hi Arnor,

i.e. Avira Antivir, Adobe PDF, some of my lenovo thinkpad tools stuff checks
for updates without user input.

Not SB - thatīs true. But what do the other updates other than SB?

Best regards

Kai

NewsArchive
02-27-2009, 01:25 AM
Hi Kai,

> i.e. Avira Antivir, Adobe PDF, some of my lenovo thinkpad tools stuff checks
> for updates without user input.
>
> Not SB - thatīs true. But what do the other updates other than SB?

Friedrich will correct me if I'm wrong, but I understand that SB uses HTTP
protocol to download the manifest file from the server using Winsock
technology. That requires elevation under Vista. I "bypassed" this in a
client project by using NetTalk to download it via FTP (which does NOT
prompt for elevation) to do a silent checking.

Best regards,


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

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

NewsArchive
02-27-2009, 01:26 AM
Hello Arnor,

when this is the reason, why sb canīt use ftp? I think this is a big show
stopper (you say this in english?) ;-)

Best regards

Kai

NewsArchive
02-27-2009, 01:26 AM
> when this is the reason, why sb canīt use ftp? I think this is a big show
> stopper (you say this in english?) ;-)

Well, not a showstopper at all because 90%+ of all companies do not allow
FTP communication today. FTP would result in a support nightmare for you!

Friedrich

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 01:28 AM
perhaps i canīt remove the manifest from my clarion app and use the SB manifest
because i use XPThemes. Itīs possible that XPThemes add the manifest bei
itself?

Best regards
Kai

NewsArchive
02-27-2009, 01:29 AM
Kai,

> the xp themes will work on my app but i have problem with the elevation of
> my app. When i call the wupdate.exe from within my app i get the elevation
> prompt. only if i run my app as administrator the wupdate runs without the
> elevation prompt. Friedrich give me some infos for this too. but i canīt
> figure out what i have to do for the elevation...

If you run YOUR application as administrator, then you'll see the elevation
prompt for YOUR application. You start wupdate.exe from your (already
elevated) application and the elevated privileges are carried over to that
application. So there is no 2nd elevation prompt.

If you run your application asInvoler (non-elevated) and you call
wupdate.exe, then wupdate.exe requests administrator execution level
privileges and you see the elevation prompt.

Does this help?

Friedrich

NewsArchive
02-27-2009, 01:30 AM
Hello Friedrich,

yes i understand that for now.

But how can tools like avira antivir check for updates without user input?

If i like to check for updates ones a day it is not comfortable for the users
to interact with something about the update check. for me the user can get the
elevation prompt when there is something to update but i donīt understand why
the check for updates will need that. when my prog calls some dllīs there is no
need for any elevation.

Thanks and best regards

Kai

NewsArchive
02-27-2009, 01:31 AM
>
> when my prog calls some dllīs there is no need for any elevation.
>

Yes, and will fail if your DLL has to handle per-MACHINE operations.

Please keep in mind, you install your application per-MACHINE, not per-USER!
So you also have to do web updates system wide.

By the way, virus scanner, etc. are always running with full rights.

Hope this helps.

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 03:21 AM
Hello Friedrich,

ok. But this will be a big problem for my app.

I will release a new app next time. And i was looking for an webupdate because
i donīt need to send a mail to my customers if the user needs an importend
update. No company will check for updates manually every day :-( and running
the updater every day, the user have to accept the elevation message and there
are no new updates will get frustrated users too...

I have no idea how to handle this.

I know - itīs not on you - itīs on Vista - but i hoped this update stuff is
much more easier to handle.

Thanks much for your help!!!

Kai

NewsArchive
02-27-2009, 03:21 AM
You can solver this very very very easily. Use the WinINet Interface in
Windows to download the manifest file from within your application. This
manifest file is a standard INI file. For example:

[SB5UPDATE]
Version=1.1.0.0
Setup=my_update.exe

Once downloaded, check the "Version" from the downloaded INI against the
installed version on the target machine. If you don't know where this is
stored, let me know. Then, when a new version is available, start
wupdate.exe and this will download and execute the update.

"Big problem" solved ;-)

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 03:22 AM
Just check out Clarion Mag.

http://www.clarionmag.com/cmag/v7/v7n08webfetch.html

This is the full source code to retrieve the INI (manifest) file from your
website and put it in a string field.

Does this help?

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 03:22 AM
Sorry, but have no clarionmag account...

Kai

NewsArchive
02-27-2009, 03:23 AM
>
> Sorry, but have no clarionmag account...
>

As a Clarion developer, you really should have a subscription because
ClarionMag is there to READ-LEARN-SOLVE ;-)

Friedrich

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 03:23 AM
Ok, i will have a look at this clarionmag.

Thanks Kai

NewsArchive
02-27-2009, 03:24 AM
Hello Friedrich,

thatīs would be what i need :-)

Looks today is a better day than yesterday ;-)

But i have no idea with the WinInet ... do you have any sample for this?

Thanks again

Kai

NewsArchive
02-27-2009, 03:25 AM
Hello Friedrich,

itīs very strange - i tried to download the ini-file with an autoit script:

InetGet ( "http://www.mysite.de/version.ini", "version.ini" ,1 ,1 )

Compiled the script and call the small tool from within my app. I get
downloaded the version.ini - without any elevation prompt! Something i have
donīt understand with the elevation.

I donīt understand why i can run my small "getini.exe" for downloading the ini
file without elevation prompt and get the elevation prompt when using
wupdate.exe.

Ok, now i have to figure out the rest.

Best regards

kai

NewsArchive
02-27-2009, 03:25 AM
Kai,

> itīs very strange - i tried to download the ini-file with an autoit
> script:
>
> InetGet ( "http://www.mysite.de/version.ini", "version.ini" ,1 ,1 )
>
> Compiled the script and call the small tool from within my app. I get
> downloaded the version.ini - without any elevation prompt! Something
> i have donīt understand with the elevation.
>
> I donīt understand why i can run my small "getini.exe" for downloading
> the ini file without elevation prompt and get the elevation prompt when
> using wupdate.exe.

No, it's not strange at all. Arnór already explained it perfectly (see a
few messages up).

The core Winsock technology requires elevation under Vista, Server 2008 and
Windows 7. That's why I suggested you should use the WinINet Interface to
download the manifest.

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 03:26 AM
Ok,

sorry i donīt understand this.

Iīm not a professional programmer. I have to do some database stuff. I use
clarion because i can use the templates and have nothing to handcode. I canīt
handcode.... a little bit scripting, know about variables and something more
but iīm not a ******** programmer. I do this as my hobby.

Because that sorry if i donīt understand this difference beetween winsock and
wininet. i have to have a look at this first to understand the difference.

Best regards

Kai

NewsArchive
02-27-2009, 03:32 AM
Kai, have you looked at SafeUpdate from Capesoft?
There is autoupdate option
Darko

NewsArchive
02-27-2009, 03:32 AM
Hello Darko,

thanks for the hint. But i will give SB some more chance :-) I like the
fexibility and the subscription features that i need.

Best regards

kai

NewsArchive
02-27-2009, 03:33 AM
> thanks for the hint. But i will give SB some more chance :-) I like the
> fexibility and the subscription features that i need.

Thanks for giving SetupBuilder another chance <g>

Some time ago (you can't know it) I mentioned in a thread that "SetupBuilder
7" will provide a function to support downloads from a server even if the
application is running "non-elevated". In other words, in SetupBuilder 7
you'll be able to develop a mechanism that checks for updates without any
elevation prompt on a UAC-aware system.

Friedrich

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 03:34 AM
Hi Friedrich,

:-)

when is Version 7 released? When itīs not to late, i wait for the update and
donīt have to waste my time with looking for workarounds at this time.

Thanks and best regards

Kai

NewsArchive
02-27-2009, 03:34 AM
> when is Version 7 released? When itīs not to late, i wait for the update
> and donīt have to waste my time with looking for workarounds at this time.

We'll make an announcement next week...

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-27-2009, 05:12 AM
> sorry i donīt understand this.
>
> Iīm not a professional programmer. I have to do some database stuff. I
> use clarion because i can use the templates and have nothing to handcode.
> I canīt handcode.... a little bit scripting, know about variables and
> something more but iīm not a ******** programmer. I do this as my hobby.

Aha, okay. I understand... :)

> Because that sorry if i donīt understand this difference beetween winsock
> and wininet. i have to have a look at this first to understand the
> difference.

Winsock is the lowest level Windows API for TCP/IP programming. We need
access to Winsock to optimize HTTP access through all kinds of firewalls and
proxy servers. The User Account Control (UAC) security feature (in Vista,
Windows 2008 and Windows 7) has an effect on "Layered Service Providers"
(LSP) writers as the Winsock functions to install and remove LSP entries.
Applications running non-elevated (asInvoker) do not have access to Winsock.

Here are some interesting links on MSDN.

- Winsock documentation:
http://msdn.microsoft.com/en-us/library/ms740673%28VS.85%29.aspx

- WinINet documentation:
http://msdn.microsoft.com/en-us/library/aa385483.aspx

And Jane Fleming writes excellent articles on ClarionMag (User Account
Control Security, Coping with Vista, code-signing, etc.).

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
02-28-2009, 12:59 AM
Kai,

> when is Version 7 released? When itīs not to late, i wait for the
> update and donīt have to waste my time with looking for workarounds
> at this time.

Please see new 'Check for web updates "non-elevated"' thread.

Friedrich

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

SetupBuilder "point. click. ship"
Create Windows Vista ready installations in minutes

-- Official Comodo Code Signing and SSL Certificate Partner