I have a small VBScript that uses Scripting.FileSystemObject.GetFileVersion to retrieve the version of my 'main' EXE. As part of my Nant script, I run the VBS, output to a file, read it back in as a variable and then pass it as a command line variable to WiX.
In my particular environment compilation and installer build processes are separate, and as I use the same WiX sources to build both 'beta' and 'release' builds generating this value dynamically based on some other variable (e.g. the EXE version) means the MSI version is guaranteed to match the binary version. On Tue, Jan 26, 2010 at 6:34 PM, Rob Mensching <r...@robmensching.com> wrote: > Ahh, that's a different problem than I thought you were trying to solve. We > do this sort of thing in the WiX toolset using a tool that generates the > .wxi file. You can see ours at: wix\toolsrc\GenerateWixInclude > > On Sun, Jan 24, 2010 at 7:41 PM, CP YEH <ntde...@gmail.com> wrote: > >> Thank you for your answer. I may not understand your reply correctly >> but I was looking for a way to keep a variable in one place for >> various projects. In other words, currently I have product version >> variable for future upgrade in wxs file but I need this information in >> other parts of my code which is in C/C++. >> >> In Wix: >> <?define ProductVer="1.0.2"?> >> >> In C/C++ project: >> #define ProductVer "1.0.1" >> >> The thing is that I tend to forget to update this variable in both >> places so sometimes my app does not work correctly and it takes time >> to figure out where I did wrong. :-( >> I am not looking for a way to retrieve these information from >> installed product but looking for a way to define one variable in my >> VS solution so that I could somehow use it from both Wix and C/C++ >> projects. >> If that was what I meant, I am sorry but could you give me one example >> of API? Thank you very much. >> >> YEH >> >> On Sun, Jan 24, 2010 at 8:16 PM, Rob Mensching <r...@robmensching.com> >> wrote: >> > The MSI SDK provides a number of APIs to get at those pieces of data from >> a >> > custom action. The WiX toolset ships with many custom actions. You might >> > read through those to get an idea how to read MSI databases. >> > >> > On Sun, Jan 24, 2010 at 3:47 PM, CP YEH <ntde...@gmail.com> wrote: >> > >> >> I have Wix project that contains product codes and version information >> >> and I would like to find a way to use these information from C++ >> >> project because I do not want to define these variables two different >> >> places. >> >> Could anyone tell me how to achieve this? >> >> Thanks. >> >> >> >> YEH >> >> >> >> >> >> >> ------------------------------------------------------------------------------ >> >> Throughout its 18-year history, RSA Conference consistently attracts the >> >> world's best and brightest in the field, creating opportunities for >> >> Conference >> >> attendees to learn about information security's most important issues >> >> through >> >> interactions with peers, luminaries and emerging and established >> companies. >> >> http://p.sf.net/sfu/rsaconf-dev2dev >> >> _______________________________________________ >> >> WiX-users mailing list >> >> WiX-users@lists.sourceforge.net >> >> https://lists.sourceforge.net/lists/listinfo/wix-users >> >> >> >> >> > >> > >> > -- >> > virtually, Rob Mensching - http://RobMensching.com LLC >> > >> ------------------------------------------------------------------------------ >> > Throughout its 18-year history, RSA Conference consistently attracts the >> > world's best and brightest in the field, creating opportunities for >> Conference >> > attendees to learn about information security's most important issues >> through >> > interactions with peers, luminaries and emerging and established >> companies. >> > http://p.sf.net/sfu/rsaconf-dev2dev >> > _______________________________________________ >> > WiX-users mailing list >> > WiX-users@lists.sourceforge.net >> > https://lists.sourceforge.net/lists/listinfo/wix-users >> > >> >> >> ------------------------------------------------------------------------------ >> Throughout its 18-year history, RSA Conference consistently attracts the >> world's best and brightest in the field, creating opportunities for >> Conference >> attendees to learn about information security's most important issues >> through >> interactions with peers, luminaries and emerging and established companies. >> http://p.sf.net/sfu/rsaconf-dev2dev >> _______________________________________________ >> WiX-users mailing list >> WiX-users@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/wix-users >> >> > > > -- > virtually, Rob Mensching - http://RobMensching.com LLC > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users