cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Branstar
Level 3

Checking conditions in the OnEnd function

Hi there,

I'm relatively new to Installshield, but I've figured out most of what I need to do thanks to various posts in this forum. If someone were to take the time to answer this last problem I have that would be much appreciated 🙂

I'm looking to conditionally trigger the install of the .NET Framework, which seems to require I do that in the OnEnd function to work.

My problem is with checking the conditions during the OnEnd function:
- identifying that an install is occurring
- identifying that my component has been selected

I have a solution of sorts - I can imagine detecting these states via custom action conditions and setting some temporary registry keys to track these values. I already tried setting a global variable using custom action conditions, but this didn't seem to work (at least not in the OnEnd function).

I'm sure there must be a more elegant solution to the one I'm currently facing, can anyone point me in the right direction?

I'm using IS2009 Premier with an Installscript MSI project.
Labels (1)
0 Kudos
3 Replies
RobertDickau
Flexera Alumni

Depending on your requirements, a prerequisite might be more appropriate. The topics under "Including Redistributables in Your Installation" have more information.
0 Kudos
Branstar
Level 3

Thanks for your reply;

Unfortunately I really do need to check these conditions in the OnEnd function - since I'm using an Installscript MSI project I can't have an optional prerequisite based on a component being selected.

While the functionality exists in Basic MSI projects, to selectively install prerequisites based on a selected feature, that is unsuitable for my purposes.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The MAINTENANCE variable would be false if you are running a first time install and true in all other cases. You should be able to use this variable in OnEnd to distinguish between first-time install and any subsequent install scenarios (if you need finer granularity, you may want to try setting a global variable in one of the OnUIBefore events and check the global variable in OnEnd).

For determining if a component was selected, you should be able to use a function such as FeatureIsItemSelected. One thing to note for InstallScript MSI projects, though, is this function has to mix between MSI and InstallScript features states, and it can therefore not necessarily behave as might be expected. As such, since the installation (the MSI part) will already be completed by OnEnd, you may want to check for the existence of a resource installed by the component in question (again, you can make a check in the OnUIBefore events to determine if the component was not already installed, and set a global variable to compare against in OnEnd).
0 Kudos