I have 2 projects in my solution
-
A Windows service
-
Its Setup project
I need that my ProjectInstaller : System.Configuration.Install.Installer‘s method called OnAfterInstall to get the ProductName from the Setup Project. How do I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Within your setup project right click project and select View > Custom Actions. Add a custom action. Now select Add Output, select your web service project, and click OK.
Now select your custom action and set the
CustomActionDataproperty to contain something like/ProductName=[PRODUCTNAME] /whateveryouwant=[Whateveryouwant](note that these are key-value pairs; i.e. to access the product name,ProductNameis the key and the value isPRODUCTNAME).Note that
CustomActionDatacontains the parameters that will be passed to your installer class. ThePRODUCTNAMEis the property name associated with the input control in the user interface dialog, and so in your case you would prompt user for Product Name within yor installer. So the label is “Product Name” and the corresponding property should be set asPRODUCTNAME(obviously you could change this, but the most important thing to note is that the UI property name must be the same as the property name in theCustomActionData) for this example to work.Now within your installer class you can get product name by doing
note i included the commented code
//System.Diagnostics.Debugger.Break();which you can comment in so that you can debug the installer class.hope this helps.