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.
- Prepare the package (adds the custom action to the package):
cscript msicaresetsources.vbs abc.msi
- 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
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 email@example.com.