Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Create config file in Visual studio installer

Create config file in Visual studio installer

Scheduled Pinned Locked Moved C#
csharpvisual-studiotoolsxmlhelp
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    WhoisUrBuddy
    wrote on last edited by
    #1

    Hi Guys, Application is almost done and now I'm trying to write the installer. Problem is I'm using an XML file for some of the configuration and I can't find how to create one using the installer. Is there something built into visual studio that can do this or will I have to write create some sort of post-install script?

    T 1 Reply Last reply
    0
    • W WhoisUrBuddy

      Hi Guys, Application is almost done and now I'm trying to write the installer. Problem is I'm using an XML file for some of the configuration and I can't find how to create one using the installer. Is there something built into visual studio that can do this or will I have to write create some sort of post-install script?

      T Offline
      T Offline
      TJoe
      wrote on last edited by
      #2

      If you include the xml file in your Application project (e.g. the C# exe project), then set it's Build Action to Content (select the file in the Solution explorer and then look at the Properties window). Then in your installer you can include the "Content Files" from your project. The files will then be copied to the install directory.

      Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com

      W 1 Reply Last reply
      0
      • T TJoe

        If you include the xml file in your Application project (e.g. the C# exe project), then set it's Build Action to Content (select the file in the Solution explorer and then look at the Properties window). Then in your installer you can include the "Content Files" from your project. The files will then be copied to the install directory.

        Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com

        W Offline
        W Offline
        WhoisUrBuddy
        wrote on last edited by
        #3

        Thanks Tom, but how do I modify the file during the install process? It's going to include some database strings, and other application/user specific settings. We normally have a wizard that runs on the first instance of the website that takes care of this. For security we have removed this and want it done during the install. (The old method wasn't perfect, but as a web developer, it worked for me) Regards. Joe

        T 1 Reply Last reply
        0
        • W WhoisUrBuddy

          Thanks Tom, but how do I modify the file during the install process? It's going to include some database strings, and other application/user specific settings. We normally have a wizard that runs on the first instance of the website that takes care of this. For security we have removed this and want it done during the install. (The old method wasn't perfect, but as a web developer, it worked for me) Regards. Joe

          T Offline
          T Offline
          TJoe
          wrote on last edited by
          #4

          If you want to create a config file during the install process, then I would use a Custom Action[^]. Here's an example[^] that creates a database. This blog entry[^] may help if you are deploying a web project. This blog entry[^] may help you if you need to troubleshoot an issue with your Custom Action.

          Take care, Tom ----------------------------------------------- Check out my blog at http://tjoe.wordpress.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups