PDA

View Full Version : Question on launching update EXE



NewsArchive
04-06-2011, 12:52 AM
This concerns Windows 7 UAC messages.

I've modified the wucheck.sb7 for my own needs. Its been workign great for a
couple of years.
It is manifested "as Invoker"

MY program is also manifested as "as Invoker".

I've tried launching my SetupBuilder created update checker EXE in two
different ways.

Using RUN(MyUpdateCheckFilename, 0) it launches the EXE with no UAC message.

Using ...
Operation = 'open'
AssocFile = MyUpdateCheckFilename
Param = ''
Directory = MyProgramFolder
RetVal = ShellExecute(0, Operation, AssocFile, Param, Directory,
3)

It DOES display the UAC message.

Can anyone please let me know if there are disadvantages using RUN to avoid
UAC message.

Thank you very much for your insights.

Mike

NewsArchive
04-06-2011, 12:53 AM
Mike,

The following is a link to a "quick-and-dirty" (Clarion) ShellExecuteEx demo
source code:

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

It does not launch the application elevated by default.

I have "asInvoker" manifested and code-signed the binary:

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

Works without any problem and launches the app non-elevated. BTW, it's just
a quick test to see if it runs elevated or not.

Friedrich

NewsArchive
04-07-2011, 12:16 AM
Mike,

The disadvantage is that if ANYTHING the app you're launching does requires
elevated access, then it won't work.

If you have a clarionmag subscription, you can try the little demo app
included with this article:
http://www.clarionmag.com/cmag/v9/v9n04vista2b.html

It shows how RUN or CHAIN won't launch an elevated app from a non-elevated
app. And if you launch a non-manifested app that tries to do something that
requires elevation, its actions will be virtualized instead.

But you say your version of wucheck.exe is manifested asInvoker. So I'm
surprised you're seeing the UAC prompt anyway. If you run wucheck yourself
(rather than launching it from the installer) do you still see the UAC
screen?

Jane

NewsArchive
04-07-2011, 12:17 AM
Thank you both very much!

Michael Brooks

NewsArchive
04-07-2011, 12:18 AM
May I trouble you with an additional question?

You have these flags:
sei.fMask = SEE_MASK_NOCLOSEPROCESS +
SEE_MASK_FLAG_DDEWAIT + SEE_MASK_FLAG_NO_U


I do not want to wait for the return value from the call. I just want to
launch it and immediately return.

What modifications to these flags are needed ?

Michael Brooks

NewsArchive
04-07-2011, 12:18 AM
SEE_MASK_NOCLOSEPROCESS -- Use to indicate that the hProcess member receives
the process handle. This handle is typically used to allow an application to
find out when a process created with ShellExecuteEx terminates. In some
cases, such as when execution is satisfied through a DDE conversation, no
handle will be returned. The calling application is responsible for closing
the handle when it is no longer needed.

SEE_MASK_FLAG_DDEWAIT -- In fact, we should not use it here (but it works
okay). We should use SEE_MASK_NOASYNC instead to wait for the execute
operation to complete before returning.

SEE_MASK_FLAG_NO_U -- Do not display an error message box if an error
occurs.

If you do not wait, then you can remove SEE_MASK_NOCLOSEPROCESS and the
SEE_MASK_FLAG_DDEWAIT flags.

Friedrich