Data Source Name customize? - 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!

sashasch
Posts: 6
Joined: Sun Mar 30, 2008 4:08 pm

Data Source Name customize?

Hi to All,
First of all, thanks to cosmit for previous quick answers!!!

Second, the problem:

During our product installation we want to customize the Data Source Name, according to some property, for example.
If this option exists, how to do this ???
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Data Source Name customize?

Hi,

I'm afraid that this is not supported by Windows Installer, therefore it cannot be done. The Description field in the ODBCDataSource Table can contain only Text, therefore the value written in the MSI is the value used during the installation.

However, in a future version of Advanced Installer we will make the name of the data source pseudo-formatted. When this is done you will be able to use pseudo-formatted properties for the name (the pseudo-formatted properties are resolved when the package is built).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sashasch
Posts: 6
Joined: Sun Mar 30, 2008 4:08 pm

Re: Data Source Name customize?

Hi cosmit,
May be it is possible to make in another way, so I''l describe the global problemm:
We need an ability to run two or more versions of our product in the same mashine and in the same time,
with different properties each one, of course.Our product is an windows service, that use ODBC Data Source and each instance of product will be runned as different process and use different source. It will be no problems to customize the install directory and service name "Display Name", but i can't do same thing whis Data Source Name. May be it is possible to change another property of Data Source for using different sources in parallel mode. Do you have any Idea???

P.S. When you are planning to publish new version of advanced installer?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Data Source Name customize?

Hi,

The only workaround we can think of is this:
- create a different data source for each instance you want to be able to create (let's say 20 datasources)
- set a custom name for each data source
- go to the Install Parameters page and create the property REGISTRY with the value "0"
- do the same for the REGISTRY_SEARCH property
- go to the Registry page and create a registry value in which you set the REGISTRY property
- go to the Search page and create a search which retrieves this value; name it REGISTRY_SEARCH
- go to the Organization page and condition the components of the data sources with the REGISTRY_SEARCH property
- create a VBS file which contains this code:

Code: Select all

Dim reg
Dim str

str=Session.Property("REGISTRY_SEARCH")
reg=CInt(str)
reg=reg+1
Session.Property("REGISTRY")=Cstr(reg)
- go to the Custom Actions page and add the VBS file as an Attached custom action under the "AppSearch" standard action
- make sure that the "Function Name" field in the "Custom Action Properties" page is empty
- condition this custom action with "(Not Installed) AND REGISTRY_SEARCH"

Basically, each time the installation runs it will perform these operations:
- it searches for the numerical registry value
- if it doesn't find it, the package creates the registry value, set it to "0" and installs the first data source (its component has the condition REGISTRY="0")
- if it finds the numerical value it sets it in the REGISTRY_SEARCH property
- in both cases the custom action runs and increments the value in the REGISTRY property (so you have "0" when no data source is installed, "1" when the first data source is installed etc.)
- the data source which will be installed by the package depends on the value of the REGISTRY property

If you need a sample project please contact me at support at advancedinstaller dot com.
P.S. When you are planning to publish new version of advanced installer?
The next Advanced Installer version (6.3) is scheduled for release in the beginning of May.

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

Return to “Common Problems”