Post install setup of DB and config files - 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!

seifordd
Posts: 10
Joined: Tue Jun 28, 2011 4:05 pm

Post install setup of DB and config files

The product that will be installed with the MSI build with the Advance Installer requires some post install setup.

I want to know how much of this setup activity can be done with builtin functionality in the Advanced Installer.

Here are the post setup actions that need to be done.

1. Prompt the user for a login account with Admin priviledges. (Domain, Username, Password)
- Use this information to set permissions on the installation directory
- Update entries in the config file (xml) with the entered Domain, UserName and encrypted password)

2. Prompt the user for a DB connection string (SqlServer, SqlExpress)
- Check to see if the required databases exist in the DB. If not execute the Sql scripts to create the databases
- Update the config file with the DB connection string entered by the user

3. Prompt the user for TCP port number.
- Update the config file (xml) with the port numbers entered by the user.

4. Update entries in the config file (xml) with security settings entered by the user.

I know I can do all of this in a post install exe written in C#. What is the recommended way of executing this type of setup logic from within the MSI as it is being run.

Do you run an exe as a custom action defined on a dialog? If so are there examples.

Thanks,
Dave
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Post install setup of DB and config files

Hi Dave,
Prompt the user for a login account with Admin priviledges. (Domain, Username, Password)
For this you can add LogonInformationDlg dialog in Dialogs page. It already has the controls you want.
Use this information to set permissions on the installation directory
You can set folder permissions through Permissions tab in Edit Folder dialog. For the username you can use USER_NAME property (the same property used on LogonInformationDlg).
Update entries in the config file (xml) with the entered Domain, UserName and encrypted password)
This can be done through our XML editor. You can use the properties from LogonInformationDlg dialog. To encrypt the password you will need to use a win32 DLL or VBScript custom action. This custom action should use the installation handle to read the password property, encrypt the value and save it back in the property.
Prompt the user for a DB connection string (SqlServer, SqlExpress)
For this you can add SQLConnectionDlg dialog in Dialogs page.
Check to see if the required databases exist in the DB. If not execute the Sql scripts to create the databases
Our user guide contains the Show databases from an SQL server how-to which may help you. Please note that you will also need a SetProperty control event to save SqlServerDatabases property value in a custom public property. This public property can then be used to condition you SQL script.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”