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. Deployment.

Deployment.

Scheduled Pinned Locked Moved C#
csharpvisual-studiosysadminwindows-adminhelp
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.
  • S Offline
    S Offline
    Stephen Lintott
    wrote on last edited by
    #1

    Hi I was wondering if anybody knows how to create a MSI project(Setup and Deployment project). I am using Visual studio to do this but can't figure out how to pass parameters entered on screen to my registry. Any help would be appreaciated

    Stephen Lintott Bsc IT (RAU)

    B 1 Reply Last reply
    0
    • S Stephen Lintott

      Hi I was wondering if anybody knows how to create a MSI project(Setup and Deployment project). I am using Visual studio to do this but can't figure out how to pass parameters entered on screen to my registry. Any help would be appreaciated

      Stephen Lintott Bsc IT (RAU)

      B Offline
      B Offline
      BillyGoatGruff
      wrote on last edited by
      #2

      Hi Stephen, You will need to add an installer class to one of the assemblies that you are installing. Windows installer calls into this during the running of the msi. You can put .net code in this class to do pretty much whatever you need to do. This link should get you going on the right track. http://msdn.microsoft.com/en-us/library/system.configuration.install.installer.aspx[^]

      S 1 Reply Last reply
      0
      • B BillyGoatGruff

        Hi Stephen, You will need to add an installer class to one of the assemblies that you are installing. Windows installer calls into this during the running of the msi. You can put .net code in this class to do pretty much whatever you need to do. This link should get you going on the right track. http://msdn.microsoft.com/en-us/library/system.configuration.install.installer.aspx[^]

        S Offline
        S Offline
        Stephen Lintott
        wrote on last edited by
        #3

        OK lets say I've got a form that sets regestry values. I must add an installer class to that project and then add that project to the custom actions. Is that right?

        Stephen Lintott Bsc IT (RAU)

        B 1 Reply Last reply
        0
        • S Stephen Lintott

          OK lets say I've got a form that sets regestry values. I must add an installer class to that project and then add that project to the custom actions. Is that right?

          Stephen Lintott Bsc IT (RAU)

          B Offline
          B Offline
          BillyGoatGruff
          wrote on last edited by
          #4

          Yes that's along the right lines. Generally your project will output a single assembly (exe / dll). That assembly may have some requirements that need to be created at installation time - in your case, registry entries. So you build an installer class into each assembly, which handles the requirements for that assembly. So your installer class in this case, will read the parameters that are passed to it from the msi (which the user typed into the msi gui). It will then use these parameters when creating the registry entries. The assembly in question needs to be added to the custom actions - this is how the msi knows to look into that assembly and find the installer class and call its methods. The mapping between the msi gui fields and the CustomActionData property of the custom action in the deployment package designer is something like this: /MasterClientID=[MASTERCLIENTID] /LoggingPath=[LOGGINGPATH] /LogMsgsPath=[LOGMSGSPATH] /LogDbConnStr=[LOGDBCONNSTR] The code for retrieving the parameters in the installer is something like this:

          public override void Commit(IDictionary savedState)
          {
          string mstrClientId = Context.Parameters["MasterClientID"];
          string loggingPath = Context.Parameters["LoggingPath"];

          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