View Full Version : Changing source in midstream

08-18-2003, 05:46 PM
I would like to be able to do the following:

During the install of my application ( which is a client/server database application ) the user has the option to install the database either from the CD or use a database file that he gets from us.

I have a component and file group dedicated to the database.

I think there are several ways to do this:
1) In the wizard porting of the script, depending on the option the user selects, change the Compent_field_CD_Rom value of the database component. Is this possible?

2) In the before event for the database component, if the user has elected not to install the database from the install program, then turn off the database component and use CopyFile or XCopyFile to copy the db from where they put it after receiving it from us. Is this possible and does XCopyFile or CopyFile get logged so the install will remove the copied file(s)?

3) Any other ways?


08-18-2003, 11:27 PM
You can try the following:

If the the user selects no to install the database from your component, deselect the component using the function "ComponentSelectItem (szComponentSource, szComponent, bSelect);"

Using the DelectDir dialog box, ask the user to browse to the folder where the database resides. Use this path as source path while using XCopyFile or Copy file function. Please note that the SelectDir dialog box return only the directory slected. you need to append the database name to this.

The XCopy and Copyfile functions are logged for unistallation.

Niran Bhimaiah

08-19-2003, 07:33 AM
Thanks for the reply.

I have the modify option available for the Maintenance portion of the installation.

For CopyFile and XCopyFile, how do I keep selecting the db so that it isn't uninstalled? I can't copy it each time, and the help is fairly bare on the logging for those functions.


08-19-2003, 07:49 AM
If you do not want to uninstall the DB, call disable (logging) before xcopy operation and call enable(logging) after this.

This should not unistall the db


Niran Bhimaiah

08-19-2003, 09:01 AM

Here's the behavior I need:

During the initial setup, the user installs the database. There is a default db file on the CD, but there is the option to use a file that we have created specially for that user, and so the install allows the user to select a non-default db file instead.

During a modify install, the database is left alone. It isn't installed, nor uninstalled.

During a remove, the database is uninstalled.

Using the standard component/file group arrangement in IS, there isn't a method of changing the source of the DB file group on the fly. As far as I can tell. If there is, then that will solve this entire problem.

Given that there isn't such a method, I need to do this manually. Reading the previous responses I guess I would do something like this:

1) Keep my current component/file group for the default database file. If the user selects to install the default database, then select that component, and let IS handle all the rest.

2) Create another component that doesn't have a file group, but does have an install event, and an uninstall event. In the install event, disable logging, copy the special db file, and re-enable logging. In the uninstall event, delete the file. In the Maint UI event, make sure that that component is set to stay installed, and if the user selects the 'remove this application' option, then IS will uninstall the component.

Is that too complicated for the desired behavior?