Install only some prerequisite is NOT being installed - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Install only some prerequisite is NOT being installed

Could you help me to setup conditions?

I need install SQL Command Line Utils so I add this to Prerequisites but it's installed also if user select optional prerequisite "SQL Server". I do not need install "Command Line Utils" in that case because "SQL server" already contain them. I need some sort of inverted logic than "Install only if this prerequisite is being installed". I think best place is Organization page - Install Behaviour -Install based on condition but do not know what condition I should use. I do not care about immediate update checkbox for this prerequisite on CustomizeDlg (if this makes live easier) because user can't see that (Feature tree is set to Not Display).
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install only some prerequisite is NOT being installed

Hello,

In order to achieve what you want you can add the SQL Server package as a pre-install prerequisite and SQL Command Line Utils package as a feature-based prerequisite to your main installation package. Then, for SQL Command Line Utils prerequisite, in the "Install Conditions" group you should add all the searches from the SQL Server install conditions.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Install only some prerequisite is NOT being installed

I can't do that. Many users do not know what is SQL Server. They can not decide if then need this prereq. They just select features in Custom install mode or select Typical and that's all. I must then choose if they need SQL Server (they can work in offline mode) or will use just company network one. In second case application needs SQL Native Client + SQL Command Line Utils. Use pre-install prerequisites is against user experience. My idea was add to "Install based on condition" something like "NOT (&SQLServer = 3) AND NOT (!SQLServer = 3)". I am not sure if that condition is correct but at least Condition Wizard have disabled Component and Feature so I expect some issue.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install only some prerequisite is NOT being installed

Hello,

If you don't want users to see the prerequisites wizard dialogs, then you can hide the related dialogs. Go to "Dialogs" -> "Bootstrapper UI" and set the "UI Level" field to "Silent Install (no UI)".
My idea was add to "Install based on condition" something like "NOT (&SQLServer = 3) AND NOT (!SQLServer = 3)". I am not sure if that condition is correct but at least Condition Wizard have disabled Component and Feature so I expect some issue.
Please keep in mind that you cannot use this solution because Winows Installer evaluates conditions and set the feature states in a random way.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Install only some prerequisite is NOT being installed

Hi Daniel,

I understand there are limits of WI (unfortunately) but it is standard solution in Windows. I have no problem with visibility of the prerequisites wizard dialogs. Issue is I don't know what features will be installed at pre-install time. I tried split SQL Server and SQL CmdLnUtils to Feature-based and Post-Install but it looks both are evaluated together.

Another idea I have is use Custom Action "Update Features' Install States" or "Disable Features" somewhere between Feature-based and Post-Install. Condition could be ((&SQLServer = 3) AND NOT (!SQLServer = 3)) but I don't know what should be in Action Data. Could you help me setup this (if do you think it will work).

Another option is give up because it's not something what brakes installation. It just reinstall something what is already installed.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Install only some prerequisite is NOT being installed

Hello,
I tried split SQL Server and SQL CmdLnUtils to Feature-based and Post-Install but it looks both are evaluated together.
Please keep in mind that searches from prerequisites install conditions are performed early, before the prerequisites start. So, if your prerequisites are added as feature-based and as post-install prerequisites, then all of your searches from prerequisites install conditions will be performed before the first prerequisite starts.
Another idea I have is use Custom Action "Update Features' Install States" or "Disable Features" somewhere between Feature-based and Post-Install. Condition could be ((&SQLServer = 3) AND NOT (!SQLServer = 3)) but I don't know what should be in Action Data. Could you help me setup this (if do you think it will work).
Another solution would be to use a custom action which will set the SQL Command Line Utils feature to be installed only when the SQL Server feature will not be installed. You can add this custom action as a "Launch attached file" custom action with sequence before "Wizard Dialogs Stage" -> "User Selection" -> "ProgressDlg" standard action. Here's attached a sample, created using version 9.5 of Advanced Installer, which implements your scenario.
sample.zip
(3.72 KiB) Downloaded 368 times
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ales.hrodek
Posts: 65
Joined: Mon Jun 11, 2012 11:40 am

Re: Install only some prerequisite is NOT being installed

Thank you, Daniel. It's result I expected.

Return to “Common Problems”