Quantcast

Wix Bundle re-evaluate conditions before each package.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Wix Bundle re-evaluate conditions before each package.

Farrukhw
This post has NOT been accepted by the mailing list yet.
I'm working with a managed bootstrapper. In my bundle, I've one msi and one exe package (A big Winzip based self extractor installer), which must be installed before msi package. The msi package have to check if exe package was installed properly, because if installation of exe package fails or cancelled by user, msi should not proceed to installation.

Detect conditions are only evaluated at the start of installation, not during or between the packages installations. Unfortunately, bootstrapper doesn't detect if exe package was failed or canceled, as it is returning 0 whenever user cancels the installation.

Q: Is there any method/trick to re-evaluate the install condition, after exe package installation and just before msi package starts its installation, so that msi package InstallCondition would be evaluated?

BTW, I  can think of two solutions:

 1. Evaluate detect conditions (write again) inside msi, but I want to inform user from bootstrapper UI.
 2. To do something in my bootstrapper's, DetectPackageComplete() method, but I don't think so, that would be a proper way.

Here are my code segments:

    <Bundle
        Name            =   "$(var.ProductName)"
        Copyright       =   "$(var.CopyrightNote)"
        Version         =   "$(var.FileVersion)"
        Manufacturer    =   "$(var.Manufacturer)"
        IconSourceFile  =   "$(var.IconFile)"
        UpgradeCode     =   "$(var.UpdgradeCode)"
        AboutUrl        =   "$(var.AboutUrl)"
        Compressed      =   "yes"
        Tag             =   "VA"
      >
   
    <util:RegistrySearchRef Id="PreReqRuntimeReg"/>
   
     <Chain>
          <RollbackBoundary Id="StartPoint"  />
          <PackageGroupRef Id = "Product_PreReq"  />
         
          <MsiPackage      Id                      = "MainProduct"
                           DisplayName             = "$(var.ProductName)"                      
                           DisplayInternalUI       = "no"
                           Cache                   = "yes"
                           Visible                 = "no"
                           Compressed              = "yes"
                           EnableFeatureSelection  = "yes"
                           SourceFile              = "$(var.MainProduct)"  
                           Vital                   = "yes"  
                           InstallCondition        = "PreReqRuntimeVersion=&quot;8.2&quot;"
           >
        </Chain>
      </Bundle>

     <Fragment Id="Product_PreReqs">
        <util:RegistrySearch Id="PreReqRuntimeReg"
            Variable="PreReqRuntimeVersion"                      
            Root="HKLM"
            Key="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ThirdParty Compiler Runtime 2013"        
            Value="DisplayVersion"
            Result="value"
            Win64="yes"
        />
       
        <PackageGroup Id="Product_PreReq">
          <ExePackage Id="PreReqRuntime2013"
            DisplayName="ThirdParty Compiler Runtime 2013"
            Description="ThirdParty Compiler Runtime 2013"
            Cache="no"
            Compressed="yes"
            PerMachine="yes"
            Permanent="yes"
            Vital="yes"
            SourceFile="D:\Pre-Reqs\Pre-Req2013_win64_installer.exe"
            Protocol ="none"  
            DetectCondition="PreReqRuntimeVersion=&quot;8.2&quot;"
            InstallCondition="(NOT (PreReqRuntimeVersion=&quot;8.2&quot;))"
             
          />   
        </PackageGroup>
       
      </Fragment>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Wix Bundle re-evaluate conditions before each package.

Farrukhw
This post has NOT been accepted by the mailing list yet.
For the time being, I'm now evaluating detect conditions inside msi, i.e. msi package with re-evaluate whenever it executes. And upon any failure, I'm showing user a generic message like "Installation is failed due to an error, please see the log for details."
At this point, I really feel the need to parse/capture/interpret msi errors and shows the user a real error message.
Loading...