Categories
How To Installer Tools

Editing MSI with OCRA

If you have worked with MSI then you probably know that it uses an internal database to store all kind of information and you can actually directly modify this information by using a great tool OCRA. It is tiny utility released by MSFT.

But unfortunately it is not “that” simple to get OCRA because it is not available as separate download , instead it is part of Windows SDK. Which means that if you want OCRA you have to download whole Windows 7 SDK. And even after downloading whole 1.4 Gb ISO, this tools is not easily visible. Once you download ISO (for x64 bit download), either make DVD or mount it as virtual drive (my preferred option) then go to \Setup\WinSDKTools_amd64 and open up cab1.cab. Inside that you will see WinSDK_Orca_Msi_5E20C107_DAA3_4D49_AFAE_7FB2594F0CDC_amd64 , extract that file and add extension .msi to it. And that is your installation for OCRA !! I really don’t know why such a great tool is hidden so deep by MSFT (and it is not the only great tool neglected by them). Once you install it you will see an additional entry “Edit with OCRA” in context menu whenever you right click on MSI.

Categories
How To Installer

Creating Application Shortcut in Programs for Windows Installer Project

It has been while since I posted something. Actually I was on very long vacation Open-mouthed smile for almost 2 months and during that time all I did was eating, traveling, sleeping and eating again … and now it is ended and I am back .. I think I have gained few pounds… so (just like every year) this new year I have taken resolution to get back in shape (that’s a different story that right now I am in crisis to stay resolute Confused smile).

Ok, enough babbling … I am sure everyone is familiar with shortcuts created for an application when we install it. Usually these shortcuts are created inside Programs’ menu (aka Start menu) and Desktop … sometimes you even have options to create in quick launch menu too. Actually it is very easy to achieve this in Windows Installation project and in this post I am going to show just that …

First step is to create new Visual Studio Installer project and give it any name. Since I am very bad with names, I simply gave it “TestMSI”. Then I added one text file I had for another post and added it installation. If you don’t know how to create an installation project or add a file into installation project then read this old 101 post. Once that file is added, say I want to create a shortcut of this file on user’s desktop and start menu. To create a shortcut in Start menu, select “File System” in MSI project and select “User’s Program Menu”. When it is selected, right click in work area and select “Create New Shortcut”.

Categories
How To Installer

Advance MSI creation … Part II

In First part of this How To I explained essential component required to manipulate MSI installation process and create funky installation process. In this part I will use that theory of 1st part and create an advance installation process which will do following steps as part of installation process …

1) Install a file at user selected location

2) Write a timestamp into that file

Under the hood this whole process actually includes more steps, this file is located into a temp folder from where this file will be copied to install directory and then I will write a timestamp to this file. And also I will remove that temp folder which was hosting this file originally.

Before anyone assumes that I am flippin’ genius or something and I have invented this whole thing, I would like to let you folks note that part of this post is based on MSDN post @ how to create custom actions in Installation projects. Rest of items are my ideas but believe me its not THAT difficult to make ‘em work Open-mouthed smile

Categories
Installer Tips

Advance MSI creation … Part I

Couple of months back I created a post about using Windows Installer Project in VS 2010 and how to create MSI from that. At that time I had very simple requirement to work on, create an installation package that just installs our product … recently that requirement got changed a bit and now I am suppose to perform some post installation processes once installation is done and to make things seamless, I have to include them as part of installation process (from my experience, only thing that doesn’t change is change in requirements Open-mouthed smile … which is kind of good … because as soon as requirements stop changing … you are out of job)

But before we dig deep, few things we need to get familiar with…

Custom Actions: from MSDN,

Custom actions are a Windows Installer feature that allows you to run code at the end of an installation to perform actions that cannot be handled during installation. The code can be in the form of a .dll, .exe, script, or assembly. For example, you might want to create a local database on the target computer during installation. You could create an executable file that creates and configures the database, then add that executable file as a custom action in your deployment project.

Categories
Installer Visual Studio

Creating custom “Prerequisites” for installation

If you have ever installed any software in your machine, you know what I am talking about. A textbook meaning of Prerequisite is

“A thing required as a prior condition for something else to happen”

It case of software it usually means that to run some piece of software it need to have something else present already, it can be either another software or a hardware. For any application developed in .NET has first prerequisite is … to have .NET framework already installed on that machine !! And if you have created any installer for your application then you know that this prerequisite is automatically handled by installer itself but what if your application has special requirement of its own, that needs to be satisfied to make application work properly ? At first glance it looks like that you have to write some sort of funny code to handle this situation … but it is not entirely true. Writing some kind of code and include it in your installer via dll is one way to do that but there is more easy and a bit forgotten solution available …which requires less effort compared to first option …. it is Bootstrap Manifest Generator for Visual Studio 2008, despite of its age, this piece of application still works very well for VS2010 .. and I hope that it will work with VS.next as well.

This software creates a manifest file for a any software that you want to use as a prerequisite and then you can use this manifest file to include that item in your installer’s prerequisite list. For this post … say I have an application which requires to have Firefox web browser already installed on a machine where I will be installing my application ! Now in real life it will be very very strange requirement for any application, but just bare with me this one Smile … ok ? Just like any good application installer, I will want to include setup of Firefox with my main MSI and if Firefox doesn’t exist on a machine then have it run before main installation starts. Available prerequisites for an application can be selected by going into Installation Project Property –> Prerequisites –> and then select what ever you want to have as a prerequisite … say .NET framework, Windows Installer, VC++ runtimes etc. But here you will see that Firefox doesn’t exist as an option to include as prerequisite. This is when Bootstrap Manifest Generator (from now on I will just call it BMG) comes in play. And in rest of post I will show how BMG can be used to add custom prerequisites for your installation project.

Categories
Installer Visual Studio

Installation Project in Visual Studio … Installer 101

During past couple of weeks I was greatly involved in process of creating MSIs for our new products. The ultimate goal was (still is) to improve overall installation experience of customers. During this time I mainly tinkered with one the project type in VS which I had never ever used before, that was “Visual Studio Installer” projects. Believe it or not VS has really neat ability to create fairly complex installation packages (MSIs). But for this post, I will be creating very simple MSI which just installs one text file into installation directory (I am saving more complex setups for later posts Smile)…

Installation_Project_1