开发者

Installation setup problem (Access a checkbox in custom dialog box)

开发者 https://www.devze.com 2023-03-23 17:09 出处:网络
I’m trying to create ainstallation setup for my VB.net application. I need to insert a custom action while setup is running. So I add a

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 rea开发者_JAVA百科lly 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.


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")


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

0

精彩评论

暂无评论...
验证码 换一张
取 消