Friday, December 10, 2010

About MSI - Microsoft Installer

Developing a software application is funny, but more rewarding is to see that it helped someone in its daily work, that its usefull and not superfluous. At this point the developer achieves to a dilemma, how will i distribute my software?

Microsoft provide software developers a component called Microsoft Installer, or MSI to friends, wich contains all the functionalities needed to install, mantain or remove the application from a Windows System.

To start open the context menu of your solution node in the solution explorer dock: Add\New Project. Then you will see the figure shown below:


Now using the setup project context menu you can add several projects outputs and distribute your application.

So this is the basics about MSI, but what i want to write about is Custom Actions and what i learned about it today. So i needed to transfer information between two different custom actions and i thought that i could use the parameter stateSaver from the event install, but it did not workout because it is used to save installation parameters to be shared across all the installation events of the custom action in context. So i questioned my colleague Abel about a idea to solve the problem, and the answer could'nt be more simple, "try to use a static dictionary". With that in mind i created a static class with a property that is a Dictionary and other information, refactored the code to use my new class and went for testing. Result, the test worked out in the first try.

References:
http://en.wikipedia.org/wiki/Windows_Installer
http://devcity.net/Articles/339/3/article.aspx
http://msdn.microsoft.com/en-us/library/aa368066(VS.85).aspx

No comments:

Post a Comment