rgr
Posts: 6
Joined: Wed Jan 30, 2013 1:28 pm

Set ODBC fom external ini file

I am trying to find a way to set the ODBC connection from an external "setup.ini" which also holds information about the startmenu shortcut to create. So I would like dynamically create the ODBC and the Shortcut. Anybody knows how to accomplish this.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Set ODBC fom external ini file

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I'm afraid I don't fully understand what you mean. Can you please give us more details about what you want to achieve (maybe exemplify)?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rgr
Posts: 6
Joined: Wed Jan 30, 2013 1:28 pm

Re: Set ODBC fom external ini file

Thank you fo your answer. What I want is, generate an setup file (msi). In the source directory in which the msi file resides I want to place an setup.ini textfile with paramaters for the ODBC connection and shortcutname for the program to install.

During the installationproces the msi has to read the setup.ini file values and create based on the parameters the ODBC DSN in the registry and create the shortcut in the Startmenu under Programs on de target machine.

I am installing just a bunch of dll 's and MSI 's but no executables. Most of the configuration is done by our consultants but they need an msi who can create odbc and shortcuts dynamically. They configure on site the ODBC en shortcut trough the setup.ini file. Later a user will be able to launch the msi by himself without worrying how to configure the odbc and create a shortcut to the program(runtime)

Hope my explanation helps.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Set ODBC fom external ini file

Hello,

I'm afraid we don't have predefined support for this. However, in order to achieve what you want you can develop your own custom action which will read the related parameters from .ini file and will copy them into installer properties. Then, you can use the related properties to configure your project accordingly. You can take a look on our "How could I read an "external" .INI file?" thread which could be useful for you.

Also, here are a list of articles you can take a look:
- ODBC/SQL how to's
- Configuring Databases with SQL Scripts tutorial

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rgr
Posts: 6
Joined: Wed Jan 30, 2013 1:28 pm

Re: Set ODBC fom external ini file

Hi Daniel,

It took a while but I can not achieve that my added vbscript trough an custom action finds my external setup.ini file for reading several settings.

What I have done so far is the following.
- A file/copy action for the setup.ini file with the [SOURCEDIR] property (explained in the helpfile)
- The vbscript launches trough the custom action "Launch attached file" with the default properties.

As far I understand from your previous explanation and the helpfile. The setup.ini is copied to de application folder [APPDIR]. The "Launch attached file" (vbscipt) action should also run in the [APPDIR] and find the copied setup.ini for reading and execute with the parameters from the setup.ini file.

The problem whatever I do, the script cannot find the setup.ini, despite the fact that in my opinion the script is also run from the [APPDIR]
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Set ODBC fom external ini file

Hello,

There is no need to copy the setup.ini file into the APPDIR. You can simply place the setup.ini file alongside your MSI before you launch the MSI and, you can use the SOURCEDIR property to get the path of the parent folder of your setup.ini file.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”