Wednesday, November 03, 2004

Designing Good Setups

I have been mulling over the essentials of designing good setups and I found that most of it boils down to the component rules and the way you identify the data that goes to the setup. Microsoft enforces a set of rules that you should follow while authoring components. So, if the components are well managed, your product is well managed to a certain extent. Once you have identified the "Resources" in the setup, you would have to segregate them into components. Resources are bits installed by the setup, which do not change during the lifetime of the application, unless changed by a better version of the product by means of an MSI operation (small update/ minor upgrade/ major upgrade). Rob has blogged about what setup is and explains Resources, Application Data and User Data in good detail. I have my own opinions on handling application data. User Data is never installed, managed or removed and hence does not bother us.


Components are logical group of resources like Files, Registry entries, COM information, ODBC Data, Shortcuts and so on. Component is considered the atomic unit of installation. This statement is quite misleading and I have queued up a blog for Windows Installer's wierd behaviors to deal with that <grin/>.



  • As a rule of the thumb, you should place PE files (EXE, DLL, OCX and so on) individually in a component. Ensure that the key file that you select for a component is versioned. If the developer has not versioned the file, let him know that versioning a PE is very important to have a reliable upgrade. There are certain situations in which the setup developer has to assert his/her position to ensure the quality of the software shipped. After all if the installation fails, the customers would have no chance to further evaluate or use the product. If you have non-versioned resources that need to be upgraded, ensure that they are made companions to the key file of the component. This would ensure that the versioning logic for the component is consistent.

  • Never remove a resource or add a resouce to the component. If you have a file in the component, the only thing you can do is to bump up the file version or change the contents of the file itself. You can never add a file or remove a file from a component. This would result in incorrect reference counting and might prematurely remove resouces from the system or leave resource behind during uninstallation.

  • You cannot include resources going to multiple locations in the same component. Also you cannot change the destination of the component once declared. You would have to ensure that once the component design has been finialized, its destination's position in the directory product tree structure does not change.

  • If you have same file, especially a key file included in two different components that go to the same destination directory (e.g., 32 bit and 64 bit files or different language versions) ensure that these components are mutually exclusive by setting appropriate conditions on the components.

  • Component code and name of the component must be the same.

  • Make sure that there is only one COM server per component. Also ensure that the component is not linked to multiple features and is linked only to a single feature.

  • Ensure that shortcuts are included in the same component that has the file. Thus, the shortcuts are installed only when the file is installed. This might seem very elementary but people from other installation worlds like InstallScript, find this particularly hard to digest. 

Microsoft has also included a nice little article on things that could happen when component rules are broken in the Platform SDK.

5 comments:

Anonymous said...

group

HELLO Blogger

I was going to leave a little tip on New Years Resolutions and how to make the best of them.

Unfortunately, I would not be able to keep it brief.

Goal setting takes effort and you really have to know how to do it to do it well. Especially the follow-up.

That's why I've included a lot of FREE goal setting information on my website, to help folks like you be more successful.

In fact, you can start now, and get a head start on the new year - and the rest of your life.

Think goal setting isn't important?

Spend a little time at Developing Goals and you'll change your mind.

Have a GREAT day!

Anonymous said...

group

Hi Blogger

Have you done anything earth shattering lately?

Read anything that really sets your mind on fire with a passion to do good?

How about doing something important for yourself?

Have you?

Do you know without a doubt where life is taking you?

Got a Plan?

Know how to get there?

Most people don't. They just go through life hoping for the best. How can you possibly reach your dreams if you don't have a real plan?

A new year is coming. It's time to start thinking about your New Years Resolution and really start planning your life don't you think…

…follow through on some of those old goals you had years ago.

Even people in the goal setting business tend not to visit their "life plan" very often.

Are you one of those?

Need a little refresher and some FREE goal setting tips?

Spend a few minutes at Long Term Goals and take away life changing information.

Happy New Year!

Anonymous said...

Nice informative blog on Designing Good Setups . Please visit us at Payday Loans, for your Loans solution. We would also love your presence at No Fax Payday Loans & Fast Loan and share a moment with us. welcome!!!

Anonymous said...

Hi Blogger, Out surfing for information on get rid of boil & happened upon your site. While Designing Good Setups wasn't exactly spot on, it did strike a note with me. Thank you for the really good read.

Anonymous said...

We appreciate your blog Designing Good Setups and expect a piece of signature from your knowledge at our No Fax Payday Loans. your comments will be a boost for us.