Phil
Posts: 22
Joined: Sat Aug 27, 2005 3:47 am

Various questions about how to configure...

Hi, I have several questions on how I can do various things with AI. We built our first installer some months ago with v2.6.4; we've just downloaded 3.1.1. [I've had a look through and there doesn't seem to be anything new in the way of custom actions or support for custom dialogs.]

What we want: one installer with the ability to install a client and/or a server version of our application, with varying options. With the server install, the user can choose whether or not they want a web server installed, and whether or not they want database support on that machine. I.e:

Code: Select all

- Client
- Server
   - Web
   - Database
      - Firebird
      - MS SQL Server
We are using a 'Professional' installer (not a 'Java' installer).

Questions:

1) We need to set an environment variable "JAVA_HOME" on the server install (and only if they install web support) and this needs to be set to the path to the JRE (eg "C:\Program Files\Java\j2re1.4.2_06"). I don't understand how we can we do this? We do have as a prerequisite installation of the JRE. Can this be used in some way to set JAVA_HOME?

2) With the above variable I don't see if we can control whether it's removed or not when we uninstall.

3) On a client install we want the user to be able to enter the IP address of the database server, then save it to a properties file on the client install. Do we use a custom action for this? How do we create a custom dialog to prompt for the IP address?
One thing we want to do is read a default IP address (eg 127.0.0.1) from a cfg file alongside (not within) the installer, and write the chosen value back, this way the second time you do a client install it remembers the value from the last time. Therefore an admin can put the installer on a USB (or network) drive and install the client multiple times without having to enter the address each time. Is this a good approach?

4) Similarly we need to let the user pick their locale and save it to the locally installed cfg file. Is there a way to pick locales in AI and return strings such as en_GB, en_US, de_DE, etc?

5) When I run the Custom install option there are no buttons for picking alternate drives and I cannot go up a directory above C: to 'My Computer' or 'Desktop'. Have I done something wrong?
It seems that in a Custom installation you CAN manually type a different install location (eg different drive), but most users would be used to being able to do this via the file hierarchy tree.

6) With a Typical or Complete install, is it possible to still let the users choose the destination? It's not uncommon to have a "Program Files" folder on a different drive from C: (as well as one on C: for those applications that don't behave well on a different drive) ... or does AI automatically know this when running Typical or Complete install?

7) We send out installers with a default 'empty' database. When we uninstall we normally don't want the database deleted (I understand we simply mark the file as 'Permanent'). However if the user installs then immediately wants to uninstall and install in a different location, is there a way to delete the empty database file? I.e is there a way that AI could tell that the database file is still unmodified? Or alternatively can the user be prompted during the uninstall "do you want to delete the database"?

8) In some cases we may want to send out a 'full' database, but we don't want to have to build special installers. I.e in this case we'd send out the normal installer (containing the default empty database) and a 'full' database alongside (not within) the installer. Is there a way for AI to install the 'full' database if it sees it there, instead of the default empty one?

9) We support multiple database formats (eg Firebird, MS SQL Server). If the user is chosing a server install is there a way to make the selection exclusive, i.e so that they MUST install support for one and only one database?

Thanks in advance,
Phil
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

First, if you are deploying a Java application I would suggest using a Java version of Advanced Installer, as it can do things that can't be accomplished with the Professional version.

Here are some suggestions:

1. You could use a search for a registry key. The JavaHome registry entry stores the value to the Java directory. It's location is HKLM/Software/JavaSoft/Java Runtime Environment/x.x.x. (xxx = the version). Then you could use the property resulted after the search for setting a property based environment variable.

2. In the Edit Environment Variable dialog check or uncheck the "Remove on uninstall" check-box.

3. A custom action is the way to do this. You could write a VBScript that creates such a dialog and accesses the CFG file. The original location of the MSI can be retrieved from the "SourceDir" property.

4. The SystemLanguageID property contains the language identifier of the system. For a list o language identifiers please visit:

http://msdn.microsoft.com/archive/defau ... script.asp

You can use the value of this property without having to ask the user.

5. You can select another drive from the "Look in" drop-down list.

6. The "Setup Type" and "Select Location" dialog are mutually exclusive. This is the way Windows Installer works.

7. You could make the database part of a "permanent" component. But this means it has to be manually erased after uninstall. An alternative solution can be not to let the user modify the installation files at all. Your application could use the existing files as templates for creating new files for storing the user data. This way the new files will not be deleted on uninstall, but the old "empty" ones will.

8. You could build your MSI with the "Media" option "Place files unpacked in folder next to the MSI database" set to ON. Then you could overwrite the empty database file with the full one and then ship it. You could also use this approach for building two type of installers with the same AIP, by overwriting the database source file on the disk, before the build.

9. Setting dependencies between features is rather complicated. For a possible solution please visit:

http://www.advancedinstaller.com/forums ... .php?t=651


Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
Phil
Posts: 22
Joined: Sat Aug 27, 2005 3:47 am

Thanks for your answers...
Mike wrote:First, if you are deploying a Java application I would suggest using a Java version of Advanced Installer, as it can do things that can't be accomplished with the Professional version
Ok, I changed the project type by hacking the .aip file. (We experimented with java projects some months ago and had some problems, and since we already have an exe wrapper integrated into our ant build process, we'd only needed to do a 'professional' project.)
Mike wrote:3. A custom action is the way to do this. You could write a VBScript that creates such a dialog and accesses the CFG file. The original location of the MSI can be retrieved from the "SourceDir" property.
I've written a java program to manage our cfg files and defaults - I'll set this up as a java product then run it as a custom action? I can see how I pass this java product the installation path chosen in the installer but how to I get a list of the features (and therefore which cfg files) are being installed?
Mike wrote:4. The SystemLanguageID property contains the language identifier of the system. You can use the value of this property without having to ask the user.
This could be nice, I'll pass this to our java utility :)
Mike wrote:5. You can select another drive from the "Look in" drop-down list.
No, I can only select at the top of the drop-down "Local Disk (C:)". I cannot select any other drive, select network or samba drives, etc. What have I done wrong?
Mike wrote:8. You could build your MSI with the "Media" option "Place files unpacked in folder next to the MSI database" set to ON.
This is ok but I only want to 'expose' the one database file. Can I do this with just the one file?
Mike wrote:You could also use this approach for building two type of installers with the same AIP, by overwriting the database source file on the disk, before the build.
I'd already done it this way a few times but found it too 'ugly'. You are replicating almost the entire installer; this is also a lengthy process if you had to do this for every client with a custom database - eg having to rebuild the installer 100 times would drive you to insanity! Any other way?

Thanks, Phil
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

3. The object Session give access to the state of a certain feature. For more information please visit:

http://msdn.microsoft.com/library/defau ... object.asp
http://msdn.microsoft.com/library/defau ... tstate.asp

But are the CFG files installed or do they come along the MSI?

5. I don't know why this happens. We cannot reproduce it. Maybe this is a Windows Installer issue or it has to do with writing privileges on another drives?

8. I'm afraid you cannot place the files in the MSI and leave just one outside.

To avoid rebuild I would suggest the following approach. Create a MSI with the basic type of database. Every time a client requests a certain custom database you can create an additional package that contains only that file (like an add-on). The second package would then search for the folder where the empty database is stored and replace it. The user simply has to install the product and then the add-on.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
Phil
Posts: 22
Joined: Sat Aug 27, 2005 3:47 am

Mike wrote:But are the CFG files installed or do they come along the MSI?
They are installed so our utility just needs to update them after they've been copied. I see now that we should be able to pass the destination to the utility (?) so hope that is the solution.
Mike wrote:5. I don't know why this happens. We cannot reproduce it. Maybe this is a Windows Installer issue or it has to do with writing privileges on another drives?
I've tried my installer on another PC and it can access other drives, so something is strange on my pc (I DO have adminstrator rights...).
On neither though can we see or browse USB drives, desktop, 'network neighbourhood' or writeable drives. Does AI support any of those?
Mike wrote:Create a MSI with the basic type of database. Every time a client requests a certain custom database you can create an additional package that contains only that file (like an add-on). The second package would then search for the folder where the empty database is stored and replace it. The user simply has to install the product and then the add-on.
Great, I built a second package where the only item (the file) is left outside the installer. Works well. But can I then call that installer (or msi) from within the main installer?

Another approach - Can I either (a) create a custom action that copies a file (dependant on the result of a file search), or (b) always install a Feature where the file (dependant on the result of a file search) is the only thing in that feature?
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

Hi,

AI's job ends with the creation of the MSI file. Windows Installer takes it from there. Whether removable disks will be supported is Microsoft's choice.

The only way to launch a MSI from another MSI is to have it as a prerequisite. I would suggest having the original package as a prerequisite for the database add-on. The user only needs to start the installation of the add-on and the other package will be installed as well.

I'm not sure I understand the other approach.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”