InstallShield MSI安装中的可变ODBC DSN名称

时间:2022-12-10 22:42:59

I'm designing a new MSI installation for a product that allows multiple instances to be installed. Many of the components of the installation are identified by a 2-character code. Among these is an ODBC data source. The name of the data source includes this 2-character code, which is something the user enters during installation. I notice that I cannot use a property name "[MyPropertyName]" as the Name of an ODBC DSN in an InstallShield project. Is there any clean way to allow the ODBC DSN name to be set at runtime? If I were creating hard-wired names for each of my instances, I could create a separate DSN for each hardwired instance name ("Test" and "Production" for example), but we allow the user to specify the name. Am I going to run into more dead-ends as a result of this or is there a way to allow user-specified instance-specific property values?

我正在为允许安装多个实例的产品设计新的MSI安装。安装的许多组件都由2个字符的代码标识。其中包括ODBC数据源。数据源的名称包含此双字符代码,这是用户在安装期间输入的内容。我注意到我不能使用属性名称“[MyPropertyName]”作为InstallShield项目中ODBC DSN的名称。是否有任何干净的方法允许在运行时设置ODBC DSN名称?如果我为每个实例创建硬连线名称,我可以为每个硬连线实例名称创建一个单独的DSN(例如“测试”和“生产”),但我们允许用户指定名称。我是否会因此而遇到更多死胡同,或者是否有办法允许用户指定的特定于实例的属性值?

1 个解决方案

#1


1  

You could either a) skip the ODBC tables in MSI and use the Registry table instead or b) use a custom action to dynamically inject custom rows at install time into the ODBC tables.

您可以a)跳过MSI中的ODBC表并改为使用Registry表,或者b)使用自定义操作在安装时将自定义行动态注入ODBC表。

#1


1  

You could either a) skip the ODBC tables in MSI and use the Registry table instead or b) use a custom action to dynamically inject custom rows at install time into the ODBC tables.

您可以a)跳过MSI中的ODBC表并改为使用Registry表,或者b)使用自定义操作在安装时将自定义行动态注入ODBC表。