Developer Center Resources

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding 'Shared' Files to an Installer Created with Application Builder

LabVIEW Add-on Dev Center » Distributing an Add-on » Adding 'Shared' Files to an Installer Created with Application Builder

 

The Application Builder Installer build specification does not support adding a shared component or file to an installer.  The purpose of a shared file is to allow multiple product installers to share a common dependency; for example, LabVIEW and LabWindows/CVI share a common dependency on the NI Example Finder.  Uninstalling LabVIEW or CVI should therefore not uninstall NI Example Finder unless both of the products are removed.  This document outlines how to achieve the shared file behavior with installers built in Application Builder by editing the MSI file created by LabVIEW to add an attribute (msidbComponentAttributesSharedDllRefCount) to the component table for the installer.

 

Requirements

You need a tool to edit MSI files.  In this example, I will demonstrate an open source utility called InstEd It! (v1.5.15.26).

 

How to

  1. Start by building your product installers using Application Builder and make a list of any files you intend to share between your product installers -- these are files you install to the same location on disk.  For example, if 'Product A' and 'Product B' were to install a file 'FOO' to the same C:\Program Files\ACME\ directory, the 'FOO' file would be considered a shared file and should be added to your list of shared files.
  2. After compiling your shared file list and building your installers, launch the InstEd editor
  3. In InstEd, go to File > Open and navigate to the MSI file created for one of your installers and choose to open the file.  The MSI file will be found under ..\builds\<Project Name>\<Build Spec Name>\Volume\bin\dp\ and is saved as 'install.msi'.
    Open MSI.png
  4. Switch to the Components tab and select the first of the files from your list of shared files
    Select shared component.png
  5. Double-click on the 'Attributes' field for your file to bring up the 'Edit' button
    double-click on attributes field.png
  6. Click the Edit button and select 'SharedDllRefCount' from the menu
    enable SharedDllRefCount.png
  7. Repeat steps 4-6 for the remaining files on your shared files list
  8. Save changes to your MSI and close the file
  9. Repeat steps 2-8 for any remaining MSI installers with shared files from your list
Contributors