Jump to content


Photo

Technically read the Version Number


  • Please log in to reply
25 replies to this topic

#1 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 16 December 2018 - 05:47 AM

Hello,

 

I play The Dark Mod and I really love it (also loved the original Thief series).

Great work!

 

I help building up a security-tool that checks your system for installed applications and that reports wich of your applications have known vulnerabilities.

The tool also tells you when there are new versions of your installed applications available.

So it is more than a simple update-manager.

 

The tool is called VulnDetect and it is an replacement for Secunia PSI.

And I help keeping the database up-to-date and by adding new apps to the database.

I am also the community moderator in the VulnDetect forums.

 

I added The Dark Mod to the database.

But we have a problem getting the correct version information from the EXE file.

 

The version number of The Dark Mod is 2.06.

From the EXE-File I can read the following information:

File name and path:     E:\The Dark Mod\TheDarkModx64.exe
Product Name:           The Dark Mod
Internal Name:          The Dark Mod
Original Filename:      TheDarkMod.exe

File Description:       The Dark Mod
Company:                Broken Glass Studios
Legal Copyright:        Copyright (C) 2004 id Software, Copyright (C) 2004-2012 Broken Glass Studios
Legal Trademarks:       
Comments:               

File Version String:    1, 0, 9, 0
File Version:           1.0.0.1
Product Version String: 1, 0, 0, 1
Product Version:        1.0.0.1

So is there a way where I can get the version number 2.06?

Maybe from an other file or from the registry?

 

Thank you for your help!

 

Best regards

 

OLLI


Edited by OLLI_S, 16 December 2018 - 05:50 AM.


#2 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2318 posts

Posted 16 December 2018 - 05:56 AM

I guess we should start maintaining the exe version resource, huh?

 

I believe it's sys\win32\rc\Radiant.rc



#3 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 16 December 2018 - 06:58 AM

I guess we should start maintaining the exe version resource, huh?

 

Would be helpful if you store the version number in the EXE file.

Almost all other apps store the version info properly in the EXE.

So I can count in that you add this in the next version of The Dark Mod?

 

I believe it's sys\win32\rc\Radiant.rc

 

This is in the souece?

I don't have the source and normal users that install the game also don't have it.

 

Thank you for helping.

 

Best regards

 

OLLI


Edited by OLLI_S, 16 December 2018 - 06:59 AM.


#4 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1773 posts

Posted 16 December 2018 - 07:29 AM

Could someone explain why do we need to fix this?

 

I have never heard any complaints about TDM exe not having proper version embedded. I hope Grayman could say better if there were such complains.

And the common idea is to avoid platform-specific stuff unless it gives some noticeable benefit. Stuff like resources, manifests, registry, etc are platform-specific and unnecessary.

 

Right now the normal way of checking version is:

1) Run TDM.

2) Look at the version at the bottom.

3) Also you may look at the very beginning of the console messages.

Using step 3, it is even possible to automate checking version, although I'm not sure if it provides any benefits.



#5 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2318 posts

Posted 16 December 2018 - 08:28 AM

No, he's talking about the existing RC_VERSION resource that currently says 1.0.9 (doom3 exe version?)

I guess we should keep it up to date (preferred) or remove completely



#6 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1773 posts

Posted 16 December 2018 - 09:03 AM

No, he's talking about the existing RC_VERSION resource that currently says 1.0.9 (doom3 exe version?)

I guess we should keep it up to date (preferred) or remove completely

Ok, I'd like to know what says in favor of the first option (i.e. keep it up to date).

 

I see the following problem if we try to keep it up to date:

We will regularly forget to change this version (since no one ever needs/uses/sees it), so it will often be close to correct but wrong.

In my opinion it is much better to show version 1.0.9 (which is obviously trash) than e.g. version 2.06 instead of 2.08 (which is wrong but looks plausible).



#7 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 16 December 2018 - 09:18 AM

If VulnDetect (and also other update managers) display 1.0.9 but on your website and in the game itself you show 2.06 then this could confuse the user.

Or they might think that the update manager is doing something wrong (because we show the wrong version number).

 

In my eyes it is very useful to see that there is an update of The Dark Mod available, so I can patch it when I have time and not when I want to play.

Otherwise I start the game and have to wait for all updates to be finished.

 

VulnDetect should help users keeping their system up-to-date.

So we try to have many apps in our database and I thought it is a good idea to add The Dark Mod because I really love it.


Edited by OLLI_S, 16 December 2018 - 09:22 AM.


#8 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2318 posts

Posted 16 December 2018 - 09:25 AM

Ok, I'd like to know what says in favor of the first option (i.e. keep it up to date).

Off the top of my head, it's the easiest way to check the executable version when it does not start or loads correctly (missing dll, GLSL compile errors, etc)

 

 

 

I see the following problem if we try to keep it up to date:

We will regularly forget to change this version (since no one ever needs/uses/sees it), so it will often be close to correct but wrong.

In my opinion it is much better to show version 1.0.9 (which is obviously trash) than e.g. version 2.06 instead of 2.08 (which is wrong but looks plausible).

It's better to show nothing than 1.0.9

You can remove that line altogether



#9 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3579 posts

Posted 16 December 2018 - 09:54 AM

Aren't we incrementing the version anyway? So it's just a matter of putting the appropriate preprocessor define in the right place, isn't it?

#10 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1773 posts

Posted 16 December 2018 - 11:45 PM

Aren't we incrementing the version anyway? So it's just a matter of putting the appropriate preprocessor define in the right place, isn't it?

Yes, there is one define in TDM source code (and I guess one more place elsewhere).

If the resource file can be tricked into using this define, it would be great solution.



#11 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 12934 posts

Posted 17 December 2018 - 12:28 PM

Did you want the version number in a specific place in the exe?

 

Because it's certainly there; otherwise we wouldn't know what to paint on the main menus.

 

And--no--no one's complained about this.



#12 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2318 posts

Posted 17 December 2018 - 01:34 PM

Did you want the version number in a specific place in the exe?

 

Because it's certainly there; otherwise we wouldn't know what to paint on the main menus.

 

 

No, this is about the standard Windows way of letting the system know the executable version without running the exe or anything like that.

 

https://docs.microso...ileversioninfoa

 

 

And--no--no one's complained about this.

Until now, and I think it's a reasonable request



#13 STiFU

STiFU

    Uber member

  • Development Role
  • PipPipPipPip
  • 3579 posts

Posted 17 December 2018 - 03:28 PM

The version number resides in Radiant.rc. The file version can be easily set via

#include "framework/licensee.h"
FILEVERSION TDM_VERSION_MAJOR,0,TDM_VERSION_MINOR,0

The product version however is derived from a string, which cannot be written via preprocessor macro. It can only be achieved via a VBA-script, which could by the way also automatically increment the build number. I am no VBA guru, however, and if nobody else is, I suggest we just drop the product version and just maintain the file version.


  • stgatilov likes this

#14 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1944 posts

Posted 17 December 2018 - 07:25 PM

vba is like old basic that ran on windows 95, only with extra graphic bits



#15 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1773 posts

Posted 21 December 2018 - 09:41 AM

We have C++, some almost pure C, x86 assembly, bits of Python an Perl, shell and batch.

Quite enough already  B) 

Adding VBA seems like overkill. Leave only file version.



#16 stumpy

stumpy

    Advanced Member

  • Member
  • PipPipPip
  • 1944 posts

Posted 21 December 2018 - 09:43 PM

actually for vba to run you would also have to add .net libraries and functions.



#17 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 26 January 2019 - 03:10 PM

Hello,

 

The intention of VulnDetect is that users see if one of their app has known vulnerabilities and if there are new versions without these vulnerabilities available.

 

I added The Dark Mod to the database because users normally start the game with TheDarkModx64.exe and not with the updater.

So when VulnDetect tells the users that there is a new version of The Dark Mod available, then they will update the game.

So having the correct version info in the exe files will help us (and all other update managers) a lot!

 

VulnDetect reads the following version info from TheDarkModx64.exe:

  • File Version String (1, 0, 9, 0)
  • File Version (1.0.0.1)
  • Product Version String (1, 0, 0, 1)
  • Product Version (1.0.0.1)

If one of these values would show the correct version number, then this would be enough.

 

So, any plans that this is updated?

 

Best regards

 

OLLI


  • Anderson likes this

#18 freyk

freyk

    Advanced Member

  • Member
  • PipPipPip
  • 785 posts

Posted 26 January 2019 - 04:18 PM

imho, i see it as a luxury problem.
it would be nice that the devs can create some code to set it in the binary.
if not, i dont mind.

But is this the standard method to set versionnumber in other applications?
i thought you can set the version numbers at several locations, and not only in the code of the binary.
(-edit- i didnt read the whole topic,..)

does vulndetect have a feature to look also at other locations like text files/registry/application manager/etc?

Edited by freyk, 26 January 2019 - 05:10 PM.

  • Anderson likes this

#19 stgatilov

stgatilov

    Lead Programmer

  • Active Developer
  • PipPipPip
  • 1773 posts

Posted 27 January 2019 - 12:42 AM

it would be nice that the devs can create some code to set it in the binary.

STiFU has already done it, it is included in 2.07.

But is this the standard method to set versionnumber in other applications?

I guess it is some sort of standard in Windows world, although I won't be surprised if many programs omit it.
  • Anderson likes this

#20 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 27 January 2019 - 03:05 PM

Hello STiFU,

 

The version number resides in Radiant.rc. The file version can be easily set via

#include "framework/licensee.h"
FILEVERSION TDM_VERSION_MAJOR,0,TDM_VERSION_MINOR,0

The product version however is derived from a string, which cannot be written via preprocessor macro. It can only be achieved via a VBA-script, which could by the way also automatically increment the build number. I am no VBA guru, however, and if nobody else is, I suggest we just drop the product version and just maintain the file version.

 

It is enough if any of the fields is filled (File Version or Product Version).

If we know what field is relevant then we use just this field.

 

 

STiFU has already done it, it is included in 2.07.
I guess it is some sort of standard in Windows world, although I won't be surprised if many programs omit it.

 

Perfect, thank you very very much!

 

Best regards

 

OLLI


  • STiFU likes this

#21 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 09 February 2019 - 04:29 AM

Hello,

 

today I installed the update for The Dark Mod and the version number is now shown properly:

 

Here the information we get for the 32-Bit version:

File name and path:     E:\The Dark Mod\TheDarkMod.exe
Product Name:           The Dark Mod
Internal Name:          The Dark Mod
Original Filename:      TheDarkMod.exe

File Description:       The Dark Mod
Company:                Broken Glass Studios
Legal Copyright:        Copyright (C) 2004 id Software, Copyright (C) 2004-2012 Broken Glass Studios
Legal Trademarks:       
Comments:               

File Version String:    DM_VERSION_COMPLETE
File Version:           2.0.7.0
Product Version String: 
Product Version:        2.0.7.0

Here the information we get for the 64-Bit version:

File name and path:     E:\The Dark Mod\TheDarkModx64.exe
Product Name:           The Dark Mod
Internal Name:          The Dark Mod
Original Filename:      TheDarkMod.exe

File Description:       The Dark Mod
Company:                Broken Glass Studios
Legal Copyright:        Copyright (C) 2004 id Software, Copyright (C) 2004-2012 Broken Glass Studios
Legal Trademarks:       
Comments:               

File Version String:    DM_VERSION_COMPLETE
File Version:           2.0.7.0
Product Version String: 
Product Version:        2.0.7.0

So we can read the proper version number from the File Version and also from the Product Version.

 

Thank you very much for adding the correct version number.

As soon as the internal rules are updated, I will post a screenshot here how this is displayed in VulnDetect.

 

Best regards

 

OLLI



#22 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2318 posts

Posted 09 February 2019 - 05:27 AM

D'oh - missed the © years :wacko:



#23 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 09 February 2019 - 07:54 AM

Hello,

 

I also wanted to add The Dark Mod Updater to our database.

Reason: users see that for the Updater there is a new version available.

 

In the application window I see the version number 0.72.

When I read the version number from the EXE then I get:

File name and path:     E:\The Dark Mod\tdm_update.exe
Product Name:           TDM Update
Internal Name:          tdm_update.exe
Original Filename:      tdm_update.exe

File Description:       The Dark Mod Updater/Downloader 
Company:                The Dark Mod Team 
Legal Copyright:        (c) 2010 The Dark Mod Team.  All rights reserved.
Legal Trademarks:       
Comments:               

File Version String:    1.0.0.1
File Version:           1.0.0.1
Product Version String: 1.0.0.1
Product Version:        1.0.0.1

So maybe you also want to update the version information in the Updater?

Would appreciate that!

Thank you!

 

Best regards

 

OLLI



#24 OLLI_S

OLLI_S

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 08 March 2019 - 10:35 AM

Hello duzenko,

 

do you plan to update the version number in the The Dark Mod Updater?

So we can add the updater also to our database.

Would really love this!

 

Best regards and thank you again for adjusting the version number in the game.

 

Best regards

 

OLLI



#25 duzenko

duzenko

    Uber member

  • Active Developer
  • PipPipPipPip
  • 2318 posts

Posted 08 March 2019 - 10:56 AM

Hello duzenko,

 

do you plan to update the version number in the The Dark Mod Updater?

So we can add the updater also to our database.

Would really love this!

 

Best regards and thank you again for adjusting the version number in the game.

 

Best regards

 

OLLI

@stgailov?






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users