Wednesday, November 24, 2010

Editing Installer (.MSI) through ORCA

Introduction:
This document attempts to provide a starting point to those who want to customize the MSI more than what is allowed through Visual Studio.

How to Obtain ORCA?
It’s installation is available when Windows SDK is installed. The installation is named ORCA.msi. After the successful completion of installation ORCA.exe will be available in Program Files

Editing installer in ORCA: After installation if you right click an installer, “Edit with ORCA” option will be available.

Otherwise you can open ORCA and click File-Open to get the traditional FileOpen Dialog.

Once the file is opened a list of tables will be displayed. These tables contain various aspects of information that direct windows installer about how to execute the MSI file.



In case you want to modify the control types or labels you can select the “Control” element form the “Tables” list The values in the Type column in control table can be modified if required. For example, if it is desired to display something as ReadOnly, we can change the type from Edit to Text.
The Text property holds the font, followed by contents. The contents can be changed to desired values. It must also be noted that in some cases Text property holds a property rather than literal value e.g [TARGETAPPPOOL].

Another Table is “Binary” which holds things like banner image. We can double click any entry to change the file associated with it.


Important Points to Remember:
Please note that all changes that you make in installer will be overridden when you recompile the installer, for example through Visual Studio.
In addition, remember that orca can only modify MSI files not exe. The setup.exe generated while creating MSI through Visual Studio actually calls the corresponding MSI file. Therefore changes in MSI will effect Setup.exe automatically

Friday, November 19, 2010

Embedding SQL Server Installation and Restoring SQL Server Database Backup during Installation

As mentioned before, most recently i was involved in creation of installer for one of our products. One of the activity that was to be performed during installation was the restoration of database backup and invoking installer of SQL Server after checking registry. In this post i am including links of the articles that i found useful regarding restoration of databse and installation of SQL Server

How to restore a SQL Server database in .NET when there are connections open
(This is the simplest and most effective way that I could find regarding restoring backup file)
Read It

Restore Database during Application Deployment
Read It

Walkthrough: Using a Custom Action to Create a Database at Installation
Demonstrates the use of a custom action and the CustomActionData property to create a database and database table during installation.
Read It

Embedding SQL Server Express into Custom Applications
This white paper discusses how to integrate and deploy Microsoft SQL Server Express-based applications by using configuration files and the ClickOnce deployment technology in Microsoft Visual Studio.
(The good idea that I got from this was to create wrappers for installers that would perform tasks that are not doable through the Installer/Custom Action as it executes after the completion of installation process, not before it)
Read It

How to Embed SQL Server Express in an Application
If your application uses SQL Server Express to host its database, you can freely redistribute the SQL Server Express product with your application. This article contains information and links that will enable you to successfully embed SQL Server Express as part of your application installation.
Read It

Sunday, November 14, 2010

Introduction to ORCA: A Tool to Customize Windows Installers

These days I am involved in an activity of launching one of our products in market as ISV (Independent Software Vendor). One of the activities in that is to create an Installer for the product.

The installer that is created for Web Projects through Visual Studio 2010 is quite generalized and it was felt by us that we must tweak it to some extent to fit our actual requirements.

For example, the initial screens of installer ask the user to specify a virtual directory and an application pool. For specifying the virtual directory the installer presents a TextBox and for application pool a combo box is provided. However, in our case we wanted them to be “Non-Editable” fields so that the user is only informed about the virtual directory and application pool.

After research it was found that Windows SDK contains a tool called ORCA which allows us to modify the Installer file as per our requirements
ORCA presents the installer file as a database containing number of tables. For example, there is a table named “Control” which stores information about all the controls used in the installer.

The values in the table can be modified as per the requirement. One problem that I faced is that there is not enough documentation readily available which shows how to use ORCA (Or maybe it is, but I was not able to find it). Therefore I will dedicate a future post to using ORCA.