Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Custom Install Module not working
 

Custom Install Module not working

It seems the custom installer I wrote to install a custom event log durint installation is not working. I'm sure the installer class is properly written, but I can't get it to run during installation. This is my class:

Code Snippet

<RunInstaller(True)> _

Public Class LaunchDPQ

Inherits Installer

Private WithEvents myEventLogInstaller As EventLogInstaller

Public Sub New()

System.Diagnostics.Debugger.Launch()

If EventLog.SourceExists("Company X, Inc.") Then Exit Sub

'// Create an instance of an EventLogInstaller.

myEventLogInstaller = New EventLogInstaller()

With myEventLogInstaller

.UninstallAction = UninstallAction.NoAction

'// Set the source name of the event log.

.Source = My.Application.Info.ProductName

'// Set the event log that the source writes entries to.

.Log = "Company X, Inc."

End With

'// Add myEventLogInstaller to the Installer collection.

Installers.Add(myEventLogInstaller)

End Sub

I've added the project output to the Application Folder and included the project output under Install in Custom Actions.

I've had it working fine in another project. Not sure whatI'm forgettingto do.

Thanks.

Marshall

myoungbl  Tuesday, March 04, 2008 11:17 PM

Hi,

someone told me lately that if you have a custom action you have to include the affected project output to all Custom Action Sections:

Install,

Rollback,

Commit and

Uninstall

Also when the Install method is the only method that is overridden, you have to add the assembly that implemets the installer classto all the other sections too. Doing so solved my troubles...

Cheers,

Mario M.

Mario M_  Friday, March 07, 2008 7:14 AM

Hi Marshall,

You can adda custom action at Installation in order to do something you expect.

Here is the detailed solution step-by-stepapplied toVisual Studio .NET 2005.

Walkthrough: Using a Custom Action to Display a Message at Installation

The walkthrough demonstrates how to use a custom action to take user input and pass it to a message box that appears during installation. This is a simple demonstration of custom actions, which are useful for many other tasks. For example, a custom action could take as user input the location of the Setup.exe file and use it to launch the application after installing it.

1. To create a custom action

2. To create an installer class

Code Snippet

'Add the following procedure to override the Install procedure of the base class

Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)
MyBase.Install(stateSaver)
' Do something you expect
Dim myInput As String = Me.Context.Parameters.Item("Message")
If myInput Is Nothing Then
myInput = "There was no message specified"
End If
MsgBox(myInput)
End Sub

3. To create a deployment project

4. To add a custom action

5. To customize the installation user interface

6. To install on your development computer

7. To deploy to another computer

8. To test the installation

9. To uninstall the application

Some references:

Allows you to specify additional actions to be performed on a target computer during installation. Custom actions are contained in .dll, .exe, VBScript, JScript, or Installer class files within your solution.

To access the Custom Actions Editor, right-click a setup/deployment project in Solution Explorer -> click View context menu -> click Custom Actions.

The following walkthrough demonstrates the process of creating a DLL custom action to direct a user to a Web page at the end of an installation.

Move it from VB General forum to ClickOnce & Setup Deployment forum for better responses.

Regards,

Martin

Martin Xie - MSFT  Friday, March 07, 2008 6:41 AM

Hi,

someone told me lately that if you have a custom action you have to include the affected project output to all Custom Action Sections:

Install,

Rollback,

Commit and

Uninstall

Also when the Install method is the only method that is overridden, you have to add the assembly that implemets the installer classto all the other sections too. Doing so solved my troubles...

Cheers,

Mario M.

Mario M_  Friday, March 07, 2008 7:14 AM

Hi,

I have done customActions with the Help of MSDN. I have followed all steps.

AddedSetUp project,Added Installer.vb, added User Interface "TextBox(A), selected CustomAction by selecting the

SetUp project and in the Install node, taken OutPut project. Parameters are given in CustomActionData like

\temp1="[EDITA1]" <space>\temp2="[EDITA21]". I can say I have done with all the steps. I have written code in Install method like below.

Public Overrides Sub Install(ByVal stateSaver As System.Collections.IDictionary)

MyBase.Install(stateSaver)

MsgBox("Install method is in progress")

Dim str As String = ""

str = Context.Parameters.Item("temp1")

str = str & "----" & Context.Parameters.Item("temp2")

Dim objClassLibrary As New ClassLibrary.Class1

objClassLibrary.MessagePopUp("Class Library Message: " + str)

Dim objFrm As New Form1

objFrm.TextBox1.Text = str

objFrm.ShowDialog()

End Sub

And build the application and tried to install the exe, no popup is coming up. I can feel that Install method is not getting executed. But exe is successfully getting installed.

Can any one suggest me to work it out. Please ... I have no enough time.

Thanks in advance,

Kiran.

Kiran Betha  Wednesday, May 07, 2008 9:02 AM

You can use google to search for other answers

Custom Search

More Threads

• Execute EXE after installation
• multiple part question about the appupdater component.
• Return a value from Custom Action DLL?
• How to use WiX to create an MSI-based installer that will install the WSS 3.0 redistributable
• UpdateAsync() hanging
• Move Source Drive for files in deployment
• Setup - Validation and advanced configuration.
• how to refer external entities in main cofiguration file
• Exposing User Control Properties and Methods to IE
• Setup and deployment issue