3

I’m trying to create a installation setup for my VB.net application. I need to insert a custom action while setup is running. So I add a Checkbox Dialog box to my setup. And I add a dll to the setup installation to capture Before Install and After Install events. Those are works fine. But I cannot access my check box value in those events. If u guys can give me a hint to continue my work really appreciates.

Following is the Before Install event I have created. I have set some messages to verify my event works correctly. While I run the setup those messages are prompt properly.

Private Sub Installer_BeforeInstall(ByVal sender As Object, _
                               ByVal e As System.Configuration.Install.InstallEventArgs) Handles MyBase.BeforeInstall
    Dim koFaxPath As String = Nothing
    MsgBox("Installer_BeforeInstall: Starts1")

    Dim contextParameters As StringDictionary
    Dim sb As System.Text.StringBuilder = New System.Text.StringBuilder
    Dim actionDataName As String = String.Empty
    Dim arrayActionData() As String

    contextParameters = Me.Context.Parameters
    For Each actionDataName In Me.Context.Parameters.Keys
        arrayActionData = Me.Context.Parameters(actionDataName).ToString.Split("-")
        MsgBox(actionDataName.ToString)
        MsgBox(arrayActionData(0).ToString)
        MsgBox(Me.Context.Parameters.Item(actionDataName.ToString))
    Next


    Try
    Catch ex As Exception
        'needs to impliment
    End Try

    MsgBox("Installer_BeforeInstall: Ends")
End Sub

Thanks in advance.

2 Answers 2

3

I have found the answer for that. It may useful for u as well. Once you have add your dll to the setup project, Go to dll properties. There is a property called CustomActionData. Fill it as follows

/CheckBoxSequenceGenerator="[CheckBoxName]"

Now you can access this in following code

Context.Parameters("CheckBoxSequenceGenerator")
Sign up to request clarification or add additional context in comments.

Comments

0

Please make sure that your check-box property are not assigned to coding.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.