At times you may need to determine the path of the installer while installing your application. For example, you need to run a script or another executable through your installer. Now to find the path of the script(which you need to run through installer), you need to determine the path of your application’s installer.
To do that we can use CustomActionData property to determine this path.The CustomActionData property allows you to store information about the installation that can be read by the custom action.
Next, in your installer class add the following code:
Dim path As String = Context.Parameters(“DIR”)
Now, the string “path” will contain the path of your setup file.
Likewise you can use /DIR=”[TARGETDIR]\” in the CustomActionData property to determine the installation path of your application.