I'm using wix 3.6 RC and have created a managed boot loader. Based on the
xml comments in BootstrapperApplication.cs, I expected the
ExecuteFilesInUse event to be raised in the case a file in my .msi is
currently locked.  However, what I'm actually seeing is the Error event
firing with the following populated on ErrorEventArgs:

   ErrorType: WindowsInstaller
   ErrorCode: 1306
   Message: Another application has exclusive access to the file
'C:\Program Files (x86)\DemoProductInstaller\Component2\TextFile1.txt'.
 Please shut down all other applications, then click Retry.


Can you clarify when ExecuteFilesInUse is fired?

I'm hoping to show the user a dialog saying "file in use.." and give them
an opportunity to close the locking app and retry.  Do you have any
guidance on how to do this in an MBA scenario?

For reference, I produced this scenario as follows:

Created an msi that included an empty text file:

   <ComponentGroup Id="ProductComponents2" Directory="Cmp2Folder">
      <Component Id="CMP_emptyFile2"
Guid="{92BF9112-E20B-47A2-9C5E-562C6A346AB2}">
        <File Id="file_emptyFile2" Checksum="yes" KeyPath="yes"
Source="TextFile1.txt" />
      </Component>
    </ComponentGroup>

I then included that msi in a bundle where I implemented the MBA.
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"; xmlns:util="
http://schemas.microsoft.com/wix/UtilExtension";>
<Bundle Name="$(var.ProductName)"
          Version="$(var.ProductVersion)"
          Manufacturer="demo"
          UpgradeCode="$(var.UpgradeCode)"
          Compressed="yes"
          DisableRepair="yes" >

    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
      <PayloadGroupRef Id="InstallerUILibs" />
    </BootstrapperApplicationRef>

   <Chain>
      <!-- Install .Net 4 Full -->
      <PackageGroupRef Id="NetFx40Web" />

      <PackageGroupRef Id="DemoPackages" />

    </Chain>
</Bundle>


<Fragment>
    <PackageGroup Id="DemoPackages" >

      <MsiPackage
          Compressed="yes"
          SourceFile="$(var.DemoProductInstaller.TargetPath)"
          EnableFeatureSelection="yes"
          Vital="yes">

        <MsiProperty
          Name="APPLICATIONFOLDER"
          Value="[WixBundleDirectoryLayout]"/>
      </MsiPackage>

    </PackageGroup>
  </Fragment>

After installing the package, I opened the file in Excel, which placed a
file lock on the file.

I then choose "uninstall" from the Windows 7 Add/Remove programs menu for
the bundle to launch the MBA, which fires the Error event during the Apply
action.

thanks
~John
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to