如何在InstallShield安装过程中更改应用程序设置?

时间:2021-10-01 10:35:22

I am on the completing stages of my application and have just added the InstallShield project ready to create an Installer to distribute the application, however I have one drawback:

我正在完成我的应用程序的完成阶段,刚刚添加了InstallShield项目,准备创建一个安装程序来分发应用程序,但是我有一个缺点:

For my SQL Connection to a database, I have currently been using Application Settings and using an AppConnectingString with the value as the Connection String. Yet, obviously if distributed to another company who will have a different connection to their database, it will need changing/configuring.

对于我与数据库的SQL连接,我当前一直在使用应用程序设置并使用AppConnectingString,其值为连接字符串。然而,显然如果分发给另一家与其数据库有不同连接的公司,则需要更改/配置。

Is there a way to dynamically edit my application settings when a client installs my application, so that they can change the Connection String, and if so, how is it done?

有没有办法在客户端安装我的应用程序时动态编辑我的应用程序设置,以便他们可以更改连接字符串,如果是,它是如何完成的?

1 个解决方案

#1


1  

I was able to accomplish something similar using the "Text File Changes" section found in the "System Configuration" area in InstallShield installation Designer.

我能够使用InstallShield安装设计器的“系统配置”区域中的“文本文件更改”部分完成类似的操作。

Since your application setting is found in the app.config file, you can set up the text file changes to look for a specific string such as "MyServer" and replace it with whatever the user selects at install time for their sql server. (You will need a sql connection entry under "SQL Scripts" for the user to see the sql server connection dialog at install time).

由于您的应用程序设置位于app.config文件中,因此您可以设置文本文件更改以查找特定字符串(如“MyServer”),并将其替换为用户在安装时为其SQL Server选择的任何内容。 (您将需要“SQL Scripts”下的sql连接条目,以便用户在安装时查看sql server连接对话框)。

This question is 3 months old at the time of this answer; maybe it will help someone else with this same issue...

这个问题在这个答案的时候是3个月大;也许它会帮助其他人解决同样的问题......

#1


1  

I was able to accomplish something similar using the "Text File Changes" section found in the "System Configuration" area in InstallShield installation Designer.

我能够使用InstallShield安装设计器的“系统配置”区域中的“文本文件更改”部分完成类似的操作。

Since your application setting is found in the app.config file, you can set up the text file changes to look for a specific string such as "MyServer" and replace it with whatever the user selects at install time for their sql server. (You will need a sql connection entry under "SQL Scripts" for the user to see the sql server connection dialog at install time).

由于您的应用程序设置位于app.config文件中,因此您可以设置文本文件更改以查找特定字符串(如“MyServer”),并将其替换为用户在安装时为其SQL Server选择的任何内容。 (您将需要“SQL Scripts”下的sql连接条目,以便用户在安装时查看sql server连接对话框)。

This question is 3 months old at the time of this answer; maybe it will help someone else with this same issue...

这个问题在这个答案的时候是3个月大;也许它会帮助其他人解决同样的问题......