Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Setting App.Config value from custom dialog box value


3 replies to this topic

nluciano

nluciano
  • Full Members
  • 2 posts

Posted 12 March 2014 - 14:31

I am working on an InstallShield 2013 Professional basic msi project.

 

I am sure that this is a basic question but I can't find documentation on exactly how to set a value in my app.config xml file from a value entered into a custom dialog window I created.

 

My custom dialog box is in my "InstallWelcome" sequence. It contains an Edit Field with a property called "PADERTCENTRALDBSERVERNAME". Now, in my XML File Changes I have my app.config file and in the General tab the Element Name is set to 

add[@key="CentralDBSQLServerInstance"]

and Attribute is set to "value", the Value is set to [PADERTCENTRALDBSERVERNAME], the Operation is set to "Append" & the Scheduling is set to "Install"

 

The Advanced tab has just the "Update first matching element only"

 

This is the node in the xml config file that contains the value I would like to modify (in red):


<add key="CentralDBSQLServerInstance" value="RHEA\PADERT"></add>

When I execute my installation the config file node that I am trying to change keeps its original value of "RHEA\PADERT" but the "PADERTCENTRALDBSERVERNAME"'s default value of "0" is appended, so I guess the property is not getting set when the user types into the Edit Field in the custom dialog box. Can someone point me in the right direction?

 

Thanks



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 12 March 2014 - 14:41

Please go to Property Manager and find the property named SecureCustomProperties. It's value is a semicolon delimited list of property names. Does it include PADERTCENTRALDBSERVERNAME? If not, add it.

 

Also, creating a log file should show you when and how the property is set (and maybe reset).



nluciano

nluciano
  • Full Members
  • 2 posts

Posted 12 March 2014 - 14:53

Thanks for the reply.

Yes, I do have a property for PADERTCENTRALDBSERVERNAME in SecureCustomProperties, and log files are created during installation. That property appears 4 times in the file all the way at the bottom:

Property(S): PADERTCENTRALDBSERVERNAME = 0
Property(S): SecureCustomProperties = ISFOUNDNEWERPRODUCTVERSION;USERNAME;COMPANYNAME;ISX_SERIALNUM;SUPPORTDIR;DOTNETVERSION40CLIENT;PADERTINSTANCEKEYFOUND;IS_SQLSERVER_LIST;IS_SQLSERVER_DATABASE;IS_SQLSERVER_AUTHENTICATION;IS_SQLSERVER_USERNAME;IS_SQLSERVER_SERVER;IS_SQLSERVER_PASSWORD;INSTALLDIR;PADERTCENTRALDBSERVERNAME
Property(C): PADERTCENTRALDBSERVERNAME = 0
Property(C): SecureCustomProperties = ISFOUNDNEWERPRODUCTVERSION;USERNAME;COMPANYNAME;ISX_SERIALNUM;SUPPORTDIR;DOTNETVERSION40CLIENT;PADERTINSTANCEKEYFOUND;IS_SQLSERVER_LIST;IS_SQLSERVER_DATABASE;IS_SQLSERVER_AUTHENTICATION;IS_SQLSERVER_USERNAME;IS_SQLSERVER_SERVER;IS_SQLSERVER_PASSWORD;INSTALLDIR;PADERTCENTRALDBSERVERNAME


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 12 March 2014 - 16:34

That's the value of the property at the end of the sequence. But in a verbose log you should also see entries when the property is being changed, e.g. by your dialog.