It seems I can not get to configure the action. Maybe I'm wrong. Here is what I am trying to do:
I would like to run a custom action in my installation of the application (Visual Studio Installer project) that launches the executable. The executable merely performs some of the tasks of filecopy system.io, and I confirmed that the executable itself works fine on startup.
- I created an installer project
- added exe to the application folder
- switched to user actions and added exe to Commit step
- InstallerClass set to true
- The installer sent it without receiving the result that I was hoping for. So I added a line to write to the Windows log. I looked through the Windows log after running the installer, and it seems that it did not start. Added my debug.break to the Unisntalled / reinstalled exe code of my installer, and nothing happened. Finally, I sat down and watched the processes and confirmed that exe would never be executed.
Any thoughts?
Target systems: Windows XP, Vista Visual Studio version: 2008 Sp1 Language: VB.NET Target structure: 2.0
Excellent. I think I'm getting closer thanks to the code you posted. I converted it to VB and I get this error: I can not find myexename.savedstate. I suppose I should pass something into the signboards that you posted, but I don't know what. (by the way this is a console application) I added a link to System.Configuration.Install.dll and here is my code:
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
I did not call it. I’ve never used the Installer class before. I could do something very new. According to your instructions, I added the code that was inserted below in exe, which I want to run during my installation. I added exe to my application folder and then added it to the commit user action. Now here is the code that I have in the source of my exe that I am trying to run:
_
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
Hmmm ... In Exe Project Properties, I clicked "Sign Build" and the error went away. However, it looks like exe is not running the code I want.
source share