Click here to Skip to main content
6,306,412 members and growing! (18,419 online)
Email Password   helpLost your password?
Development Lifecycle » Installation » General     Intermediate License: The Code Project Open License (CPOL)

MSI Custom Action Decoder

By joaquinjares

A simple tool to encode the custom action's type column in MSI databases
C# (C# 1.0, C# 2.0, C# 3.0), Windows
Posted:18 Sep 2008
Views:3,680
Bookmarked:2 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
2 votes for this article.
Popularity: 0.80 Rating: 2.67 out of 5

1
1 vote, 50.0%
2

3
1 vote, 50.0%
4

5

Introduction

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.

Background

Before reading this article, you should have a good grasp on what a 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.

License

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

About the Author

joaquinjares


Member
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.
Occupation: Software Developer (Senior)
Company: Independent
Location: Argentina Argentina

Other popular Installation articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 3 of 3 (Total in Forum: 3) (Refresh)FirstPrevNext
GeneralGreat Tool PinmemberGord Smith5:45 15 Apr '09  
GeneralRe: Great Tool Pinmemberjoaquinjares5:55 15 Apr '09  
GeneralRe: Great Tool PinmemberGord Smith12:01 15 Apr '09  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 18 Sep 2008
Editor:
Copyright 2008 by joaquinjares
Everything else Copyright © CodeProject, 1999-2009
Web15 | Advertise on the Code Project