More Group Sites
Education Books
School Rankings
Jobless Net
Better Home
Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
#1 Posted : Sunday, 9 March 2014 9:39:48 AM(UTC)

Rank: Administration


Groups: AcademicCoachingSchool, admin, Administration, BookSeller, CatholicSchool, CoachingAdult, CoachingProfessional, CoachingSports, ExtraCurriculumCoaching, IndependentSchool, Moderator, MusicTeacher, PrivateSchool, PublicSchool, SelectiveSchool, tutor
Joined: 23/11/2008(UTC)
Posts: 523

Use MSI custom installer in Visual Studio

In the custom MSI installer, need to set RunInstallerAttribute.
This attribute specifies whether the Visual Studio Custom Action Installer or the Installutil.exe (Installer Tool) should be invoked when the assembly is installed.

Custom installer - event handling or override
There are two ways to use the custom installer.
1. override
// Override the 'OnAfterInstall' method.
protected override void OnAfterInstall(IDictionary savedState)
// Add steps to be done after the installation is over.
Console.WriteLine("OnAfterInstall method of MyInstaller called");

2. event handler - Occurs after the Install methods of all the installers in the Installers property have run.
this.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.GenetecInstaller_AfterInstall);

If the AfterInstall event is not fired in the custom installer, check whether a custom action hasn't been added. If the primary output of the assembly has been added to custom action, it should call the event handlers such as BeforeInstall and AfterInstall. This should be all that is required to fire the BeforeInstall and AfterInstall events.

Customisation: launch application via a javascript
How can I customize an MSI in the Visual Studio setup/deployment project?
cscript.exe "$(ProjectDir)EnableLaunchApplication.js" "$(BuiltOutputPath)"

Get Target Directory in MSI setup project
Windows installer would in this case dictate the BaseDirectory (for example, C:\Windows\System32) and not the path of the assembly you are installing. Like Rocky Lohtka said, “its about where it is called and not where it is defined!”

To get the target directory property value in your custom action, you can forward it manually by selecting your custom action output in the custom action view and putting something like:

as the value for the CustomActionData property.
Note the addition of the backslash.

You should then be able to access it by:
string targetDir = Context.Parameters[ "TargetDir" ];

Visual Studio Install Project: Get Target Directory

Using custom configuration section and custom actions to update and deploy App.config for different regions dynamically with Msi package

Edited by user Sunday, 9 March 2014 9:45:26 AM(UTC)  | Reason: Not specified

Rss Feed  Atom Feed
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.