title: Setup project , Custom Installer, Connection string
body: <p>I'm working on a setup project.  In a separate library project I created a custom installer by inheriting from System.Configuration.Install.Installer and added the generated .dll as a custom action.(Install step). I added an app.config file to the library project where I store a connection string which I need to make a connection to Sql Server.</p>
  
  <p>Once I run the setup project, the custom installer doesn’t retrieve the connectionString stored in the app.config file.</p>
  
  <p>Where can I store the connection string? Can a setup project have an app.config? Could somebody recommend a book on deployment/setup projects?</p>
  
  <p>Thanks</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Hi,
  Thanks. Based on the replies I've updated my code this is what I´m doing now:</p>
  
  <p>-> In setup project, I added a custom action to the install step, selecting application folder and  primary output(library project).
  -> Added an app.config to the library project and set its build action to "content".
  -> Added the library project content files to the setup project.</p>
  
  <p>This way the app.config file appears in the install folder.</p>
  
  <p>Within the install handler from my custom install class I do the following: (in this case I access the application settings)</p>
  
  <pre><code>           string appPath = "";
          appPath = Path.Combine(new DirectoryInfo(Context.Parameters["assemblypath"].ToString()).Parent.FullName, "App.config");
  
          ExeConfigurationFileMap map = new ExeConfigurationFileMap();
          map.ExeConfigFilename = appPath;
          System.Configuration.Configuration c = null;
          c = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
          string result = c.AppSettings.Settings["test"].Value;
  </code></pre>