This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Checking conditions in the OnEnd function
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2009
03:36 PM
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.
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.
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2009
04:10 PM
Depending on your requirements, a prerequisite might be more appropriate. The topics under "Including Redistributables in Your Installation" have more information.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 15, 2009
04:48 PM
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.
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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 16, 2009
06:25 PM
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).
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 On
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)