DesktopEngineer.com Training & Services
Overview Windows Installer Vista Readiness Testamonials Formats Pricing Registration Resources Help & FAQ


Email Notification of New Dates and Classes

Training & Services > Resources > Tools and Scripts
MSI CA Reset Sources  rss

MSI CA Reset Sources

Are you trying to use environment variables in your source lists and you have to fumble around with all kinds of maintenance scripts to clear the first install location? What if your packages could handle it all by themselves? This script automatically inserts a custom action to do just that. Read on for New Version Updates Information

The inserted custom action will clear the source location created by the package installation and then populate the source list with the source locations contained in the SOURCELIST property. This is all done WHEN your package installs, rather than by maintenance scripts that run after your MSI package installs. If the SOURCELIST property isn't populated, the custom action does nothing and your package source list is configured with the normal default information. This script inserts the custom action into any given MSI - so you can easily insert the action in MSI package no matter where they came from - no need to decompile or recompile the package.

Version 1.2 Updates:

  • Altered custom action to use public property RESETSOURCES instead of SOURCELIST so that expected behavior of SOURCELIST is not altered when someone who does not know or remember that this custom action is present uses SOURCELIST
  • Added documentation.
  • New setup program that creates shortcuts and has an uninstall add/remove programs item.
Download Now (50 Kb)

msicaresetsources.exe msicaresetsources.exemsicaresetsources.exe

Documentation (Included in Download As Well)

This document is for version 1.2  Please see the script for complete version history information.  For detailed syntax information, run the script help ("cscript msiscript.vbs /?").

Attention, as of Version 1.2 this script uses the custom public property RESETSOURCES as it's source list.  This was changed so that the built-in property SOURCELIST would always act as expected, even when Reset Sources custom action is present.

Why This Script

 This script inserts a custom action into an MSI package. The custom action rebuilds the source list DURING a package installation.  It clears the current source list in order to remove the initial install location as the first source list entry and then adds each location listed in the RESETSOURCES property. Once inserted, this CA will act as intended with NO additional customization for each package. If the RESETSOURCES property is not populated, the custom action does nothing.

Sample usage scenarios for this script:

  • To dynamically redirect source lists for installs that initially occur from a location that should not be in the final source list.  For example you allow SMS to install from a regular distribution point, but then re-point the source lists to a DFS share or a managed server at each physical site.
  • To dynamically redirect source lists for installs that initially occur when the MSI is triggered by a SETUP.EXE.  Sometimes these types of setups end up having a source list that points to a temporary location.
  • Handles removing initial install location from source list during install, no need for wrapper scripts or maintenance scripts.
  • Helps with trickle type distribution systems where source list entries end up pointing to the local package cache.  Trickle distribution systems copy the installation files over a slow-speed connections by transfer during idle periods while the user is connected through a low speed connection.  They generally leave the source lists pointed to a temporary cache location on the local drive.  When the cache location is eventually cleaned out, the Windows Installer source lists will point to an incorrect location.

In Contrast to Authoring Tool Support:

  • Unlike the support built into popular MSI authoring tools, ResetSources does not embed your source list pointers in your package. Since they can be specified at the command line you will not need to rebuild packages if your source list strategy or design changes. If embedding is required it can be achieved by simply putting the sources property in the property table.
  • Because sources are specified at the command line you can implement a simplified source list strategy that does not rely on a local workstation configuration (such as an environment variable) to be properly configured on all client workstations in order to make source lists point at different resource across the organization - this can be done at runtime depending on site.
  • You can still use environment variables if you wish to be able to change source list entry root locations at some point after packages have already been installed. (MSISources.vbs can also do this for you when source lists are not environment variable based)
  • ResetSources can be turned off without packaging changes by simply not providing a source list. This allows the default behavior of the package to be retained without package changes or multiple versions.
  • ResetSources can be easily added to ISV packages because it does not make any other package changes or attempt to "fix" anything.

Command Lines:

 

  1. Prepare the package (adds the custom action to the package):

    cscript msicaresetsources.vbs abc.msi
     
  2. Use the RESETSOURCES property during package installation to reset the sources

    MSIEXEC /i abc.msi RESETSOURCES="\\acme.com\packages\abc;z:\packages\abc"

Script and Documentation Updates

For updates to this script and documentation visit http://desktopengineer.com/

Running The Script

License

This program is licensed under the GNU General Public License. See "license.txt" or http://www.gnu.org/copyleft/gpl.html

Reporting Problems and Requesting Improvements

If you find bugs in this script or make any improvements, please contact me at darwin@desktopengineer.com.

[Print Page] [Site Map] [Search] [Contact Us]


© 2010 DesktopAdmin.com, Inc.
All trademarks and copyrights on this page
are owned by their respective owners.