473,320 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to get the installation directory in a Custom Action?

I am using Visual Studio 2005. I have just figured out how to create a Custom Action during installation, but I can not figure out how to get data from the installer. Following is the simple test code that I am trying to use to call the directory that the user defines during installation, but the Path string is not returning anything.

Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
MyBase.Install(stateSaver)
Dim Path As String = MyBase.Context.Parameters("targetdir")
Dim AppConfigFile As String = Path & "\Files\AppConfig.txt"
MsgBox("The target filepath is: " & AppConfigFile)
End Sub

I have tried many other things, such as...
Me.Context.parameters("targetdir")
stateSaver.item("targetdir")
etc.
And I entered /INSTALLDIR="[TARGETDIR]\" in the custom action data property.
Nothing is working.

Thanks.
Dec 9 '10 #1
1 10618
I figured out what the issue was. My custom action data property was not correct. It should have been
/targetdir="[TARGETDIR]\"
to match the parameter value in the code itself.

I also learned that other parameters can be captured in a similar way in the custom action data property, such as...
/parameter1="[EDIT1A]"
from a user entry text box.
Dec 9 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Jamie Bissett | last post by:
I cannot find ant doc to indicate how to access the user selected installation directory during the install process. I am trying to update the application confiduration file based upon some of the...
1
by: Jamie Bissett | last post by:
I have written an installer class that I invoke as a custom action. I have asses 2 screens in the installation process that pass data to this Installer Class. I have succesfully debugged the...
2
by: Claire | last post by:
Hi I've created an installation package for my Service application. This is my first attempt at an install package. In the simplest install package, the files are being created in the target...
3
by: | last post by:
I have created a web setup project for my ASP.NET application that works fine. Also, I have followed the instructions for using a custom action to launch a web page after the installation is...
3
by: DC Gringo | last post by:
Hi, I'm trying to use a custom action to modify a database (rather than create one) using the VS.NET '03's help example called "Custom Action to Create Database During Installation". I've made...
3
by: Eric | last post by:
Using VS.Net 2003 .Net framework 1.1 SP1 Our installation project calls a Custom Action dll to perform post install actions. It fails if the .msi file is launch from a directory that contains...
1
by: Eric | last post by:
Our .Net installation project includes a custom action that is launched post install. When the msi is run from a desktop, all is fine. We tested an install doing an Active Directory push to...
1
by: rossu | last post by:
I need to deploy a couple of sets of third party drivers with my application and the customer would like the whole thing to run automatically when they put in the installation CD. These drivers...
13
by: Matt F | last post by:
I have a deployment project that I'm setting up. I need to perform a different custom action based on whether this is a first time install or an update. Does anyone have any idea if it's possible...
3
by: KennethLundin | last post by:
Hi, i'm developing a solution in VS9/CSharp. Now I'm constructing a deployment project for my appliation (thick, database driven, winforms, standard, good old type of application). During...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.