PDA

View Full Version : Problem with waiting for InstallShield to complete



NewsArchive
11-26-1997, 01:00 AM
I had a problem with executing the Acrobat Reader Installation from
InstallShield, if ISX should wait for Acrobat to finish. It just hangs the
installation program.

Actually I had the same problem with most applications which is using
InstallShield for Setup.

Therefore I made my own setup, which was supposed to execute the following
installations:

BDE installation
Acrobat Reader Installation
DCOM 95 Installation
Internet Explorer 3.02 installation

The only thing I use InstallShield for now, is the BDE installation.
If I call it from my application with WinExecAndWait32, nothing happens, the
process just hangs !!!

With my own setup, I can now install and wait for DCOM, Internet Explorer
and Acrobat without problems, but I cannot do this with BDE.

Why is InstallShield so problematic ??? I can't use it for a simple BDE
installation ? I bought the ISX professional, but I can't use it for
anything... I can't even get it in the Danish language :-(

Grrrrr.... I have a deadline in 10 hours....

Best regards
Jonas Hjordie

NewsArchive
11-26-1997, 01:00 AM
On Wed, 26 Nov 1997 02:59:51 +0100, "Jonas Hjørdie" <jonas@netcreation.dk>
wrote:
>Actually I had the same problem with most applications which is using
>InstallShield for Setup.

Can you elaborate a bit more?

>If I call it from my application with WinExecAndWait32, nothing happens, the
>process just hangs !!!

You should use CreateProcess().

>Why is InstallShield so problematic ??? I can't use it for a simple BDE
>installation ? I bought the ISX professional, but I can't use it for

InstallShield uses a 16-bit stub called Setup.exe which then launches the
appropriate setup executable and hence your setup hangs because the
executable's WindowHandle is only accessible through the 16-bit subsystem.

CreateProcess() will launch both 16-bit and 32-bit applications.

Stefan
ellipse data systems

NewsArchive
11-27-1997, 01:00 AM
>>Actually I had the same problem with most applications which is using
>>InstallShield for Setup.
>
>Can you elaborate a bit more?


Adobe Acrobat Reader uses InstallShield... I cannot install it and wait for
it to complete the installation.. The same thing about my simple BDE
installation program, from which I have removed all user-interaction
dialogs.

Funny enough, I CAN do it with Internet Explorer 3.02, which also uses
InstallShield :-)

>>If I call it from my application with WinExecAndWait32, nothing happens,
the
>>process just hangs !!!
>
>You should use CreateProcess().

I do use CreateProcess()... WinExecAndWait32 is a function I found in a
Delphi FAQ, and it uses CreateProcess and WaitForSingleObject to execute the
program.

-but it seems that when using WaitForSingleObject on some InstallShield
setups, everything just stops when the ISX stub in running, until I
terminate the calling process in the task manager (Ctrl-Alt-Del + End
Task)... no dialogs has been displayed on the screen at this point.

When the calling process has terminated, InstallShield continues the
installation.... very strange, but try for yourself...

>InstallShield uses a 16-bit stub called Setup.exe which then launches the
>appropriate setup executable and hence your setup hangs because the
>executable's WindowHandle is only accessible through the 16-bit subsystem.
>
>CreateProcess() will launch both 16-bit and 32-bit applications.


I know the setup launches through the stub, but if the stub exits
immediately, this should not be the problem. WaitForSingleObject just
returns when the stub has launched then setup, I suppose... -so actually it
shouldn't be possible at all, to wait for installShield to finish.

-but as I said, it could be done with IE3.02, so maybe they have made their
own InstallShield :-)


By the way, I found another temporary solution. I just add Acrobat Setup to
the RunOnce key in the registry, so it installs after the computer has
restarted...

Best regards
Jonas Hjordie

NewsArchive
11-27-1997, 01:00 AM
On Thu, 27 Nov 1997 18:26:53 +0100, "Jonas Hjørdie" <jonas@netcreation.dk>
wrote:
>Adobe Acrobat Reader uses InstallShield... I cannot install it and wait for
>it to complete the installation.. The same thing about my simple BDE
>installation program, from which I have removed all user-interaction
>dialogs.

As I said, it is because SETUP.EXE is a 16-bit stub program that launches
the other "proper" installer.

>Funny enough, I CAN do it with Internet Explorer 3.02, which also uses
>InstallShield :-)

IE 3.02 does not use InstallShield. It uses a proprietary installation
program by Microsoft. And since that is a 32-bit only package,
InstallShield is able to wait.

>I do use CreateProcess()... WinExecAndWait32 is a function I found in a
>Delphi FAQ, and it uses CreateProcess and WaitForSingleObject to execute the
>program.

Ahhh I see. Try using CreateProcess() on its own.

>setups, everything just stops when the ISX stub in running, until I
>terminate the calling process in the task manager (Ctrl-Alt-Del + End

The stub terminates after launching the proper installation and that is
where your application fails.

>When the calling process has terminated, InstallShield continues the
>installation.... very strange, but try for yourself...

See above.

>I know the setup launches through the stub, but if the stub exits
>immediately, this should not be the problem. WaitForSingleObject just
>returns when the stub has launched then setup, I suppose... -so actually it

WaitForSingleObject is, when you look under the Win32 help, a 32-bit
signalling function, which does the same as FindWindow. I suggest you use
CreateProcess(), and then FindWindow(). You know what the Setup Window
caption is, but not the class. Then you would use FindWindow as follows:

FindWindow(nil,'title of setup here');

Please note that I used a literal string. If you want to use a variable,
use PChar(Variable) instead of the literal string.

Your WinExec32 fails because the window that WaitForSingleObject is
supposed to check the signal on is running in a shared 16-bit environment.

>By the way, I found another temporary solution. I just add Acrobat Setup to
>the RunOnce key in the registry, so it installs after the computer has
>restarted...

You can use that too. I will consult with InstallShield on this question.

Stefan
ellipse data systems