Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RE: execute something AFTER the installation is finished

0 views
Skip to first unread message

Gary Chang[MSFT]

unread,
Sep 9, 2005, 4:49:32 AM9/9/05
to
Hi doc,

>Which modifications should I do to a MSI database that
>allow to spawn a new process whilst the installation process
>itself is finished?

The general convention to run a program in the end of the installation
process is using an asynchronous CA,

you can call the following VBScript in the CA:

Set WShell = CreateObject("WScript.Shell")
WScript.Sleep 1000
WShell.Exec <the fullname of target program>

By default, the Exec method doesn't wait for the initiated process to
terminate, so you may need to postpone

a little time to spawn the new process.

Please refer to MVP Phil's wonderful book <<The Definitive Guide to Windows
Installer>> for the details:
Chapter 14 - How-Tos, Tips, and Gotchas


Thanks!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! :C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Phil Wilson

unread,
Sep 9, 2005, 11:45:00 AM9/9/05
to
Some tools have IDE support for firing a custom action off a button, some
don't. The internal mechanism is in the ControlEvent table for the form,
where you'd add a DoAction event to the list things that happen when the
Close button is clicked (which is probably just an EndDialog in your current
setup).
--
Phil Wilson
[Microsoft MVP-Windows Installer]

Definitive Guide to Windows Installer
http://apress.com/book/bookDisplay.html?bID=280

"docschnipp" <docsc...@newsgroup.nospam> wrote in message
news:1E00BF0E-BB4F-4130...@microsoft.com...


>
>
> ""Gary Chang[MSFT]"" wrote:
>
>> Hi doc,
>>
>> >Which modifications should I do to a MSI database that
>> >allow to spawn a new process whilst the installation process
>> >itself is finished?
>>
>> The general convention to run a program in the end of the installation
>> process is using an asynchronous CA,
>>

>> By default, the Exec method doesn't wait for the initiated process to
>> terminate, so you may need to postpone
>>
>

> and how do I need to attach that in with the CLOSE button on the last
> dialog?


>
>>
>> Please refer to MVP Phil's wonderful book <<The Definitive Guide to
>> Windows
>> Installer>> for the details:
>> Chapter 14 - How-Tos, Tips, and Gotchas
>>
>

> will do, thanks
>
> doc
>


docschnipp

unread,
Sep 11, 2005, 5:05:02 AM9/11/05
to
Hi,

"Phil Wilson" wrote:

> Some tools have IDE support for firing a custom action off a button, some
> don't. The internal mechanism is in the ControlEvent table for the form,
> where you'd add a DoAction event to the list things that happen when the
> Close button is clicked (which is probably just an EndDialog in your current
> setup).

now I tried this:

In table ControlEvent:

already present:
(FinishedForm,CloseButton,EndDialog,Return,1,1)

I added:
FinishedForm,CloseButton,DoAction,ExecuteDeviceUpdater,-,2

In table CustomAction:

ExecuteDeviceUpdater,210,_786C22ABA1A5409294157DEAB5FA3D40,-


(_786C22ABA1A5409294157DEAB5FA3D40 is the key in the field "file", table
"File" of the installed executable).

(210 means CustomAction type 18 + 192:

0 Immediate execution.
0 Always execute. Action may run twice if present in both sequence tables.
192 msidbCustomActionTypeAsync + msidbCustomActionTypeContinue
18 Custom Action Type 18 (EXE file that is installed with a product.)


Actually this should be enough, but after hitting the close button i get
an "error 2762".

Is there something I miss?

thanks for your answers
doc


Ste

unread,
Sep 11, 2005, 10:31:31 AM9/11/05
to
An alternative may be to wrap the installer in another exe/bat file eg

Setup.bat
{
misexec xxxx // invoke msi
// must be finished now....
myapp.exe // Run your application
}


docschnipp

unread,
Sep 11, 2005, 10:46:04 AM9/11/05
to
"Ste" wrote:

a good hint, but:

We want to deliver a single MSI file and since these things are actually
possible I really want to do it the MSI way.

thanks
doc

Ste

unread,
Sep 11, 2005, 10:53:58 AM9/11/05
to
You may still be able to achieve a single file solution..

It is possible [and easy] with winzip or winrar for example to archive your
"starter" applications into a single sfx file
and then tell the sfx to invoke the "wrapper bat" upon extraction. You end
up with install.exe -> decompresses to give you
Setup.bat, already mentioned, which is immediately invoked.

Not the cleanest of solutions, but quick and easy if time requirements are
limited.

"docschnipp" <docsc...@newsgroup.nospam> wrote in message

news:95ED371A-CC87-430B...@microsoft.com...

Gary Chang[MSFT]

unread,
Sep 13, 2005, 11:34:42 PM9/13/05
to
Hi doc,

I just found you have already opened a new thread on this issue, we will
follow you in that thread soon.

0 new messages