ResolveSource Requires Source

ResolveSource Requires Source

  • Comments 4

It might be tempting to schedule the ResolveSource action, but ResolveSource actually requires that the original installation source is available whenever it is called. If your installer package is authored correctly, source must only be resolve in cases where the original RTM files are missing or during some patch uninstall scenarios.

To decrease the chance that Windows Installer itself will need original source, you should make sure that file versions and languages in the installer package match the file versions of the files to be installed by the package, and that all unversioned files have the correct hash in the MsiFileHash table. The Windows Installer SDK has more information along with a warning about scheduling ResolveSource.

The only reason to ever schedule ResolveSource is to set the SourceDir property. However, any dependency on this property should be questioned, since getting that value requires that you schedule ResolveSource to run. The original installation media isn't always available. For example, if the product was installed from a CD then that CD must also be available during maintenance installations when source is resolved. If the installer package was downloaded and installed from the Internet cache the location has probably been purged. If the installation is run silently, the installation will rollback and fail, returning ERROR_INSTALL_FAILURE (1603).

If you require SourceDir to run some configuration utility, for example, a better design would be to implement the configuration code in a data-driven DLL custom action. If that's not feasible, you should at least install that EXE configuration tool and call that from a type 18 custom action or even indirectly using a type 1 custom action to pipe process output to the installer log. This way the EXE can be called during maintenance mode and can even be patched if changes are necessary.

So what happens during source resolution? Whenever ResolveSource is executed or source is required to complete a FileCopy operation, for example, Windows Installer prints "Resolving source" to the verbose log like in the abridged, annotated example below.

The file copy operation requires the original RTM file to be reinstalled since the existing file is missing. System policy is checked first to see what is allowed.

MSI (s) (64:88) [23:41:28:813]: Executing op: FileCopy(SourceName=WiX.chm,SourceCabKey=WiX.chm,DestName=WiX.chm,Attributes=0,FileSize=417125,PerTick=32768,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,HashOptions=0,HashPart1=1923410312,HashPart2=1309456919,HashPart3=-1215450992,HashPart4=-381946868,,)
MSI (s) (64:88) [23:41:28:815]: File: C:\Program Files\Windows Installer XML v3\doc\WiX.chm; To be installed; Won't patch; No existing file
MSI (s) (64:88) [23:41:28:815]: Resolving source.
MSI (s) (64:88) [23:41:28:816]: Using cached product context: machine assigned for product: BD82C1EA6ACFD1B479B69470047E87E0
MSI (s) (64:88) [23:41:28:817]: User policy value 'SearchOrder' is 'nmu'
MSI (s) (64:88) [23:41:28:817]: User policy value 'DisableMedia' is 0
MSI (s) (64:88) [23:41:28:817]: Machine policy value 'AllowLockdownMedia' is 0
MSI (s) (64:88) [23:41:28:818]: SOURCEMGMT: Media enabled only if package is safe.
MSI (s) (64:88) [23:41:28:818]: SOURCEMGMT: Looking for sourcelist for product {AE1C28DB-FCA6-4B1D-976B-490740E7780E}
MSI (s) (64:88) [23:41:28:818]: Using cached product context: machine assigned for product: BD82C1EA6ACFD1B479B69470047E87E0
MSI (s) (64:88) [23:41:28:818]: SOURCEMGMT: Adding {AE1C28DB-FCA6-4B1D-976B-490740E7780E}; to potential sourcelist list (pcode;disk;relpath).
MSI (s) (64:88) [23:41:28:818]: Using cached product context: machine assigned for product: BD82C1EA6ACFD1B479B69470047E87E0
MSI (s) (64:88) [23:41:28:819]: SOURCEMGMT: Now checking product {AE1C28DB-FCA6-4B1D-976B-490740E7780E}
MSI (s) (64:88) [23:41:28:819]: SOURCEMGMT: Media is enabled for product.

Windows Installer attempts to use the LastUsedSource.

MSI (s) (64:88) [23:41:28:821]: SOURCEMGMT: Attempting to use LastUsedSource from source list.
MSI (s) (64:88) [23:41:28:823]: SOURCEMGMT: Trying source C:\Users\heaths\Downloads\.
MSI (s) (64:88) [23:41:28:824]: Note: 1: 2203 2: C:\Users\heaths\Downloads\Wix3[1].msi 3: -2147287038
MSI (s) (64:88) [23:41:28:824]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
MSI (s) (64:88) [23:41:28:824]: Note: 1: 1706 2: -2147483647 3: Wix3[1].msi

Windows Installer then processes the network, media, and URL source lists ordered by the SearchOrder logged above.

MSI (s) (64:88) [23:41:28:825]: SOURCEMGMT: Processing net source list.
MSI (s) (64:88) [23:41:28:825]: SOURCEMGMT: Trying source C:\Users\heaths\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\D8CHFEKZ\.
MSI (s) (64:88) [23:41:28:826]: Note: 1: 2203 2: C:\Users\heaths\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.IE5\D8CHFEKZ\Wix3[1].msi 3: -2147287037
MSI (s) (64:88) [23:41:28:826]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
MSI (s) (64:88) [23:41:28:826]: Note: 1: 1706 2: -2147483647 3: Wix3[1].msi
MSI (s) (64:88) [23:41:28:827]: SOURCEMGMT: Processing media source list.
MSI (s) (64:88) [23:41:28:830]: Note: 1: 2203 2: 3: -2147287037
MSI (s) (64:88) [23:41:28:830]: SOURCEMGMT: Source is invalid due to missing/inaccessible package.
MSI (s) (64:88) [23:41:28:830]: Note: 1: 1706 2: -2147483647 3: Wix3[1].msi
MSI (s) (64:88) [23:41:28:830]: SOURCEMGMT: Processing URL source list.
MSI (s) (64:88) [23:41:28:831]: Note: 1: 1402 2: UNKNOWN\URL 3: 2
MSI (s) (64:88) [23:41:28:831]: Note: 1: 1706 2: -2147483647 3: Wix3[1].msi
MSI (s) (64:88) [23:41:28:831]: Note: 1: 1706 2: 3: Wix3[1].msi
MSI (s) (64:88) [23:41:36:280]: SOURCEMGMT: Failed to resolve source

If running in full, reduced, or basic UI level Windows Installer will then prompt the user for source with the dialog initially populated with the LastUsedSource as shown in the screenshot below. If running silently, the error is logged and rollback commences.

MSI (c) (58:F4) [23:41:28:841]: SOURCEMGMT: Prompting user for a valid source.
MSI (c) (58:F4) [23:41:28:841]: Machine policy value 'DisableBrowse' is 0
MSI (c) (58:F4) [23:41:28:842]: Machine policy value 'AllowLockdownBrowse' is 0
MSI (c) (58:F4) [23:41:28:843]: SOURCEMGMT: Browsing is enabled.
MSI (c) (58:F4) [23:41:28:934]: Font created. Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg
MSI (c) (58:F4) [23:41:28:939]: Machine policy value 'DisableUserInstalls' is 0
MSI (c) (58:F4) [23:41:28:939]: SOURCEMGMT: Now checking product {AE1C28DB-FCA6-4B1D-976B-490740E7780E}
MSI (c) (58:F4) [23:41:28:940]: SOURCEMGMT: Media is enabled for product.
MSI (c) (58:F4) [23:41:28:940]: SOURCEMGMT: Attempting to use LastUsedSource from source list.

Finally if Windows Installer fails to find source, it spawns an error dialog and logs the error to the log, then proceeds to rollback the current transaction if any.

MSI (s) (64:88) [23:41:37:447]: Product: Windows Installer XML v3 -- Error 1706. An installation package for the product Windows Installer XML v3 cannot be found. Try the installation again using a valid copy of the installation package 'Wix3[1].msi'.

In general, do not schedule ResolveSource. If this runs when installing a patch, for example, the user will have to insert the original media whether they would otherwise need to or not.

Leave a Comment
  • Please add 1 and 4 and type the answer here:
  • Post
  • And if you find yourself supporting an install that requires it's source to be available, here are some good ways of doing it with SMS.

  • Hi,

    It took me some time to found that we hace this problem in our install due to the use of the 'ResolveSource' usage in a Crystal Reports 11.5 MSM file! (CrystalReports_RDC_Reportengine.msm)

    Since i cannot do anything about that, is there another solution to fix this? (Beside copying the original MSI file onto the users disk and adding a new source in the MsiTable for it?)

  • Chain a separate MSI with the CR MSMs that you can cache separately, or that you at least don't have to worry about patching. If any updates come out for CR, just rebuild a major upgrade MSI and chain that, removing the old one automatically (RemoveExistingProducts + Upgrade table) and installing the new.

  • When installing Visual Studio 2008, you might run into an error dialog that reads, Error 1330.A file

Page 1 of 1 (4 items)