[wix-users] Burn: How to pass RegistrySearch result value to Custom Bootstrapper

Ghenadie Tanasiev ghenadie.tanasiev at gmail.com
Tue Oct 3 04:31:34 PDT 2017


ERRATA :
<Variable Name="THIRDPARTY_INSTALL_DIR" Type="string" Value=""
bal:Overridable="yes"/>
<util:RegistrySearch Id="ThirdPartyInstallDirSearch"
 Root="HKLM"
 Key="SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
 Value="OceanSoftDir"
 Result="value"
 After="ThirdPartyInstallDirSearchExists"
 Condition="THIRDPARTY_INSTALL_DIR_Exists"
 Variable="THIRDPARTY_INSTALL_DIR"/>

On Tue, Oct 3, 2017 at 2:30 PM, Ghenadie Tanasiev <
ghenadie.tanasiev at gmail.com> wrote:

> Even if you set bal:Overridable="yes" in the variable
> "THIRDPARTY_INSTALL_DIR"  declaration?
>
> Can you try this please?
>
> <Variable Name="THIRDPARTY_INSTALL_DIR_Exists" Value="0" bal:Overridable="
> yes"/>
> <util:RegistrySearch Id="ThirdPartyInstallDirSearchExists"
>
>                        Root="HKLM"
>
>                        Key="SYSTEM\CurrentControlSet\Control\Session
> Manager\Environment"
>
>                        Value="OceanSoftDir"
>  Result="exists"
>  Variable="THIRDPARTY_INSTALL_DIR_Exists"/>
> <Variable Name="THIRDPARTY_INSTALL_DIR" Type="string" Value=""
> bal:Overridable="yes"/>
> <util:RegistrySearch Id="ThirdPartyInstallDirSearch"
>  Root="HKLM"
>  Key="SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
>  Value="InstallDirPath"
>  Result="value"
>  After="ThirdPartyInstallDirSearchExists"
>  Condition="THIRDPARTY_INSTALL_DIR_Exists"
>  Variable="THIRDPARTY_INSTALL_DIR"/>
>
> On Tue, Oct 3, 2017 at 1:38 PM, Farrukh Waheed via wix-users <
> wix-users at lists.wixtoolset.org> wrote:
>
>> Thanks for quick reply.
>> But this is simply passing Value = 0 to my Custom Bootstrapper.
>>
>> On 3 October 2017 at 15:14, Ghenadie Tanasiev via wix-users <
>> wix-users at lists.wixtoolset.org> wrote:
>>
>> > Hello,
>> >
>> >
>> > It is not clear, do you want to check if *OceanSoftDir *exists in
>> > registries, or you actually need to get it's value from the registry,
>> like
>> > installation path ? If so, *Result  *attribute of the* RegistrySearch *
>> > element needs to be changed to *value. *In the <Variable> element do not
>> > use $(var...) but assign a default value, which will be overridden by
>> > the *RegistrySearch
>> > *result, if anything will be found.
>> >
>> > an example:
>> >
>> > <Variable Name="InstallDirPathExists" Value="0"/>
>> > <util:RegistrySearch Id="InstallDirPathRegSearchExists"
>> >
>> >                      Root="HKCU"
>> > Key="SOFTWARE\$(env.APPNAME)"
>> > Value="InstallDirPath"
>> > Result="exists"
>> > Variable="InstallDirPathExists"/>
>> > <Variable Name="InstallDir" Type="string" Value="$(env.APPNAME)"
>> > bal:Overridable="yes"/>
>> > <util:RegistrySearch Id="InstallDirPathRegSearch"
>> > Root="HKCU"
>> > Key="SOFTWARE\$(env.APPNAME)"
>> > Value="InstallDirPath"
>> > Result="value"
>> > After="InstallDirPathRegSearchExists"
>> > Condition="InstallDirPathExists"
>> > Variable="InstallDir"/>
>> >
>> > Regards,
>> > Ghenadie
>> >
>> >
>> >
>> > On Tue, Oct 3, 2017 at 12:57 PM, Farrukh Waheed via wix-users <
>> > wix-users at lists.wixtoolset.org> wrote:
>> >
>> > > In my Bundle code, I'm trying to use the result of a registry search
>> to
>> > set
>> > > Variable to be used in my Custom Boostrapper:
>> > >
>> > >      <util:RegistrySearch
>> > >       Id="ThirdPartyInstallDirSearch"
>> > >       Variable="THIRDPARTY_INSTALL_DIR"
>> > >       Root="HKLM"
>> > >       Key="SYSTEM\CurrentControlSet\Control\Session
>> Manager\Environment"
>> > >       Value="OceanSoftDir"
>> > >       Result="exists"
>> > >       />
>> > >
>> > >     <Variable Name="THIRDPARTY_INSTALL_DIR" Type="string"
>> > > Value="$(var.THIRDPARTY_INSTALL_DIR)"/>
>> > >
>> > >
>> > > But this would give an error:
>> > > Undefined preprocessor variable '$(var.THIRDPARTY_INSTALL_DIR)'
>> > >
>> > > Basically, I want to pass the result of registry search to my custom
>> > > bootstrapper application.
>> > >
>> > > Thanks
>> > >
>> > > ____________________________________________________________________
>> > > WiX Toolset Users Mailing List provided by FireGiant
>> > > http://www.firegiant.com/
>> > >
>> >
>> > ____________________________________________________________________
>> > WiX Toolset Users Mailing List provided by FireGiant
>> > http://www.firegiant.com/
>> >
>>
>> ____________________________________________________________________
>> WiX Toolset Users Mailing List provided by FireGiant
>> http://www.firegiant.com/
>>
>
>



More information about the wix-users mailing list