[wix-users] Can custom Bootstrapper Application's UI get stored property values from registry using 'remember' pattern?

Phill Hogland phill.hogland at rimage.com
Wed Jun 15 06:45:53 PDT 2016


I may not be thinking clearly (as I have been sick lately)  but when you define in your bundle:
<Variable Name="InstallFolder" bal:Overridable="yes" Persisted="yes"  Type="string" Value="[INSTALLFOLDER]" />

What (or where) is INSTALLFOLDER defined.  It is not the same as the MsiProperty named INSTALLFOLDER, so if you are expecting it to be linked in some why I am not sure how, or I am missing something.  I would use Variable/@Persisted='yes' and bal:Overidable='yes' as you have done, but I would set the Value to one of the Burn defined root folders. Something like:
<Variable Name="InstallFolder" bal:Overridable="yes" Persisted="yes"  Type="string" Value="[ProgramFIlesFolder]Company\" />

In the BA, after reading the Engine Variable 'InstallFolder', any changes should be written back to the Engine Variable 'InstallFolder' prior to calling Engine.Apply() and Burn will persist those values and load them when restarted in a maintenance scenario.

Since my MSIs also include advertised features/shortcuts I find that it is also important to implement the Remember-pattern for the MsiProperty in order to support MSI's on-demand behavior.  I would not expect a repair of my MSI without being driven by Burn, but I still need to have initialized Properties available when MSI kicks of a on-demand install of a MSI for various reasons.  In this regard my MSI always has a non-advertised Feature to which the Remember-Property pattern components are associated so that they are installed and available if any other feature which is advertised results in an on-demand install.  I have not had any reason to try and get the remember-property pattern value by the BA, because the Burn Persisted value is the same value and it already has that value.  And my MSIs don't have any UI so they do not change the value that was passed to them.

I hope these ramblings may help.  I certainly agree that Burn Variable/@Persisted is a very useful feature!
________________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of John Zajac <jzajac2 at gmail.com>
Sent: Wednesday, June 15, 2016 7:36:58 AM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] Can custom Bootstrapper Application's UI get stored property values from registry using 'remember' pattern?

Whoops. In case it helps, here it is defined in my Bundle.wxs:

 <Variable Name="InstallFolder" bal:Overridable="yes" Persisted="yes"
Type="string" Value="[INSTALLFOLDER]" />

<Chain>
      <MsiPackage SourceFile="$(var.TestPackage.msi"
                  Visible="no"
                  >

        <MsiProperty Name="INSTALLFOLDER" Value="[InstallFolder]"/>
       <MsiPackage />
<Chain/>

On Wed, Jun 15, 2016 at 7:31 AM, John Zajac <jzajac2 at gmail.com> wrote:

> The Persisted variables don't seem to be working for me. (I'm using
> v3.10.2.2516)
> What would this look like in my log (edited for brevity)?
>
>
> [0808:0A48][2016-06-14T14:38:55]i001: Burn v3.10.2.2516, Windows v6.3
> (Build 9600: Service Pack 0), path: C:\ProgramData\Package
> Cache\{f5778739-0cec-40ac-b776-085221295863}\testPackage.exe
> [0808:0A48][2016-06-14T14:38:55]i000: Initializing string variable
> 'InstallFolder' to value '[INSTALLFOLDER]'
> [0808:0A48][2016-06-14T14:38:55]i000: Initializing string variable
> 'Prerequisite' to value ''
> [0808:0A48][2016-06-14T14:38:55]i000: Initializing numeric variable
> 'InstallLevel' to value '1'
> [0808:0A48][2016-06-14T14:38:55]i000: Initializing string variable
> 'DisableAction' to value '1'
> [0808:0A48][2016-06-14T14:38:55]i000: Initializing string variable
> 'DisableServiceControl' to value '1'
> [0808:0A48][2016-06-14T14:38:55]i009: Command Line: '/uninstall'
> [0808:0A48][2016-06-14T14:38:55]i000: Setting string variable
> 'WixBundleLog' to value
> 'C:\Users\johnz\AppData\Local\Temp\testPackage_20160614143855.log'
> [0808:0A48][2016-06-14T14:38:55]i000: Setting string variable
> 'WixBundleManufacturer' to value MyCompany'
> [0808:0A48][2016-06-14T14:38:55]i000: Loading managed bootstrapper
> application.
> [0808:0A48][2016-06-14T14:38:55]i000: Creating BA thread to run
> asynchronously.
> [0808:0B3C][2016-06-14T14:39:22]i000: Running the Test BA.
> [0808:0A48][2016-06-14T14:39:22]i100: Detect begin, 1 packages
> [0808:0A48][2016-06-14T14:39:22]i101: Detected package: TestPackage.msi,
> state: Present, cached: Complete
> [0808:0A48][2016-06-14T14:39:22]i000: Invoking automatic plan for uninstall
> [0808:0B3C][2016-06-14T14:39:26]i000: Creating a UI.
> [0808:0A48][2016-06-14T14:46:05]i000: Setting string variable
> 'InstallFolder' to value ''
> [0808:0A48][2016-06-14T14:46:05]i199: Detect complete, result: 0x0
> [0808:0A48][2016-06-14T14:46:05]i200: Plan begin, 1 packages, action:
> Uninstall
>
> On Tue, Jun 14, 2016 at 11:56 PM, Rob Mensching <rob at firegiant.com> wrote:
>
>> Doesn't the Persisted Variables do all the work for you? No need to
>> remember (unless you want the MSI to be able to repair without interaction
>> from the Bundle... which would be a pretty weird requirement).
>>
>> _____________________________________________________________
>>  Short replies here. Complete answers over there:
>> http://www.firegiant.com/
>>
>>
>> -----Original Message-----
>> From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On
>> Behalf Of John Zajac
>> Sent: Tuesday, June 14, 2016 9:19 PM
>> To: WiX Toolset Users Mailing List <wix-users at lists.wixtoolset.org>
>> Subject: [wix-users] Can custom Bootstrapper Application's UI get stored
>> property values from registry using 'remember' pattern?
>>
>> I have a custom WiX BA with a custom UI which collects information from
>> the installing user and stores/retrieves them in the registry using the
>> 'remember' pattern. With this approach, what is the recommended way for
>> getting this info back from the registry so that both the BA (for the UI)
>> and the MSI (for custom actions) can have them for Uninstall, Repair,
>> Modify, etc?
>>
>> I am using Variable elements in my bundle, for example:
>>
>> <Variable Name="MyProperty" bal:Overridable="yes" Persisted="yes"
>> Type="string" Value="[MYPROPERTY]" />
>>
>> and then MyProperty elements in my Chain\MsiPackage:
>> <MsiProperty Name="MYPROPERTY" Value="[MYPROPERTY]"/>
>>
>> Again, for my MSI, I typically persist user input into RegistryValue
>> elements and then retrieve their values with RegistrySearch, then feed them
>> back into the property (the 'remember' pattern).
>>
>> I based my bootstrapper application off of the WixBA project which calls
>> Engine.Detect() before showing the UI.
>>
>> Or, do I need to have the BA code itself just query the registry?
>>
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant
>> http://www.firegiant.com/
>>
>
>
>
> --
> -John
>



--
-John

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list