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. Customizing A Setup Project

Customizing A Setup Project

Scheduled Pinned Locked Moved C#
helpdatabasequestioncsharpvisual-studio
3 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.
  • T Offline
    T Offline
    TofuBug24
    wrote on last edited by
    #1

    I've got (what I think is a simple) problem. To which (I fear is not so simple) to fix. Currently I am trying to configure a setup project for my current solution (written using VS 2005 TS) now my solution consists of two or more projects (not including the setup project of course) I say two or more projects because my solution houses at the moment 2 VSTO designed word documents that are coded to pull information from a database fill in the blanks and print out the resulting document and close word automatically, I still have several Excel spreadsheets to code so the project list will grow. Now to access each of the word "documents" the Main project has a Process object that has it's properties set to point to the required word document. the program simply runs the process and each document handles closing itself and word automaticaly. right now the two documents full path locations including the document file name are stored in two string constants in the main programs .config file. under VS each of the two string constants are pointing to the ..\bin\release\"Document".doc under each word document's project folder Now my setup project at the moment has all the outputs from each project installed into the same folder under Program Files (which is just fine by me it's not that complicated to warrant sub folders) Now the problem lies in the fact that now the required document are no longer located where the .config file constants say they should be (they will be in the installion folder). Now I understand that any .config file under .net is XML and as such reading and writing to it should be as simple as reading and righting to a DB table my problem is how do I get my setup project to change the .config file's constants to point to the installed documents new locations. Ryan Data error reading Common Sense Abort,Retry,Ignore,Fail?iiiiiiii

    S 1 Reply Last reply
    0
    • T TofuBug24

      I've got (what I think is a simple) problem. To which (I fear is not so simple) to fix. Currently I am trying to configure a setup project for my current solution (written using VS 2005 TS) now my solution consists of two or more projects (not including the setup project of course) I say two or more projects because my solution houses at the moment 2 VSTO designed word documents that are coded to pull information from a database fill in the blanks and print out the resulting document and close word automatically, I still have several Excel spreadsheets to code so the project list will grow. Now to access each of the word "documents" the Main project has a Process object that has it's properties set to point to the required word document. the program simply runs the process and each document handles closing itself and word automaticaly. right now the two documents full path locations including the document file name are stored in two string constants in the main programs .config file. under VS each of the two string constants are pointing to the ..\bin\release\"Document".doc under each word document's project folder Now my setup project at the moment has all the outputs from each project installed into the same folder under Program Files (which is just fine by me it's not that complicated to warrant sub folders) Now the problem lies in the fact that now the required document are no longer located where the .config file constants say they should be (they will be in the installion folder). Now I understand that any .config file under .net is XML and as such reading and writing to it should be as simple as reading and righting to a DB table my problem is how do I get my setup project to change the .config file's constants to point to the installed documents new locations. Ryan Data error reading Common Sense Abort,Retry,Ignore,Fail?iiiiiiii

      S Offline
      S Offline
      S Akif Kamal
      wrote on last edited by
      #2

      My frd just write a custom action that will do the job for you and then add it in the setup project using Custom Actions view. To create a custom action, add a new project of type "Class Library", then add an installer class and override its "Install" and "Uninstall" methods. Both methods contains an argument of type IDictionary which can be used to store information that you want to pass to uninstaller from the installer. Call your config update logic from the install method. Finally add this project in setup as custom action from custom action view. Akif

      T 1 Reply Last reply
      0
      • S S Akif Kamal

        My frd just write a custom action that will do the job for you and then add it in the setup project using Custom Actions view. To create a custom action, add a new project of type "Class Library", then add an installer class and override its "Install" and "Uninstall" methods. Both methods contains an argument of type IDictionary which can be used to store information that you want to pass to uninstaller from the installer. Call your config update logic from the install method. Finally add this project in setup as custom action from custom action view. Akif

        T Offline
        T Offline
        TofuBug24
        wrote on last edited by
        #3

        Thanks so much for the help it was exactly what i needed much appreciated Ryan

        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