Click here to Skip to main content
13,092,310 members (59,550 online)
Click here to Skip to main content
Add your own
alternative version


42 bookmarked
Posted 5 Apr 2005

Editing MSI Deployment Packages with Orca and Adding Custom Shortcuts

, 5 Apr 2005
Rate this:
Please Sign up or sign in to vote.
Tutorial on Basic MSI Architecture, how to edit VS.NET Setups with Orca, and adding custom shortcuts.


This article is in the form of a compiled HTML help file. It describes some of the basic architecture of the MSI package created using the Visual Studio .NET Setup Project.

We'll look at how elements defined in the NET IDE are translated into an actual MSI setup. And we'll perform a simple exercise in customization of the MSI using the MSI editor tool Orca.

Developers occasionally ask how to create an Uninstall shortcut in their application setups. We'll use this customization as our example.

Having said that, let me state something for the record:

I am already well aware that this is contrary to Microsoft Logo Certification which states that applications should only be removed from the Control Panel. But consider the following:

Most developers never get their setups Logo Certified. In fact, most installs for Microsoft products themselves do not come even close to Logo Certifiable. (For that matter, Microsoft changes their "Best Practices Guidelines" like women change their shoes).

And as far as creating uninstall menu entries being against recommended best practices, as preached by Microsoft, look at what Microsoft practices: I just downloaded (on 04/05/2005) the latest MS SDK Platform Update. It creates an uninstall entry on the program menu! I also downloaded the Microsoft AntiSpyware Package. It creates an uninstall entry on the program menu. The MSDE setup? It creates an uninstall entry on the program menu. That's just for starters.

Uninstall menu entries are more user friendly than having to go to the Control Panel. They are nice to have particularly if you are creating a package, for example, that allows a 30 day trial.

If people want to add an uninstall entry, obviously Microsoft does not see anything wrong with it, and I see nothing wrong with it either.

And even if you are a die-hard adherent to MS Best Practices, you can use the same techniques to create other useful custom shortcuts. For example, an application that uses MSDE or SQL Server might want to include it's own menu entry to launch the Service Manager. This is a lot more user friendly than having to explain to a user that, they have to navigate to a different menu entry in case they need to manually start the SQL Server for some reason.

More importantly, we'll also take the first steps towards learning some basics about how Windows Installer packages are put together, and how to edit them etc. etc.

Since this is not a conventional programming tutorial, there is no source code. Just download the zip and open the help file. There are very detailed steps, descriptions, and images throughout. You'll need to have any version of VS.NET installed. If you use Visual Studio 6 with the VSI add-in that creates MSI's instead of using the Package and Deployment Wizard that will work just fine too, but you may have to add a few steps - look at the article on creating menu entries with VSI add-in on my website (the link is in the download).

You'll find links to the Orca and other SDK tools, you'll need in the help file.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
United States United States
I've worked in the chemical industry, nuclear power industry, and now healthcare (in that order).

My specialized area of IT interest is installer technologies.

You may also be interested in...


Comments and Discussions

GeneralModifiyng uninstall file Pin
josip cagalj28-Apr-09 2:37
memberjosip cagalj28-Apr-09 2:37 
GeneralThank you!! Pin
pointer4-Sep-08 3:56
memberpointer4-Sep-08 3:56 
GeneralUnable to read .chm Pin
samnino10-Dec-07 12:25
membersamnino10-Dec-07 12:25 
QuestionUnicode Pin
MHASSANF18-Dec-06 21:09
memberMHASSANF18-Dec-06 21:09 
QuestionControl Panel Shorcut Pin
naga_01_raj14-Feb-06 21:02
membernaga_01_raj14-Feb-06 21:02 
AnswerRe: Control Panel Shorcut Pin
rwestgraham2-Mar-06 10:43
memberrwestgraham2-Mar-06 10:43 
GeneralGood Article Pin
Javed Akhter Siddiqui9-Feb-06 0:04
memberJaved Akhter Siddiqui9-Feb-06 0:04 
GeneralRe: Good Article Pin
rwestgraham2-Mar-06 10:30
memberrwestgraham2-Mar-06 10:30 
QuestionHow to modify the uninstall link in ORCA Pin
ken12320-Apr-05 8:04
memberken12320-Apr-05 8:04 
AnswerRe: How to modify the uninstall link in ORCA Pin
_alank8-Apr-06 4:03
member_alank8-Apr-06 4:03 
AnswerRe: How to modify the uninstall link in ORCA Pin
Craig Steddy14-Apr-09 1:08
memberCraig Steddy14-Apr-09 1:08 
GeneralMSI Pin
David Nulty19-Apr-05 5:53
memberDavid Nulty19-Apr-05 5:53 
GeneralRe: MSI Pin
rwestgraham19-May-05 20:39
memberrwestgraham19-May-05 20:39 
GeneralCAB File Pin
Adalberto Rua Aguirre14-Apr-05 5:29
memberAdalberto Rua Aguirre14-Apr-05 5:29 
GeneralRe: CAB File Pin
rwestgraham19-May-05 20:21
memberrwestgraham19-May-05 20:21 
GeneralSome notes Pin
Andromeda Shun13-Apr-05 22:53
memberAndromeda Shun13-Apr-05 22:53 
GeneralRe: Some notes Pin
rwestgraham19-May-05 21:47
memberrwestgraham19-May-05 21:47 
Andromeda Shun wrote:
In Phase 3 'The Application File' you say "Each file is assigned a unique key derived from a GUID". In your setup, the component is identified with the same GUID with "C_" added as prefix. This is true for MSI packages created with Visual Studio, but it's not true generally. Files can be "named" with normal names, so your File entry could have been "HelloWorldExecutable" instead of a GUID.

This is true. Normal names can make authoring a setup from scratch easier. My article was based on the assumption that most developers would use a tool such as the VS.NET setup environment to create their basic MSI.

Andromeda Shun wrote:
Further down under 'The Run Hello World Shortcut' you say "The Target field makes no sense". This might be true when the MSI package is created by Visual Studio, and it's definitely true in your example, but generally it's not true. In an MSI package I created the Target field contains the path to the exe file '[INSTALLDIR]MyProgram.exe'.

Maybe I did not explain this peculiarity adequately. By saying "the Target field makes no sense" what I meant was that a logical interpretation of "Target" when discussing a shortcut is exactly what you describe - the target executable path.

However, when a MSI is created for an application with VS.NET, the Target value will be set to "DefaultFeature". What I should have said was that the "value of Target makes no sense" because it refers to a Feature, not the target for the shortcut itself.

This is because VS.NET IDE is very simplistic and assumes one application per setup, so the installer interprets the "DefaultFeature" as the application executable.

This is a typical example of why authoring MSI packages can be so difficult.

The MSI can interpret "Target" in the Shortcut table in several ways.

The Target field in the Shortcut table can have nothing to do with the actual shortcut target. Instead it can be a foreign key into the Features table that identifies the Feature with which a Shortcut is associated. So if you had two features in your setup, say "MainApp" and "UtilityApp", the shortcut for MainApp could have a Target value of "MainApp", and the shortcut for UtilityApp could have a Target value of "UtilityApp". The Windows Installer will resolve the Target values into the actual application paths when it executes.

You can also put a real target path value in. In your case this would be [TARGETDIR]\MyApp.exe. In my example the Target value for the Uninstall shortcut was [SYSTEMFOLDER]\msiexec.exe.

There is a third possibility - you can put a file key value in the Target field, and the shortcut will be created pointing to the specified file.

This practice of overloading field interpretations can become very confusing. The reason why MSIs contain these overloaded interpretations is because of Advertising support. If you use advertising, you can end up creating shortcuts that are not evaluated in the conventional sense - i.e. a target file. Instead the shortcut triggers Windows Installer execution to install the advertised feature.

Andromeda Shun wrote:
In Phase 4 'Adding the Shortcut Entry' you say "I hope you wrote down the setup's ProductCode GUID at the beginning! (Don't say I did not tell you so!)". I don't remember reading this, the ProductCode was never mentioned. Perhaps I missed it, but perhaps you forgot it... Since searching in CHTML is not supported you have better ways of finding this out.

This was mentioned in Phase 1. However you should have been able to search the help file - it was compiled to include text searching capability.

Andromeda Shun wrote:
Your article is great, it gives a smooth introduction into the most important parts of the MSI database.

Thanks for the comments.


General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170813.1 | Last Updated 6 Apr 2005
Article Copyright 2005 by rwestgraham
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid