[wix-devs] WIXBUG3704 - Allow access to persisted variables from related bundles

Sean Hall r.sean.hall at gmail.com
Wed May 5 15:00:19 PDT 2021


> If there is no API, how do formatted strings in the registry (no matter
how stored) get expanded?

The only thing that can expand formatted strings is the Burn engine because
it has access to the variables. Accessing a different bundle's FORMATTED
variable is dubious, but wanting to persist a FORMATTED variable
unformatted seems reasonable.

>  cast-in-stone, OS-dependent

Burn is Windows only. Is WiX going to be providing a Java API, a Go API, a
Rust API, etc.? People will want to access these things outside of a bundle.

>  Have we been documenting the status quo

How variables were persisted has been an implementation detail that was
undocumented because we wanted to reserve the ability to change it in the
future.

On Wed, May 5, 2021 at 4:49 PM Ron Martin via wix-devs <
wix-devs at lists.wixtoolset.org> wrote:

> Thanks, Sean. I will definitely check the resources you have referenced.
>
> If there is no API, how do formatted strings in the registry (no matter
> how stored) get expanded?
>
> Do you really want to choose a cast-in-stone, OS-dependent, ill-fitting
> mechanism over a friendly,
> somewhat abstract API that grow with new requirements in the future
> without giving up backward
> compatibility?
>
> Have we been documenting the status quo by detailing file paths and
> contents or has the source code
> simply made it possible for desperate users to achieve their goals by
> peeking over the wall? This is kind
> of brittle, isn't it?
>
>  From a user's point of view, I would hope that I had factored my use of
> these variables so that a simple
> drop in would upgrade from V3 to V4. Not being so smart or lucky, I
> would hope that a one-time refactoring
> would suffice.
>
> I think I'm on Jacob's side on the API/no API issue.
>
> Ron
>
> On 5/5/2021 5:22 PM, Sean Hall via wix-devs wrote:
> > WIP is at
> > https://wixtoolset.org/development/wips/4863-thmutil-literal-variables/.
> > Tests are at
> >
> https://github.com/wixtoolset/burn/blob/752f0e0576dc27e937c553ed9dce5576bd388e95/src/test/BurnUnitTest/VariableTest.cpp#L28
> > .
> > If you want to know when formatting happens, look in Burn for usages
> > of VariableFormatString.
> >
> > On Wed, May 5, 2021 at 3:53 PM Bob Arnson via wix-devs <
> > wix-devs at lists.wixtoolset.org> wrote:
> >
> >> AFAIK, it’s a string that is automatically formatted when retrieved. But
> >> my memory is fuzzy (generally).
> >>
> >> From: Hoover, Jacob <Jacob.Hoover at greenheck.com>
> >> Sent: Wednesday, 5 May, 2021 13:56
> >> To: WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org>;
> >> Bob Arnson <bob at firegiant.com>
> >> Cc: Ron Martin <cpuwzd at comcast.net>
> >> Subject: RE: [wix-devs] WIXBUG3704 - Allow access to persisted variables
> >> from related bundles
> >>
> >> Was hoping Sean would respond on this…  It is my understanding that the
> >> formatted string is expanded at runtime by the engine, when a variable
> is
> >> evaluated.
> >>
> >> There is concern that a string variable which is restored as formatted,
> >> that it could get variable expansion that it would not have, Also if a
> >> variable was formatted but is restored as a string that it would no
> longer
> >> get expansion.
> >>
> >> From: wix-devs <wix-devs-bounces at lists.wixtoolset.org<mailto:
> >> wix-devs-bounces at lists.wixtoolset.org>> On Behalf Of Ron Martin via
> >> wix-devs
> >> Sent: Tuesday, May 4, 2021 2:42 PM
> >> To: Bob Arnson <bob at firegiant.com<mailto:bob at firegiant.com>>; WiX
> Toolset
> >> Developer Mailing List <wix-devs at lists.wixtoolset.org<mailto:
> >> wix-devs at lists.wixtoolset.org>>
> >> Cc: Ron Martin <cpuwzd at comcast.net<mailto:cpuwzd at comcast.net>>
> >> Subject: Re: [wix-devs] WIXBUG3704 - Allow access to persisted variables
> >> from related bundles
> >>
> >> In what context is BURN_VARIANT_TYPE_FORMATTED expanded? Would it be
> >> stored in one context and
> >> interpreted in another? What can change in the context between creation
> >> and use?
> >>
> >> I'm just trying to get my head around the real issues.
> >>
> >> Ron
> >>
> >> On 5/4/2021 3:17 PM, Bob Arnson wrote:
> >>> BAs already have to specify a type when getting a variable value from
> >> the engine. The engine knows a variable's type when it persists the
> value
> >> -- so what if it required a variable to exist so it had the type when
> >> reading it? At that point, the registry type could be REG_SZ for
> >> everything, no encoding necessary.
> >>> -----Original Message-----
> >>> From: wix-devs <wix-devs-bounces at lists.wixtoolset.org<mailto:
> >> wix-devs-bounces at lists.wixtoolset.org>> On Behalf Of Rob Mensching via
> >> wix-devs
> >>> Sent: Tuesday, 4 May, 2021 14:13
> >>> To: WiX Toolset Developer Mailing List <wix-devs at lists.wixtoolset.org
> >> <mailto:wix-devs at lists.wixtoolset.org>>; Ron Martin <cpuwzd at comcast.net
> >> <mailto:cpuwzd at comcast.net>>
> >>> Cc: Rob Mensching <rob at firegiant.com<mailto:rob at firegiant.com>>
> >>> Subject: Re: [wix-devs] WIXBUG3704 - Allow access to persisted
> variables
> >> from related bundles
> >>> Sorry, I mentioned encoding the values in a string the way the Windows
> >> Installer does in the Registry table to include it as an option. I do
> not
> >> have a strong opinion that it is the best way to go (although encoding
> in
> >> JSON or XML seems way overkill). Trying to reuse the built-in registry
> >> types is noble if you can resolve all the issues Sean was discussing.
> >>> -----Original Message-----
> >>> From: wix-devs <wix-devs-bounces at lists.wixtoolset.org<mailto:
> >> wix-devs-bounces at lists.wixtoolset.org>> On Behalf Of Hoover, Jacob via
> >> wix-devs
> >>> Sent: Tuesday, May 4, 2021 10:02 AM
> >>> To: Ron Martin <cpuwzd at comcast.net<mailto:cpuwzd at comcast.net>>;
> >> wix-devs <wix-devs at lists.wixtoolset.org<mailto:
> >> wix-devs at lists.wixtoolset.org>>
> >>> Cc: Hoover, Jacob <Jacob.Hoover at greenheck.com<mailto:
> >> Jacob.Hoover at greenheck.com>>
> >>> Subject: Re: [wix-devs] WIXBUG3704 - Allow access to persisted
> variables
> >> from related bundles
> >>> Unrecognized types? The engine only supports a fixed set of types.
> >> Extensions can’t define additional variable types.
> >>> “Much easier” is an opinion.
> >>>
> >>> If we really want to go the string route, why not use a JSON object in
> >> the registry? We could then define it’s type and value, still live as a
> >> string, and have a well defined structure to validate against.
> >>> From: Ron Martin <cpuwzd at comcast.net<mailto:cpuwzd at comcast.net>>
> >>> Sent: Tuesday, May 4, 2021 11:51 AM
> >>> To: Hoover, Jacob <Jacob.Hoover at greenheck.com<mailto:
> >> Jacob.Hoover at greenheck.com>>; wix-devs <wix-devs at lists.wixtoolset.org
> >> <mailto:wix-devs at lists.wixtoolset.org>>
> >>> Subject: Re: [wix-devs] WIXBUG3704 - Allow access to persisted
> variables
> >> from related bundles
> >>>
> >>> Some of the things I thought about before making my suggestion:
> >>>
> >>> If all of the strings we store in the registry (in this context) are
> >> differentiated by their first character, many new types can be added
> later
> >> if necessary. A single switch statement can be used to separate the
> type.
> >> Unrecognized types can be passed through extensions.
> >>> The registry was not designed for flexibility or extensibility. Binary
> >> data can be organized for straight-forward decoding, just as string
> data,
> >> but for debugging purposes, it is much easier to decode strings than raw
> >> binary representation of multiple data structures.
> >>> Registry strings should not be used to store binary data in its raw
> form
> >> because there is a potential for truncation when a null character is
> >> encountered. Registry strings are constrained to UTF-16 with no encoding
> >> prefix.
> >>> Ron
> >>> On 5/4/2021 11:27 AM, Hoover, Jacob wrote:
> >>> easier to handle.
> >>>
> >>> From: wix-devs <wix-devs-bounces at lists.wixtoolset.org<mailto:
> >> wix-devs-bounces at lists.wixtoolset.org>><mailto:
> >> wix-devs-bounces at lists.wixtoolset.org> On Behalf Of Ron Martin via
> >> wix-devs
> >>> Sent: Friday, April 30, 2021 2:49 PM
> >>> To: wix-devs at lists.wixtoolset.org<mailto:wix-devs at lists.wixtoolset.org
> >> <mailto:wix-devs at lists.wixtoolset.org%
> >> 3cmailto:wix-devs at lists.wixtoolset.org>>
> >>> Cc: Ron Martin <cpuwzd at comcast.net<mailto:cpuwzd at comcast.net>><mailto:
> >> cpuwzd at comcast.net>
> >>> Subject: Re: [wix-devs] WIXBUG3704 - Allow access to persisted
> variables
> >> from related bundles
> >>> NOTE: This email was received from an external source. Please use
> >> caution when opening links or attachments in the message.
> >>> ____________________________________________________________________
> >>> WiX Toolset Developer Mailing List provided by FireGiant
> >> http://www.firegiant.com/<http://www.firegiant.com>
> >> ____________________________________________________________________
> >>> WiX Toolset Developer Mailing List provided by FireGiant
> >> http://www.firegiant.com/
> >> ____________________________________________________________________
> >> WiX Toolset Developer Mailing List provided by FireGiant
> >> http://www.firegiant.com/
> >> NOTE: This email was received from an external source. Please use
> caution
> >> when opening links or attachments in the message.
> >> ____________________________________________________________________
> >> WiX Toolset Developer Mailing List provided by FireGiant
> >> http://www.firegiant.com/
> >>
> > ____________________________________________________________________
> > WiX Toolset Developer Mailing List provided by FireGiant
> http://www.firegiant.com/
> ____________________________________________________________________
> WiX Toolset Developer Mailing List provided by FireGiant
> http://www.firegiant.com/
>



More information about the wix-devs mailing list