List Info

Thread: Re: Re: How to control the version-number




Re: Re: How to control the version-number
country flaguser name
United States
2007-10-03 15:20:20

>-- On Wed, 3 Oct 2007 15:00:58 -0500 John Dubchak wrote --
> Dave,
>
> I believe the question Andreas was asking is how to externalize
> that property so that you can control it from a makefile or some
>; other build event, if you will...
>
> Not sure if that helps or not.
>;
> John
>;
> On 10/3/07, ddotedotsdot < dsilvia%40mchsi.com">dsilviamchsi.com> wrote:>
>
&gt;> --- In anthemion-devtools%40yahoogroups.com">anthemion-devtoolsyahoogroups.com, Andreas Goebel <a-
&gt;> goebel...> wrote:
&gt;>
&gt;>>
>>> Hi,
>>>
>>>; is there a nice wx- or DB way to automatically insert a version-
>>&gt;
>&gt; number
&gt;>> into the "about"-dialogue? Like itīs done in DialogBlocks, for
>>>
>> instance?
>>
>>&gt; Regards,
>>&gt;
>&gt;> Andreas
>>>;
>>;
>>; Hi!
>>
>> I'm not just exactly sure of what you're meaning. The wxAboutBox
>> dialog uses a wxAboutDialogInfo class that has a version function:
>>
>> ::wxAboutBox
>&gt; void wxAboutBox(const wxAboutDialogInfo&; info)
&gt;>
&gt;> This function shows the standard about dialog containing the
>> information specified in info. If the current platform has a
>&gt; native about dialog which is capable of showing all the fields in
>&gt; info, the native dialog is used, otherwise the function falls
&gt;> back to the generic wxWidgets version of the dialog, i.e. does
>;> the same thing as wxGenericAboutBox().
>>
>> Here is an example of how this function may be used:
&gt;>
&gt;> void MyFrame::ShowSimpleAboutDialog(wxCommandEvent&
>> WXUNUSED(event)) { wxAboutDialogInfo info; info.SetName(_(";My
>&gt; Program&quot;)); info.SetVersion(_(&quot;1.2.3 Beta"));
>&gt; info.SetDescription(_("This program does something great.&quot;));
>;> info.SetCopyright(_T("(C) 2007 Me < my%40email.addre.ss">myemail.addre.ss>&quot;));
>>
>> wxAboutBox(info);
>> }
>&gt;
>&gt; Please see the dialogs sample for more examples of using this
>;> function and wxAboutDialogInfo for the description of the
>> information which can be shown in the about dialog. Include files
&gt;>
&gt;> <wx/aboutdlg.h>;
>>;
>>; Is this not what you're talking about?
&gt;>
&gt;> HTH:
>;>
>;> thx,
>;> Dave S.
>&gt;

Then the question here is to define a macro for the version (with a failsafe
default), that gets overriden by any specification in the build command. E.G.,

#define MyAppVersion 0.0.0

#ifdef CommandLineVersion
#undef MyAppVersion
#define MyAppVersion CommandLineVersion
#endif

Although, undoubtedly, not the only solution, it is a model that will work.

thx,
Dave S.

Contrary to popular belief, practice does not make perfect... only permanent!

wxMS_developers · Development with wxWidgets on MSWindows
http://tech.groups.yahoo.com/group/wxMS_developers/

wxWidgets Code Exchange
http://www.wxCodex.net/

__._,_.___
.

__,_._,___
Re: Re: How to control the version-number
country flaguser name
Germany
2007-10-04 02:13:30

Hi,

thank you for your help. I didnīt know about the wxAboutDlg, and it
doesnīt show up in my helpfile for wx. Sounds interesting.

I will probably not use it, as I use my own html-based about-dialog.
What I was really looking for was the thing John mentioned.

On Windows I use Inno Setup, so it would be really cool if either inno
setup would pick up the version number from the program (defined in some
makro, for instance) or the program would pick up the version-number
from inno-setup.

On linux one could probably use a build-script that defines the makro
and names the distributed tar.gz-file according to the version-number.
This would be more straightforward than the windows-version. I could
then use a macro as Dave suggests.

Sigh ...

With inno-Setup the solution would have to be somehow registry-based, as
it only packs the already built program.

Regards,

Andreas

__._,_.___
.

__,_._,___
Re: Re: How to control the version-number
country flaguser name
United Kingdom
2007-10-04 02:28:52

Andreas Goebel wrote:
&gt; On Windows I use Inno Setup, so it would be really cool if either inno
> setup would pick up the version number from the program (defined in some
> makro, for instance) or the program would pick up the version-number
> from inno-setup.
>
I use MSYS on Windows so I can write Unix shell scripts for building
distributions. Here's what I use for extracting the version number from
my symbols.h file:

VERSIONSYMBOLFILE=$APPDIR/src/symbols.h
VERSIONSYMBOL=wbVERSION_NUMBER

findversion()
{
echo "#include <stdio.h>" > /tmp/appver.c
echo "#include "$VERSIONSYMBOLFILE"&quot; >> /tmp/appver.c
echo "int main() { printf(&quot;%.2f&quot;, $VERSIONSYMBOL); }" >> /tmp/appver.c

gcc /tmp/appver.c -I$APPDIR -o /tmp/appver
VERSION=`/tmp/appver`
rm -f /tmp/appver /tmp/appver.c
}

where symbols.h contains the line #define wbVERSION_NUMBER 4.16 (among
other symbols).

Later on in the script, I substitute variables in the Inno Setup file, e.g.

doreplace $SETUPSCRIPTNAME "s/%VERSION%/$VERSION/g&quot;

where doreplace is:

doreplace()
{
thefile=$1
theexpr=$2

if [ -f $thefile ]; then
sed -e "$theexpr" < $thefile > $thefile.tmp
mv $thefile.tmp $thefile
else
echo "*** $thefile not found.&quot;
fi
}

Regards,

Julian

__._,_.___
Recent Activity
Visit Your Group
Yahoo! Finance

It's Now Personal

Guides, news,

advice & more.

Biz Resources

Y! Small Business

Articles, tools,

forms, and more.

Yoga Groups

Find Enlightenment

&amp; exchange insights

with other members

Re: Re: How to control the version-number
country flaguser name
Germany
2007-10-04 02:32:36

Thanks Julian,

that's cool!

Regards,

Andreas

__._,_.___
.

__,_._,___
[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )