[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
SMPlayer Support Forum • View topic - Version in resource file (Windows)
Page 1 of 1

Version in resource file (Windows)

PostPosted: Wed Mar 07, 2012 5:46 pm
by redxii
This is basically just to know what build and version it is without opening it. If PORTABLE_APP is defined it will add "(Portable Edition)" to the description.

I actually got it to update the SVN revision by itself, but I don't know much to edit getrev. I need another #define without the quotes, I deleted them from getrev but QString needs those quotes to be there or else version.cpp won't compile. I would also use version.h so it can be set once for version.cpp and smplayer.rc but the resource compiler says "fatal error: QString: No such file or directory".

Re: Version in resource file (Windows)

PostPosted: Thu Mar 08, 2012 9:35 am
by redxii
Didn't even need getrev.exe to get the revision number, I just used 'svnversion'.

I created a new way to create the SVN version header file. getrev.cmd will get the revision, and fsed.cmd uses a template, svn_revision.h.in, and replaces the '$WCREV$' keyword with the revision in a new file, src\svn_revision.h, like what subwcrev does. svn_revision.h also contains all the version strings, and SVN_USE_REVISION. To edit the version and whether or not to use SVN revision, modify getrev\svn_revision.h.in.

Re: Version in resource file (Windows)

PostPosted: Thu Mar 08, 2012 12:36 pm
by redxii
Could use sed on get_svn_revision.sh:

sed 's:\$WCREV\$:'$NEW_REVISION':' getrev/svn_revision.h.in > src/svn_revision.h

Re: Version in resource file (Windows)

PostPosted: Fri Mar 09, 2012 5:19 pm
by redxii
Updated to handle if the user is not using working copy or SVN isn't in the path, and not being able to redefine %REVISION% without closing the command prompt between executions of getrev.cmd. For some reason simply using "set REVISION=%%G" returns "Changed", as opposed to "if not defined REVISION set REVISION=%%G" which gives the right result.

It sets the revision to 0 if it isn't a working copy/missing svn and say "+SVN-rUNKNOWN" if use_svn_revision is 1 AND revision is 0.

Re: Version in resource file (Windows)

PostPosted: Sat Mar 10, 2012 8:35 am
by redxii

Re: Version in resource file (Windows)

PostPosted: Sun Mar 11, 2012 5:08 am
by redxii
Actually tested in Kubuntu:

Re: Version in resource file (Windows)

PostPosted: Mon Mar 12, 2012 1:15 am
by redxii
Final..

Tested Linux scripts with Kubuntu.

Re: Version in resource file (Windows)

PostPosted: Tue Mar 13, 2012 1:46 pm
by rvm
svn info --revision HEAD is slow. Don't you get the same result with "svn info" which is faster?

Re: Version in resource file (Windows)

PostPosted: Tue Mar 13, 2012 9:06 pm
by redxii
Yeah. Also found a way that doesn't assume it's the 5th line (skip=4) more like grep so it can be found anywhere:

FOR /f "tokens=2" %%i IN ('svn info ^| find "Revision: "') DO set REVISION=%%i