miked
Posts: 18
Joined: Mon Jun 05, 2006 6:50 pm
Location: Maine, USA
Contact: Website

Installing Features Based on Property

Hi,

Since I am new to Advanced Installer, and I would just like to run this by someone to make sure it is a good way of doing it, or see if there's a better way to do it. We bought the Professional level license.

My goal is to have just one Installation script to maintain. Here's my first go at it.

1. I added the Application folder as "Synchronized" on the Files and Folders page.

2. On the Organization Page, I have set up 3 different Features: Client, Server, and Database. Depending on how our users are setup up and what software they purchase, each PC/Server can have 1-3 of these Features installed. I have already moved the respective Components into each Feature as appropriate.

3. Next, I added a Property on the Install Parameters page called "InstallType". It looks like I can conditionally install the Features based on the value of this Property. (i.e. InstallType="Complete", install ALL Features, InstallType="Database", install just the Database Feature)

4. Since I can't Edit Dialogs in the Professional version of AI and set the Property there (which would be ideal), I'm thinking I can set the "InstallType" Property by using the "EXE Bootstrapper" on the Media page and pass the value I'd like on the Command Line with the [PROPERTY=PropertyValue] option. This would give me a "Setup.exe" which would run the "generic" .MSI and set that Property when it runs, correct?

5. Then I could build different "types" of "Setup.exe"'s which set the "InstallType" Property for the .MSI accordingly.
-- OR --
I could use the SAME "Setup.exe" if I used an INI file for the "Setup.exe" and simply set the "InstallProperty" value in the INI file, and thus be able to do any of our installations simply by changing the INI file for the "Setup.exe"...

I hope this is clear enough. I am certainly open to suggestions on a better way of doing this as well.

Thanks in advance!
Mike
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
On the Organization Page, I have set up 3 different Features: Client, Server, and Database. Depending on how our users are setup up and what software they purchase, each PC/Server can have 1-3 of these Features installed. I have already moved the respective Components into each Feature as appropriate.
This is a good approach but please tel me why do you need to condition features installation since the user can choose what features to install from "Setup Type" dialog. The "Setup Type" dialog can be added from "Dialogs" page.
Next, I added a Property on the Install Parameters page called "InstallType". It looks like I can conditionally install the Features based on the value of this Property. (i.e. InstallType="Complete", install ALL Features, InstallType="Database", install just the Database Feature)
You don't really need to add the property in the "Install Parameters" page. But if you do so then its value is used when no command line is specified.
I'm thinking I can set the "InstallType" Property by using the "EXE Bootstrapper" on the Media page and pass the value I'd like on the Command Line with the [PROPERTY=PropertyValue] option. This would give me a "Setup.exe" which would run the "generic" .MSI and set that Property when it runs, correct?
Note that only public properties (public properties are in upper case) can be modified via command line. So the "InstallType" property must be in upper case in order to modify it from command line.
I could use the SAME "Setup.exe" if I used an INI file for the "Setup.exe" and simply set the "InstallProperty" value in the INI file
Yes you can do this but note that with this approach an user can easily change this property and have access to all features from your package. If this is not an impediment then this method is recommended.

Also note that you can specify ADDSOURCE=FeatureName as command line instead of using your property. ADDSOURCE property is a list of feature to be installed. Currently AI automatically add the name of a feature like this: MainFeature (default), Feature (first feature), Feature_1 (second feature), etc.

Here's an example on how to use ADDSOURCE property, in this case only the feature (Feature) is marked for installation:

Code: Select all

ADDSOURCE=Feature
Regards,
Gigi
_________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
miked
Posts: 18
Joined: Mon Jun 05, 2006 6:50 pm
Location: Maine, USA
Contact: Website

Thank you for the reply. This forum is an excellent resource and support tool!
This is a good approach but please tel me why you need to condition features installation since the user can choose what features to install from "Setup Type" dialog. The "Setup Type" dialog can be added from "Dialogs" page.
I looked at this option and considered changing the Dialog labels to "Single User - No DB" (Typical), "Multi-User" (Custom), and "Complete" (Complete - everything), but it just doesn't quite fit out setup...
You don't really need to add the property in the "Install Parameters" page. But if you do so then its value is used when no command line is specified.
I'm a little confused. How does AI know about my INSTALLTYPE Property if I don't put it in the Install Parameters?

I assume setting the Property with a command line overrides the value in the Install Parameters? So I could "default" this Property to "Complete"? Does the Command Line CREATE and SET the Property for the MSI package?
Note that only public properties (public properties are in upper case) can be modified via command line. So the "InstallType" property must be in upper case in order to modify it from command line.
I read that in one of your other posts last night after posting this. Works a lot better with upper case too. :)
"I could use the SAME 'Setup.exe' if I used an INI file..."
Yes you can do this but note that with this approach an user can easily change this property and have access to all features from your package. If this is not an impediment then this method is recommended.
I should say that this install is currently only for one application, and the different "Features" are for different configurations. So if the INI file were changed, the User would install with different configurations and potentially just muck up their setup.

But that is a good point. How about I use our previous installation packager which lets us display a dialog where the User can choose his configuration (i.e. "ClientServer", "Database Only", etc.) with a combo box. Then based on that value, the installer allows us to run a Command Line like "msiexec /i Setup.msi INSTALLTYPE=ClientServer" and launch the MSI created by AI. This would by-pass the need for the Setup.exe and Setup.ini altogether and enable us to use the same Setup.msi for all of our clients. (I suppose they could still muck things up, but at least they wouldn't have to edit an INI file!)

Does this seem like a reasonable solution?

Thanks again for all the help and your patience!
Mike
miked
Posts: 18
Joined: Mon Jun 05, 2006 6:50 pm
Location: Maine, USA
Contact: Website

PS. ADDSOURCE

OK, got it. Using ADDSOURCE means I don't need my Property: INSTALLTYPE since I can directly reference the Features. Great!

Is ADDSOURCE a Windows Installer Property or Advanced Installer? I couldn't find any reference to this in your documentation.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

ADDSOURCE is a Windows Installer property not one of AI. To learn more about it take a look at following link:
http://msdn.microsoft.com/library/defau ... source.asp

Regards,
Gigi
________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”