Managed Bootstrapper: Failed while prompting for source

3

I'm delivering 3 msi packages in my Managed Bootstrapper (MBA). User is given choice to select which packages they wants to install. All goes well. When the user tries to Modify the installation from Control Panel, selects new package from dialog and original source (MBA.exe) is missing, installation failed with following log:

[553C:0A88][2016-03-30T16:00:54]w341: Prompt for source of container: WixAttachedContainer, path: D:\work\MBA.Install.Bundle\bin\Debug\MBA.exe<br/>
[553C:0A88][2016-03-30T16:00:54]e054: Failed to resolve source for file: D:\work\MBA.Install.Bundle\bin\Debug\MBA.exe, error: 0x80070002.
[553C:0A88][2016-03-30T16:00:54]e000: Error 0x80070002: Failed while prompting for source (original path 'D:\work\MBA.Install.Bundle\bin\Debug\MBA.exe').
[553C:0A88][2016-03-30T16:00:54]e311: Failed to acquire container: WixAttachedContainer to working path: C:\Users\Me\AppData\Local\Temp\{1338381A-F85F-4B6D-83EA-A0A2D1A369C1}\10A35D6D6CAC04B3DC248033B1588CBD67AD698B, error: 0x80070002.
[553C:0A88][2016-03-30T16:00:54]i000: CachePackageComplete: Pkg_Id=EMS.Server Resulted=None
[553C:0A88][2016-03-30T16:00:54]i000: CacheComplete: Status=-2147024894
[553C:3C24][2016-03-30T16:00:54]e000: Error 0x80070002: Failed while caching, aborting execution.

I've tried to capture this in ResolveSource event handler. e.LocalSource and e.DownloadSource are readonly properties. There is not criteria to download missing file, all needs to be present locally.

I read about the Propmpt to get the Source of original installer here: https://blogs.msdn.microsoft.com/heaths/2007/10/25/resolvesource-requires-source/

but this is about msi installer, while in my MBA, this dialog is suppressed.

Questions:

  1. How can I set the LocalSource manually (may be by taking input via dialog from user)?
  2. Can I set WixAttachedContainer to some other working path at runtime but taking input from user?
  3. Can we set Engine.SetLocalSource() at runtime?

Thanks a bunch...

wix
bootstrapper
burn
asked on Stack Overflow Mar 30, 2016 by Farrukh Waheed • edited Dec 7, 2017 by Ondrej

2 Answers

1

After reading other posts and one good reply from Wix-Users email list, I got the idea which has succeeded partially:

  1. In ResolveSource event handler, I called Engine.SetLocalSource(),
  2. then called Engine.Detect().

This would reset all searches, etc, etc and would re-initiate the Add/Remove/Uninstall/Repair session with updated path in e.LocalSource. And this is working fine now.

Rest is, I have to struggle a little to hide the restart of session and continue the screen from where user selected new component (or if de-selected any), i.e. I guess PlantAction(LaunchAction.Install).

That I almost figured-out where this would be injected, just have to drown into code again (its MVVM actually :( )

answered on Stack Overflow Apr 2, 2016 by Farrukh Waheed • edited Dec 6, 2017 by Ondrej
1

This can be bug in WiX toolset - see https://github.com/wixtoolset/issues/issues/5586

  1. Override or hook on ResolveSource event.
  2. Change LocalSource of the container using SetLocalSource()
  3. Set Result of the event to Result.Retry

See following example:

    private void OnResolveSource(object sender, ResolveSourceEventArgs e)
    {
        var wixBundleOriginalSource = Application.Engine.StringVariables["WixBundleOriginalSource"];

        Application.Engine.Log(LogLevel.Verbose, $"Setting local source for {e.PackageOrContainerId} to '{wixBundleOriginalSource}' (WixBundleOriginalSource)");
        Application.Engine.SetLocalSource(e.PackageOrContainerId, e.PayloadId, wixBundleOriginalSource);

        Application.Engine.Log(LogLevel.Verbose, $"Retry to resolve source for {e.PackageOrContainerId}");
        e.Result = Result.Retry;
    }
answered on Stack Overflow Dec 6, 2017 by Ondrej • edited Jun 1, 2020 by Ondrej

User contributions licensed under CC BY-SA 3.0