[wix-users] Best Practice Question: How to load and display options from an ini file ?
Gary M
garym at oedata.com
Mon Apr 25 11:40:09 PDT 2016
Thanks Phill,
I agree with you, although I was reluctant to accept this approach. I sort
of feel creating new wixlibs I'm in the business of developing installers
vs a revenue generating application.
One of my biggest gaps is realizing the wix language, like other M$
installer languages, are essentially old school, mainframe macro-assemblers
using a (verbose) XML representation. Some rules are inconsistent. For
example parameter inheritance, some push down into children and others push
up into parents. It would not be an issue if that behavior was disclosed in
the tutorials and indicated in the element documentation. Another point of
inconsistency are the conditions vs the variables. If conditions can be
evaluated at run-time, objects including dialog components should be
generated dynamically as well, leading to a new breed of intelligent
installers capable of managing application, VM and cloud deployments in a
single tool.
On Mon, Apr 25, 2016 at 11:25 AM, Phill Hogland <phill.hogland at rimage.com>
wrote:
> I think what you are looking for is to use a wixlib and possibly defining
> in the hosting project a WixVariable (not a Burn Variable) which is used in
> the wixlib authoring, to affect runtime behavior of the wixlib authored
> code. The wix toolset src\Setup project used to install the WiX Toolset
> also uses a wixlib so that may be a starting point. I put as much code as
> I can, that has any chance of being reused, into wixlibs. I have a wixlib
> that is common to all of msi packages, and another wixlib that is common to
> all of my bundles, in addition to other wixlibs for special purposes.
>
> preprocessor Variable(s) are processed prior to compiling by candle.exe
> and so preprocessor logic is static at runtime.
>
> ________________________________________
> From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of
> Gary M <garym at oedata.com>
> Sent: Monday, April 25, 2016 11:59:18 AM
> To: WiX Toolset Users Mailing List
> Subject: Re: [wix-users] Best Practice Question: How to load and display
> options from an ini file ?
>
> Thanks Sanket,
>
> The pre-processor foreach loop seems to require early binding of referent
> data. Maybe I have another race condition ? I think I also need a
> customaction.
>
>
> I did get the ini file in a arbitrary directory.
>
> I was hoping for ini file read and write code that wasn't so verbose.
>
> I was trying to get some code that wasn't so verbose..
>
> Write Ini File:
> <Fragment>
> <DirectoryRef Id="APP_ADMIN_DIR" >
> <Component Id="set.APP.INI.CFG"
> Guid="{C4CB3CD1-DD79-4836-9EBD-9FFCFBC355E5}" KeyPath='yes'>
> <IniFile
> Id="set.APP.HOST.NAME"
> Directory="APP_ADMIN_DIR"
> Name="application.ini"
> Action="addLine"
> Section="host"
> Key="host_url"
> Value="'[APP.HOST.NAME]'"
> />
> </Component>
> </DirectoryRef>
> </Fragment>
>
> Read Ini File:
> <Property Id="APP.HOST.NAME" >
> <IniFileSearch Id="get.APP.HOST.NAME" Name="application.ini"
> Section="host" Key="host_url" Type="raw" >
> <DirectorySearch
> Id="getAPP.INI.DIR.REF"
> Path="[APP_ADMIN_DIR]"
> />
> </IniFileSearch>
> </Property>
>
>
>
>
> On Sun, Apr 24, 2016 at 11:25 PM, Sanket Panchamia <psanket at gmail.com>
> wrote:
>
> > Hi,
> >
> > There is an IniFileSearchElement that will serve the purpose for you.
> > However the ini files need to be in the system folder for this element to
> > work.
> > Else, I have implemented my own parser in a custom action using
> > GetPrivateProfileString
> > WritePrivateProfileString
> >
> > Hope this helps.
> >
> > Sanket
> >
> > On Mon, Apr 25, 2016 at 6:36 AM, Gary M <garym at oedata.com> wrote:
> >
> > > I have another nube question. How 'should' I load options into a
> combobox
> > > from an ini file ?
> > >
> > > The second part... How should I parse the text string once loaded the
> > > option is selected ?
> > >
> > >
> > > thx
> > > -g
> > >
> > > ____________________________________________________________________
> > > WiX Toolset Users Mailing List provided by FireGiant
> > > http://www.firegiant.com/
> > >
> >
> >
> >
> > --
> > Regards
> > Sanket Panchamia
> > +91-9742836299
> >
> > <https://twitter.com/p_sanket> <http://www.facebook.com/spanchamia>
> > <http://www.linkedin.com/in/psanket>
> >
> > ____________________________________________________________________
> > 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