title: Visual Studio 2008 Installer Project - Custom Actions not firing
body: <p>I can't seem to get a custom action working.  I might be doing this wrong.  Here's what I'm trying to do:</p>
  
  <p>I'd like to run a custom action in my application install (Visual Studio Installer project) that runs an executable.  The executable simply does some system.io filecopy tasks, and I've confirmed that the executable when ran by itself works perfectly.</p>
  
  <ol>
  <li>I created the installer project</li>
  <li>added the exe to the application folder</li>
  <li>went to custom actions and added the exe to the Commit step</li>
  <li>InstallerClass is set to true</li>
  <li>Ran the installer, didn't get the result I was hoping for.  So I added a line to write to the windows log.  Looked in the Windows log after running the installer again and it looked like it didn't run.  Added a debug.break to the exe code Unisntalled/reinstalled my installer and nothing happened.  I finally sat and watched the processes and confirmed the exe never gets executed.  </li>
  </ol>
  
  <p>Any thoughts?</p>
  
  <p>Targeted Systems: Windows XP, Vista
  Visual Studio Version: 2008 Sp1
  Language: VB.NET
  Targeted Framework: 2.0</p>
  
  <hr>
  
  <p>Excellent.  I think I'm getting closer thanks to the code you posted.  I converted it to VB and i'm getting this error:  Cannot Find myexename.savedstate.  I assume I'm supposed to pass something to the subs you posted but I don't know what.  (by the way this is a console application) I added a reference to the System.Configuration.Install.dll and here is my code:</p>
  
  <pre>
  
  Imports System.ComponentModel
  Imports System.Configuration.Install
  
   _
      Public Class ApplicationInstaller
          Inherits Installer
          Public Overloads Overrides Sub Commit(ByVal savedState As IDictionary)
              ' Do some work on commit
              The_Sub_I_Want_To_Run()
          End Sub
          Public Overloads Overrides Sub Install(ByVal stateSaver As IDictionary)
              ' Do some work on install
          End Sub
          Public Overloads Overrides Sub Uninstall(ByVal savedState As IDictionary)
              ' Do some work on uninstall
          End Sub
      End Class
  </pre>
  
  <hr>
  
  <p>I did not call that.  I've never used the Installer class before.  I might be doing something very rookie here.  Per your instructions, I've added the code that I have pasted below in the exe I want to run during my install.  I added the exe to my application folder, then added it to the Commit custom action.  Now here is the code I now have in the source of my exe that I'm trying to run:</p>
  
  <p><code></p>
  
  <pre>
    _
      Public Class ApplicationInstaller
          Inherits Installer
          Public Overloads Overrides Sub Commit(ByVal savedState As IDictionary)
              ' Do some work on commit
              The_Sub_I_Have_my_codein()
              MyBase.Commit(savedState)
          End Sub
          Public Overloads Overrides Sub Install(ByVal stateSaver As IDictionary)
              ' Do some work on install
  
          End Sub
          Public Overloads Overrides Sub Uninstall(ByVal savedState As IDictionary)
              ' Do some work on uninstall
          End Sub
      End Class
  </code>
  </pre>
  
  <hr>
  
  <p>Hmmm...  In the exe's Project Properties I clicked "Sign the assembly" and the error has gone away.  However, looks like the exe doesn't run the code I want it to.  </p>