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. Get path to location user started setup.exe from [modified]

Get path to location user started setup.exe from [modified]

Scheduled Pinned Locked Moved C#
csharpdatabasesysadminworkspacesql-server
4 Posts 2 Posters 1 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.
  • D Offline
    D Offline
    Dave Buhl
    wrote on last edited by
    #1

    Hi folks, Hope I am not posting a dead horse here. My search-fu is weak with this topic. Very little relevant info from google or cp searches. Here is the scenario. I am building 2 projects. One is an admin module for a database that will install sql server and configure a connection string and dump it into and encrypted file. The admin will then copy this file to the location of the setup files for the user module. When the users/admin installs the user module, I would like to read the connection string from the file located in the setup location, which could be local or on a network share or anywhere else accessible. :sigh: How can I get the location of the setup.exe file that the user started at runtime. I am using VS2005 Pro, C#, .Net 2.0. I am not using clickonce, I have created a setup project and installer class with onafterinstall event handler. Forgot to mention this is a Windows Vista/XP desktop application not a web app. :doh: I have looked at the Context[parameter] object, System.Reflection namespace, System.Environment, Application Object and am not getting it.:confused: I would really appreciate any help you can give. I will probably feel really stupid when the answer hits. :-D Thanks much Dave

    modified on Sunday, June 8, 2008 3:16 AM

    M 1 Reply Last reply
    0
    • D Dave Buhl

      Hi folks, Hope I am not posting a dead horse here. My search-fu is weak with this topic. Very little relevant info from google or cp searches. Here is the scenario. I am building 2 projects. One is an admin module for a database that will install sql server and configure a connection string and dump it into and encrypted file. The admin will then copy this file to the location of the setup files for the user module. When the users/admin installs the user module, I would like to read the connection string from the file located in the setup location, which could be local or on a network share or anywhere else accessible. :sigh: How can I get the location of the setup.exe file that the user started at runtime. I am using VS2005 Pro, C#, .Net 2.0. I am not using clickonce, I have created a setup project and installer class with onafterinstall event handler. Forgot to mention this is a Windows Vista/XP desktop application not a web app. :doh: I have looked at the Context[parameter] object, System.Reflection namespace, System.Environment, Application Object and am not getting it.:confused: I would really appreciate any help you can give. I will probably feel really stupid when the answer hits. :-D Thanks much Dave

      modified on Sunday, June 8, 2008 3:16 AM

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Hi! IIRC there's no built-in way to access this information from inside a deferred custom action (that's what your OnAfterInstall event is). So you'll have to pass all the information you need in your CA inside the CustomActionData property. hth...

      Regards, mav -- Black holes are the places where God divided by 0...

      D 1 Reply Last reply
      0
      • M mav northwind

        Hi! IIRC there's no built-in way to access this information from inside a deferred custom action (that's what your OnAfterInstall event is). So you'll have to pass all the information you need in your CA inside the CustomActionData property. hth...

        Regards, mav -- Black holes are the places where God divided by 0...

        D Offline
        D Offline
        Dave Buhl
        wrote on last edited by
        #3

        mav, Thanks much, I was beating this thing around for hours and couldn't figure out what was going on. You led me right to the information I needed to clear it up. For anyone interested, the installer properties are not available to the deferred custom actions. If you need to access these properties you have to pass them to the deferred custom action in the CustomActionData property then you can retrieve the information through the Context object. The following articles were also helpful (which i wouldn't have found without your help mav :-D ). http://msdn.microsoft.com/en-us/library/9cdb5eda.aspx[^] and http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx[^] Thanks again for the big assist! Dave

        M 1 Reply Last reply
        0
        • D Dave Buhl

          mav, Thanks much, I was beating this thing around for hours and couldn't figure out what was going on. You led me right to the information I needed to clear it up. For anyone interested, the installer properties are not available to the deferred custom actions. If you need to access these properties you have to pass them to the deferred custom action in the CustomActionData property then you can retrieve the information through the Context object. The following articles were also helpful (which i wouldn't have found without your help mav :-D ). http://msdn.microsoft.com/en-us/library/9cdb5eda.aspx[^] and http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx[^] Thanks again for the big assist! Dave

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          :) Glad I could help.

          Regards, mav -- Black holes are the places where God divided by 0...

          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