[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2851
  • Last Modified:

InstallShield with XML web.config - changing the connection string

I'm using InstallShield 2009 and I cant for the life of me dynamically change the connection string in the web.config file - heres what I'm currently doing..

I have an SQL log-in dialog box where i enter in all of the SQL database log-in credentials, and in the "XML File Changes" section i'm loading my web.config values. Under connection string I'm making it equal to

Data Source=[IS_SQLSERVER_SERVER];Initial Catalog=[IS_SQLSERVER_DATABASE]; User ID=[IS_SQLSERVER_USER];pwd=[IS_SQLSERVER_PASSWORD]

When the installer runs, it changes the value but I end up with

<add name="MyConnectionString" connectionString="" providerName="System.Data.SqlClient"></add>

i.e. a BLANK connection string!

Can anyone tell me how to make the change so that it applies properly to the connectionString? All help appreciated...
0
DevSure
Asked:
DevSure
  • 3
  • 2
1 Solution
 
Vadim RappCommented:
I would start with finding out if those properties - IS_SQLSERVER_SERVER etc. - are actually populated.

One quick way to do that is putting new textbox on the "ready to install" dialog, with the value being what you want to see.
0
 
DevSureAuthor Commented:
Thanks for your prompt response.

I've managed to open the msi debugger and attempted to load the variables and the whole prog crashed, is there a intermediate window/watch list similar to visual studio? Failing that is there a lookup table that shows you the current value of the variables?


0
 
Vadim RappCommented:
Debugging is what's supposed to help here, but if it crashes, then it crashes. Besides, Installshield is so tightly stuffed with its own internal junk that I imagine it would be nontrivial to figure out what to look at even if it worked.

Put your connection string with those variables on the dialog as textbox so it shows the result.
0
 
DevSureAuthor Commented:
Cheers, got it working after you helped me out with the dubugging. turns out the problem was that there was a script changing the value to its md5 value....

Thanks for your help, I'll need it with InstallShield I'd say!
0
 
DevSureAuthor Commented:
Thanks, just getting used to the app so needed a bit of help! A+
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now