How to work with Assemblies in InstallShield Developer 7.0

This article describes how to work with assemblies in InstallShield Developer 7.0.

Introduction

InstallShield Developer 7.0 is the best solution for providing a very easy GUI interface to author installations having both .NET and Side-by-Side components.

InstallShield Introduction

InstallShield Developer 7.0 is the most powerful and flexible solution for authoring Windows Installer setups, enabling new features such as application auto-repair and install-on-demand. The InstallShield Developer IDE exposes all the capabilities of the Windows Installer architecture via abstracted views. It also offers a Windows Installer Direct Editor that allows you to fine-tune an installation by modifying tables.

.NET Assembly

A .NET assembly is a core part of the runtime. An assembly is the collection of all information required by the runtime to execute your application. This information is referred to as the Metadata. An assembly can be a DLL file or a Portable Executable (PE) file. An assembly that has been compiled into a portable executable (PE) file has an extension of AppName.exe.

A .NET assembly is something similar to a Windows Installer component, as .NET assemblies are always installed and removed as a singular unit. This is the reason what makes the Windows Installer the perfect engine to install .NET assemblies because the architectures are so similar.

Creating an Installation for a .NET Assembly

A .NET assembly can come in many forms. For example, we will discuss a simple .NET assembly containing only one file with the metadata embedded in the header of the file, and assume that this assembly was created in Visual Studio .NET. .NET assemblies can be installed local to the application or to the Global Assembly Cache (if appropriately signed).

These are the steps required to create a component for a simple .NET assembly:

Step 1:

Create a new project or open your currently existing project in InstallShield Developer 7.0.

Note: In order for your .NET assembly to install properly, the target system must contain the appropriate version of the .NET runtime components. Visual Studio .NET includes a Merge Module for the .NET runtime components. Be sure to include this Merge Module in your project if you are targeting platforms other than Windows XP.

Step 2:

In the Setup Design view, create a component which holds your .NET assembly.

Step 3:

Add all the files belonging to the assembly to the component's file list.

Step 4:

In the Advance Settings of the component, right-click on the Assembly node and select "New .NET Assembly".

Step 5:

After selecting the .NET Assembly node, examine the properties. You'll see that your .DLL or .EXE has automatically been selected as the Manifest file.

Step 6:

Select whether you want the assembly to be installed to the Global Assembly Cache or not, by setting the "Global Cache" property.

Note: Your assembly must be properly signed in order to be correctly installed into the Global Assembly Cache. See the .NET documentation for more information.

Step 7:

Set the Name, Version, and PublicKeyToken properties. If your assembly contains other properties, you may add them by clicking on the last row of the property list for your assembly.

Note: If your assembly does not have PublicKeyToken, you'll want to go into the Direct Editor and remove the PublicKeyToken value from the MsiAssemblyName table for your assembly.

The above steps were used to create a single component for a .NET assembly. Repeat the above process for each .NET assembly you are working with.

Creating an Installation for a Side-by-Side (Win32) Assembly

A Side-by-Side (Win32) assembly usually consists of a single Side-by-Side Portable Executable (.EXE, .DLL, .OCX, etc …) and its accompanying .MANIFEST file. Side-by-Side components only operate Side-by-Side on Windows XP, so you must take special care to author your installation to work on down-level platforms if you intend to support them. Side-by-Side components can be configured to be installed isolated to the application or to the Global Assembly Cache.

These are the steps required to create a component for a Side-by-Side assembly:

Step 1:

Create a new project or open your currently existing project in InstallShield Developer 7.0.

Note: Be sure to create an Install Condition in your Product Properties if your Side-by-Side components don't support down-level platforms.

Step 2:

In the Setup Design view, create a component to hold your side-by-side assembly.

Step 3:

Add all the files belonging to the assembly to the component's file list.

Note: If you don't set a key file, InstallShield will automatically set the .MANIFEST file as the key file in the next step.

Step 4:

In the Advance Settings of the component, right-click on the Assembly node and select "New .Win32 Assembly".

Step 5:

After selecting the Win32 Assembly node, examine the properties. You'll see that your .MANIFEST file has automatically been selected as the Manifest file.

Note: If you plan to target down-level platforms, be sure to include all the COM data that is part of your assembly in the COM Registration section of the component's Advanced Settings view. You can also use InstallShield's "extract COM information at build" or "component wizard" functionality to automatically extract the required COM data for down-level platforms. Note that on Windows XP, this information will be ignored and the manifest data will be used instead.

Step 6:

Select whether you want the assembly to be installed to the Global Assembly Cache or not, by setting the "Global Cache" property.

Note: Your assembly must be properly signed in order to be correctly installed into the Global Assembly Cache. See the Windows Platform SDK for more information.

Step 7:

Set the Name, Type, and Version properties. These values must be copied exactly as they appear in the assembly manifest. If your assembly contains other properties, you may add them by clicking on the last row of the property list for your assembly.

The above steps were used to create a single component for a Side-by-Side assembly. Repeat the above process for each Side-by-Side assembly you are working with.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

I have InstallShield 7.04 and had tried your method of installing .NET Assemblies. This, however, does not actually work!

What I had to end up doing was to set the ".NET Scan at Build" Option. If I tried to setup the .NET Assembly manually using your Method, they would never get installed into the GAC.

Also, one other thing. If you are installing .NET Assemblies into the GAC, you might as well make them "Permanent". Because if you do not, and you install your Program on another "Developer" PC that has the same components installed, those components will get removed and the Developer can no longer function properly without reinstalling their components. This is probably because the Reference Count isn't incremented when installing the Components as a 3rd party product, but they are from your InstallShield projects? Who knows. InstallShield is very quirky sometimes.

Can you pls go through the "Never Overwrite" Property of the Components properties.
I think this will give the solution.

Contet from InstallShiled Help below :

Check File Versions Before Installing

The Never Overwrite property allows you to indicate whether or not you want your installation to overwrite a file if it already exists on the target system.

Select Yes or No from the drop-down list:
If you select Yes, the file—if it exists on the target system—is never overwritten, regardless of the file version. Selecting Yes for this property overrides File Versioning Rules.

If you select No and the file version on the target system is newer than the version being installed, the file on the target system is not overwritten. However, if the version being installed is newer, the file on the target system is overwritten.

Windows Installer checks only for the existence of the component's key file when determining if it should install the component. If the component's key file does not exist on the target system, Windows Installer will install the component as if the Never Overwrite property were set to No.

Pls reply if any clarification.

I working in Wipro Technologies(Bangalore).
I am a Microsoft certified professional (MCSD.NET + MCAD.NET + MCP) with 4+ years of development experience in Microsoft technologies.

hi santosh,
i have a problem with installshield developer (version 8). the problem is, whenever i uninstall the project which i installed before. The dlls are not getting deleted from the system. I made sure that i am not using them while uninstalling but still the problem persists. This problem is their in a system with Windows 2000 OS. Please give me the solution for this.