PDA

View Full Version : Chaining an SB7 install from within Clarion on Win7



NewsArchive
01-02-2010, 03:22 AM
Ok, don't know if this is the right spot, all I know, is you guys give good
answers, so here goes.

My application begins by checking it's version against the version of the
database it's hitting. If the Database (hence server) has been updated,
then the application knows it needs to update itself.

It also knows, that the patch to the client apps exists in the path
\\server\hiddenfolder$\clientupdate.exe
Clarion properly tests that the file exists, and the version of the file
matches the version of the database, and then asks "do you want to update
your client software?".

User hits, "yes", and clarion executes a "CHAIN(LOC:ClientExePath)"
where LOC:ClientExePath = \\server\hiddenfolder$\clientupdate.exe

nothing happens.
I have read articles about making sure the manifest is correct, but to be
bluntly honest, I am not sure I understand what the manifest should be tied
to.

Background: The clientupdate.exe is a SB7 installer, which is contained
within serverupdate.exe, and is installed when the server is updated.

I know I am rambling, I just don't know what question to ask. I know this
has something to do with the Win7 UAC, and the fact that the app is running
in user mode...

Can anyone point me in what direction I need to go next?

Thanks for you help!!!
-Glenn.

NewsArchive
01-02-2010, 03:23 AM
Glenn

>I know I am rambling, I just don't know what question to ask. I know this
>has something to do with the Win7 UAC, and the fact that the app is running
>in user mode...

I see a few things that I would look at here...

1: to give the process half a chance to work, get rid of CHAIN. Replace it with a
ShellExecute call, and then close your currently running program.

2: Your CW exe is running in user mode. But you most likely need the serverupdate.exe
to run as Administrator. This may be OK, but check what you have it set to within your
SB7 script.

That's my 2 cents. Hope it helps.

John Griffiths

NewsArchive
01-05-2010, 02:42 AM
Ok, ShellExecute worked, sort of...

It called the setup, and invoked the "UAC/Do you want to allow..." window,
however, it invoked it minimized.
This seemed really weird. I am using 5 for the SWSHOW, which, to my
understanding, should show it with focus...
hmm... any ideas?

This works, but I for-see several user calls saying "I told it to patch, and
now it's hung up not doing anything, and what is this flashing shield in my
start bar?"

Any help is appreciated!

PS. Thanks Friedrich for kicking my thread off.

Glenn Paschal

NewsArchive
01-05-2010, 02:43 AM
Glenn

You should use

SW_SHOWNORMAL equate(1)
and not
SW_SHOW equate(5)

And I hope you are using ShellExecuteA

Here is the map statement I use ...
MODULE('Windows.DLL')

ShellExecute(LONG,*CSTRING,*CSTRING,*CSTRING,*CSTR ING,LONG),LONG,PASCAL,RAW,NAME('ShellExecuteA'),PR OC
END

And maybe you might try minimising your caller app as soon as you issue the
ShellExecute. But more than likely using the SW_SHOWNORMAL should solve the problem.

HTH

John Griffiths

NewsArchive
01-05-2010, 02:43 AM
Hi Glenn,

The Clarion RUN or CHAIN commands are a wrapper around CreateProcess.

http://www.lindersoft.com/forums/showthread.php?p=28915#post28915

Did you try this Clarion ShellExecuteEx Demo:

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

Friedrich

NewsArchive
01-07-2010, 02:44 AM
Loved your example, and incorporated it into my code, but still had the same
problem.
Rather perplexing at first, because if I run yours, give it my install, it
works fine, but in mine it still popped up in background.
So, I started looking at the differences. I am calling a function
(TCS_ShellExecute) which has all the code within it.
Rather than using window{prop:handle}, I was using GetDesktopWindow(), since
my function didn't have a window of it's own.
Bingo... there is the problem. I realize I could have passed in the handle
from the calling window to the function, but it was easier to just create an
empty window of size 0x0, open it, call ShellExecuteEX, and then close the
window, which worked perfectly.

I suspect that the old code would also work with this scenario, but not
worth the time to go back and fart with it.

At any rate, thanks to both of you for all your help!

-Glenn.