Get path to location user started setup.exe from [modified]
-
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
-
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
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...
-
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...
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 theContext
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 -
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 theContext
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:) Glad I could help.
Regards, mav -- Black holes are the places where God divided by 0...