We take pride in your success. We let our positivity drive us, day in and out. Talk to us at Mindfire to know us more.

Software Technology Tips

To get the installation directory , where the application got installed we can use the COMMIT event of the installer class.Following are the steps we need to follow for getting the installation path :
  1. In the custom actions window of setup project add the primary output for Install, Commit, Uninstall and Rollback.
  2. Right click on the primary output of Commit tag and check the properties. Need to add /DIR="[TARGETDIR]\" to the CustomActionData property.
  3. In the Installer class add the following code in the commit event.
[VB.NET CODE STARTS]
 
        Public Overrides Sub Commit(ByVal savedState As System.Collections.IDictionary)
            MyBase.Commit(savedState)
            Dim strInstallationDirPath  As String = ""
   ' --This line gives the installation path as saved in the DIR variable in Custom Actions
                     strInstallationDirPath  = Me.Context.Parameters.Item("DIR")
                ' You can now use the path and do whatever you need to 
       End Sub
 
[VB.NET CODE ENDS]


Related Tags:

VB.NET

Author: Amrita Dash

top

VB.NET

Let us Connect!

privacy

copyright (c) Mindfire Solutions 2007-2012. Login