Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / operating-systems / Windows

Installing .NET Application in Silent Mode using IExpress

2.61/5 (12 votes)
25 Oct 2006CPOL3 min read 2   5  
This article explains how to create a self extract package to install .NET application in silent mode

Introduction

My customer had come up with two requirements when I was trying to deliver my project.

  1. Only one standalone installation packages to install the application in users' machine.
  2. Application should install in silent/unattended mode.

Basically my client's support division was not familiar with the distribution of software or with .NET framework dependency. So my client wanted to maintain a single installer file which would help the admin/support to install the application in the target machine by just double clicking on it.

Silent/unattend/hands-free mode: Installation is one which does not require user interaction, except the indication of progress.

First of all, I thought Visual Studio 2005 came with lots of setup and deployment wizards, so it must have one type which generates the single self extract setup file to install the application and the .NET Framework prerequisites. But when I tried, VS 2005 gave me two files rather than one package.

  1. setup.exe - used to install the .NET prerequisites if the target machine did not have one.
  2. myproject.msi - that contains all my project EXEs and dependency files.

I am sure it could be achieved through the giant deployment software like installshield, wise and winzip. But the license matters made me think a lot. It took some time to find the solution, but I managed to find a way to get it done by using Microsoft IExpress.

IExpress

IExpress is a utility that comes with the IE Administrative Kit (IEAK) (hidden program :-)).

IExpress creates an output file, and executable (.exe) that contains all the files specified, and the instructions to carry out the extraction of these files. The files are stored compressed in Microsoft's cabinet format.

Click the Start Button, goto Run and type "iexpress".

More information can be found here.

Assumptions

I have assumed that the readers of this article must be familiar with Visual Studio 2005 setup and deployment wizard and functionalities.

Steps to Make Self Extract Package

In brief, the step to make the installation in silent/unattended mode are as given below:

  • Create a project that we want to install.
  • Create a setup and deployment wizard that will install our application in the target machine.
  • In the 'File System' window of the setup project, add the primary output of our application.
  • View the 'User Interface' window of the setup project. Remove all the UI dialogs from Install>start, Install > progress and Install > End.
  • It depends on the requirement, you may leave progress bar dialog or confirmation dialogue to notify the user that the setup is complete. (optional)
  • Make sure that the property 'Create setup program to install prerequisite components' is selected in setup project properties.
  • Build the setup project.
  • Now we have two files (myapplicaiton.msi and setup.exe) as the output of setup project.

Step to create the installation files / dependent files in a standalone installation package.

  • Once it is done, run the command 'IExpress' from the 'Start > Run' or command window.
  • The Iexpress window guides you about what needs to be packed and which setup file needs to be executed after extracting files.
  • Now we have only one package (<installpackage>.exe) which contains our standard setup files generated from VS 2005.

After the steps are done, now we will have only one package to distribute to the admin. It is very easy for them to keep only one file in their repository rather than multiple files.

History

  • 23 August, 2006 - Initial draft
  • 25 October, 2006 - Updated article with more explanation (thanks Bill)

Note: After reading this article, please give your comments and suggestions. It will help me to correct my mistakes and can also help other new readers.

License

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