cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Amarjeet
Level 7

Install exec condition for a custom action when executed from command prompt.

Hi

I am trying to execute a custom action while installing patch. I want two separate custom actions. One which executes only when user installs by manually installing patch from Install shield GUI.

Other custom action should get executed only when user installs patch from command line using msiexec.exe

How to condition this ?

Regards,

Amarjeet
Labels (1)
0 Kudos
(7) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

I don't believe there is a foolproof method of checking whether an installation or patch was launched from the command prompt. Here are a couple of somewhat similar things that might match your needs closely enough:

If your criterion is whether setup.exe/update.exe was used to launch the patch, a condition could check for properties set by setup.exe/update.exe such as SETUPEXEDIR and SETUPEXENAME.
If your criterion is whether the installation is silent, the condition could check the UILevel property.
If you want to give explicit control of this to the end user, the condition could check a custom public property and you can document providing this property on the command line.
0 Kudos
Amarjeet
Level 7

Hi Michael,

My patch file is .msp. I would like to invoke setup of another .exe from custom action. I don't want to give user any control.

Anyway thanks for your advice.

Regards,

Amarjeet
0 Kudos
Amarjeet
Level 7

Hi Michael,

Referring to above conversation - I would like to invoke a custom action which installs .net framework when user clicks Finish button on setupcompletesuccess dialog box. How to accomplish this ?

I did tried this by setting install and exec sequence to . But this does not work and I get error. Cause of this error is custom action is not inserred inbetween Installinitialise and installfinalise sequence.

Any idea why I am getting error.

Regards

Amarjeet
0 Kudos
DLee65
Level 13

Amarjeet,

Look up the specification for a deferred custom action. It has to be scheduled between InstallInitialize and InstallFinalize.
https://msdn.microsoft.com/en-us/library/aa368268%28v=vs.85%29.aspx

I am amazed that you are still trying to deploy .NET Framework as part of a patch file. Good luck to you man.
0 Kudos
Amarjeet
Level 7

Hi Dan,

I have already done this with my solution1. It is working well from GUI and Silent installation. I am exploring other options in case I can find better solution.

I am definitely going to inform you once I finalise my proposed solution. Till that time keep fingers crossed.

Regards,

Amarjeet
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

If you need to ensure that .NET gets installed, I would strongly suggest not doing so from a custom action. Windows Installer is affected by the installation of .NET so it is not safe to nest them in any fashion.

The way I would approach this would be with a Suite/Advanced UI project (I think the Advanced UI project allows enough for this specific scenario), including .NET as a dependency package, and the MSP as the primary package. Then be careful about what you provide, and you have much more implicit control over its deployment.
0 Kudos
Amarjeet
Level 7

Hi Michael,

I am able to successfully install the .net framework. I have done this by following way :

1) I have created two custom actions. One custom action for GUI based installation and other for silent installation.

2) On setupcomletesuccess dialog if .net framework is not installed name of the finish button turns to install. I have added few text messages in this dialog.
once user clicks this installe(finish) button the main installation exits and custom action is executed. From this custom action I am invoking setup of .net framework with /passive and /noreboot switches. The custom action is not scheduled in any of the sequences.

3) For silent install I have scheduled the custom action in exec sequence after Schedulereboot.

.Net framework gets installed successfully in both scenarios.

I am going to try your suggestion once I give final touch to my solution described above.

Regards,

Amarjeet
0 Kudos