Click here to Skip to main content
13,295,953 members (53,019 online)
Click here to Skip to main content
Add your own
alternative version


5 bookmarked
Posted 18 Sep 2008

MSI Custom Action Decoder

, 18 Sep 2008
Rate this:
Please Sign up or sign in to vote.
A simple tool to encode the custom action's type column in MSI databases


Encoding a Custom Action Type field is relatively simple. You just need to use the different values as flags, and use that as a number. Decoding is a completely different matter. There are several conflicting rules, and various flags have the same value. To make matters more complex, the msidbCustomActionTypeBinaryData flag has a value of 0, making it impossible to use as a flag. In this very simple project, I have encoded the rules to decode.


Before reading this article, you should have a good grasp on what an MSI database is, and how to edit it using Orca. You will not be doing that with this program, but not being able to do that renders the contents of this article somewhat useless.

Using the Code

The rules for encoding are very simple, and they are as follows:

Action Types with values lower than 7 imply the use of msidbCustomActionTypeBinaryData. All others are not using it.

If msidbCustomActionTypeInScript is present, the values 0x100 and 0x200 are msidbCustomActionTypeRollback and msidbCustomActionTypeCommit. If it's not present, those values represent msidbCustomActionTypeFirstSequence and msidbCustomActionTypeOncePerProcess. Also, the value msidbCustomActionTypeClientRepeat should never be selected at the same time as msidbCustomActionTypeInScript.

The first 7 values are exclusive. That is, an action may be msidbCustomActionTypeDll, msidbCustomActionTypeExe, msidbCustomActionTypeTextData, msidbCustomActionTypeJScript, msidbCustomActionTypeVBScript or msidbCustomActionTypeInstall but none of them at the same time. This basically amounts to values 1 through 7 not being flags, but textual values.

Points of Interest

The Type column was obviously grown organically, and as such it doesn't make sense as a true flag. This makes sense historically, but it makes decoding much more difficult than what it should be. I hope my little program helps with that confusion.


  • 18th September, 2008: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior) Independent
Argentina Argentina
I have been working as a developer for 15 years now, starting with gwbasic, moving to C and VB and then to VB.Net and later C#. I've used many languages, as languages is what I really like.

You may also be interested in...


Comments and Discussions

GeneralGreat Tool Pin
Gord Smith15-Apr-09 5:45
memberGord Smith15-Apr-09 5:45 
GeneralRe: Great Tool Pin
joaquinjares15-Apr-09 5:55
memberjoaquinjares15-Apr-09 5:55 
GeneralRe: Great Tool Pin
Gord Smith15-Apr-09 12:01
memberGord Smith15-Apr-09 12:01 

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
Web03 | 2.8.171207.1 | Last Updated 18 Sep 2008
Article Copyright 2008 by joaquinjares
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid