vikasbapat
asked on
Installer Custom Action in msi setup
Hi guys,
I am developing a windows installer for my windows application. What I do is during the installation ,at the end, the setup asks for login credentials. I have overriden the commit method of installer class thus causing custom action to fire.
Here is my code :
<Security.Permissions.Secu rityPermis sion(Secur ity.Permis sions.Secu rityAction .Demand)> _
Public Overrides Sub Commit(ByVal savedState As _
System.Collections.IDictio nary)
MyBase.Commit(savedState)
If Not File.Exists(Environment.Ge tFolderPat h(Environm ent.Specia lFolder.Lo calApplica tionData) & "\DBConnect.xml") Then
Dim frm As New Login
frm.TopMost = True
frm.ShowDialog()
frm.BringToFront()
frm.Activate()
frm.Focus()
frm.WindowState = Windows.Forms.FormWindowSt ate.Maximi zed
This works perfectly . But now I want to fire this custom action afetr installation has been completed so I have modified the code as:
Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)
MyBase.OnAfterInstall(save dState)
' Add steps to be done after the installation is over.
If Not File.Exists(Environment.Ge tFolderPat h(Environm ent.Specia lFolder.Lo calApplica tionData) & "\DBConnect.xml") Then
Dim frm As New Login
frm.TopMost = True
frm.ShowDialog()
frm.BringToFront()
frm.Activate()
frm.Focus()
frm.WindowState = Windows.Forms.FormWindowSt ate.Maximi zed
End If
End Sub 'OnAfterInstall
End If
So as you can see I have used OnAfterInstall methos to override .But my problem is
The custom action still fires before the installation & not after installation is completed.
Any help ill be appreciated
I am developing a windows installer for my windows application. What I do is during the installation ,at the end, the setup asks for login credentials. I have overriden the commit method of installer class thus causing custom action to fire.
Here is my code :
<Security.Permissions.Secu
Public Overrides Sub Commit(ByVal savedState As _
System.Collections.IDictio
MyBase.Commit(savedState)
If Not File.Exists(Environment.Ge
Dim frm As New Login
frm.TopMost = True
frm.ShowDialog()
frm.BringToFront()
frm.Activate()
frm.Focus()
frm.WindowState = Windows.Forms.FormWindowSt
This works perfectly . But now I want to fire this custom action afetr installation has been completed so I have modified the code as:
Protected Overrides Sub OnAfterInstall(ByVal savedState As IDictionary)
MyBase.OnAfterInstall(save
' Add steps to be done after the installation is over.
If Not File.Exists(Environment.Ge
Dim frm As New Login
frm.TopMost = True
frm.ShowDialog()
frm.BringToFront()
frm.Activate()
frm.Focus()
frm.WindowState = Windows.Forms.FormWindowSt
End If
End Sub 'OnAfterInstall
End If
So as you can see I have used OnAfterInstall methos to override .But my problem is
The custom action still fires before the installation & not after installation is completed.
Any help ill be appreciated
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.