MSI Application Packaging

Tuesday, April 26, 2005

Remove From Add/Remove!!

To ensure an application never appears in the Add/Remove list simply add the following property - ARPSYSTEMCOMPONENT and give it a value of 1

Thursday, March 24, 2005

Sequences

Sequences dictate when all of the actions that are associated with a setup will be executed. You can add, remove, or reorder actions in any sequence. For example, if you want to display a readme file as part of the setup, you can add a custom action to your setup that launches the readme file. This action must be inserted into a sequence. There are 3 different type of sequences, these determine the type of installation that Windows Installer will carry out on your application.

The INSTALL action (default way) instantiated by using the /I switch.If the application has a User Interface (or if /QN is not specified on the command line) then the install will first carry out the InstallUISequence. After this the InstallExecuteSequence will be carried out.

The ADVERTISE action instantiated by using the /J switch.If the application has a User Interface (or if /QN is not specified on the command line) then the install will first carry out the AdvtUISequence. After this the AdvtExecuteSequence will be carried out.

The ADMIN action instantiated by using the /A switch.If the application has a User Interface (or if /QN is not specified on the command line) then the install will first carry out the AdminUISequence. After this the AdminExecute will be carried out.

Tuesday, March 22, 2005

Installing an MSI application with Elevated Privileges

Ah that time old problem.... :o)
There are basically 3 ways of doing this:

  • On Win2k or NT4 PC's an admin user can set a Group Policy (AlwaysInstallElevated) for both PerUser and PerMachine installations. Basically when a standard user then goes to run a Windows Installer installation, the users rights get elevated to admin level and the application installs. This however is a security risk as a user can access normally secure areas of the PC and not only that they can install any MSI piece of software they want!!

  • On Win2k or NT4 PC's an admin user can Advertise an app via a per-machine installation. When the standard user clicks on the icon (assuming an icon is available from the advertised app), the app automatically installs using the privileges of the user that advertised it, marvellous eh ? ;o) Of course you could go the whole hog and have the admin user install the whole app (as opposed to advertise it) using a per-machine based install.

  • On Win2k an admin user can assign or publish an app by using group policy functionality within Active Directory. Standard users can then install the app as the installation takes place using elevated privileges.

Wednesday, March 09, 2005

Create .ISM from .MSI

Very quick tip today and one you will probably know...!!
To create an .ism file from your msi file simp,y open Installshield Editor and choose File/Open. Next, change the option in the bottom drop down box to 'Wizard' as opposed to 'Auto', choose your msi file and then simply follow the instructions, easy!!

Monday, March 07, 2005

Silent Installation

The simplest way to install your MSI packages with zero user interaction or dialogs is to set the LIMITUI Property to 2
Check out this link for further reading
http://www.installshield.com/news/newsletter/0212-articles/uilevels.asp

Wednesday, March 02, 2005

COM Registration Continued

ProgID
The ProgID, or program identifier, is a Registry entry that can be associated with a CLSID. Its format is .., such as Word.Document.8 which refers to an MS Word XP/2002 document. Format is as follows:
HKCR\HKCR\\(default) =
HKCR\\CLSID\(default) =
HKCR\\...

There are also version-independent program ID's with the format ., as follows:
HKCR\HKCR\\CLSID =
HKCR\\CurVer =
File Extension/Association
The File Extension assists the OS in knowing which program to run when you open a document with that extension by referring documents of a certain file extension to the appropriate ProgID. For example, when you double-click a Word .doc file, the system looks up the extension .doc and finds the reference to the ProgId Word.Document.8 where it can find the full path to the executable program msword.exe.
HKCR\CLSID\<.ext>\(default) =
Interface
If the component needs to register an interface, it requires the following syntax:
HKCR\Interface\HKCR\Interface\\BaseInterface
HKCR\Interface\\NumMethods
HKCR\Interface\\ProxyStubCLSID or ProxyStubCLSID32 =
AppID
Some EXE components group their registration information together with other related components, under a single AppID, as follows. The AppID is a string which looks like a filename, e.g. "MYAPP.EXE".
HKCR\AppID\HKCR\AppID\\AppID =
HKCR\AppID\\DllSurrogate or DllSurrogateExecutable =
HKCR\AppID\\LocalService and ServiceParameters
HKCR\AppID\\...
TypeLib
Type Libraries are required by some COM objects and are included in a separate file with an extension of .TLB. The following Registry keys are also set in this case:
HKCR\Interface\\TypeLib\(default) =
HKCR\TypeLib\\<#.#>\< #>\win32\(default) =
HKCR\TypeLib\\...

For example, if you have installed Microsoft Word, you see the .doc extension registered. If you drill into this key, you find an associated Program Identifier, or ProgID. A ProgID is Win2K’s way of wrapping a familiar name around the unfamiliar COM GUID. In the case of .doc files, depending upon the version of Word you have installed, it refers to a ProgID in HKCR named Word.Document.X, where X is the version number of Word. Under the Word.Document.X key, you find references to the Class ID that Word has registered for use with .doc files. Under this ProgID key, you find directions on the location from which Word is to be launched, which is used when the user double-clicks a .doc file. You also find other information, such as which icon should represent .doc files in the user interface.In HKCR, there are other important subkeys you should know. First, the AppID subkey (HKCR\AppID) houses information related to DCOM components registered on a system. DCOM is an extension of COM that lets components distributed across multiple Win2K machines communicate with one another. DCOM components use their own security model to determine under which security context the component can be instantiated and who can start or access a particular DCOM component. This information is stored in the AppID key on a per component basis. You see both GUIDs and ProgIDs kept within AppID, depending upon how they were written.The next important subkey in HKCR is the Interface subkey (HKCR\Interface). Each registered COM component includes a number of Interfaces that define pieces of functionality within that component. Interfaces are further broken down into methods, properties, and constants. Interfaces use GUIDs to uniquely identify themselves in the Registry. One or more Interfaces, with their associated methods, properties and constants, define a COM component.The final important subkey in HKCR holds Type Library definitions (HKCR\TypeLib). The Type Library is a programming aid to assist a COM developer in identifying which registered Interfaces are available for a given COM Component at runtime and when the object is instantiated. Type libraries are typically stored in a compiled binary file that ends with a .tlb extension.

Monday, February 28, 2005

Com Registration - CLSID

The CLSID, or class identifier, is an 128-bit number, expressed in hexadecimal and enclosed in curly-brackets, e.g. "{075BB8A1-B7D8-11D2-A1C6-00609778EA66}". This unique number identifies the component to the system.

One of the following values must exist to instruct the system where to find the component:
HKCR\CLSID\\LocalServer = full path to 16-bit EXE
HKCR\CLSID\\LocalServer32 = full path to 32-bit EXE
HKCR\CLSID\\InprocServer = full path to 16-bit DLL or OCX
HKCR\CLSID\\InprocServer32 = full path to 32-bit DLL or OCX

Other optional values include:
HKCR\CLSID\\ (default) = human-readable component name
HKCR\CLSID\\DefaultIcon = path to file, icon index #
HKCR\CLSID\\Insertable
HKCR\CLSID\\Interface
HKCR\CLSID\\ProgID = ProgID
HKCR\CLSID\\TreatAs (points to another CLSID GUID to get the info from)

So for example, on a PC you might have an entry under HKCR\CLSID\ as
{00020820-0000-0000-C000-000000000046}
Under here you can see the default entry for this component is Microsoft Excel Worksheet which immediately tells us what it is.
There is also an entry for it under ProgID which shows as Excel.Sheet.8, the ProgID section is an entry in the Registry associated to the CLSID that is easier to follow for human reading.

File Extension/Association
The File Extension assists the OS in knowing which program to run when you open a document with that extension by referring documents of a certain file extension to the appropriate ProgID. For example, when you double-click a Word .doc file, the system looks up the extension .doc and finds the reference to the ProgId Word.Document.8 where it can find the full path to the executable program msword.exe.
HKCR\CLSID\<.ext>\(default) = ProgID