8.2.1.3 Using the versioning information
8.2.1.3 Using the versioning information
Versioning information usage
Please note that _dw... versioning variables are mostly reserved for existing file versioning, such as executable or dynamic link libraries versioning.
Here is an example of existing versioning information related to SecureDELTA_TRIAL_APP.exe
You may use the following code sample to create your own custom versioning:
1. Using _dwSourceMajor/MinorFileVersion and _dwTargetMajor/MinorFileVersion
_snwprintf_s(_wchar_ver, _SD_SDK_MAX_VER_, L"%d.%02d.%03d.%04d",
((get_dwSourceFileVersion_MSB()) >> 16) & 0xffff, (get_dwSourceFileVersion_MSB()) & 0xffff,
((get_dwSourceFileVersion_LSB()) >> 16) & 0xffff, (get_dwSourceFileVersion_LSB()) & 0xffff);
Where get_dwSourceFileVersion_MSB() returns _dwSourceMajorFileVersion
const uint32_t get_dwSourceFileVersion_MSB() const {
return (_dwSourceMajorFileVersion);
}
const uint32_t get_dwSourceFileVersion_LSB() const {
return (_dwSourceMinorFileVersion);
}
const uint32_t get_dwTargetFileVersion_MSB() const {
return (_dwTargetMajorFileVersion);
}
const uint32_t get_dwTargetFileVersion_LSB() const {
return (_dwTargetMinorFileVersion);
}
2. A simpler method will be to use the following wide character strings:
wchar_t _wchr_versionSource [_SD_SDK_MAX_VER_];
wchar_t _wchr_versionTarget [_SD_SDK_MAX_VER_];
which may contain a string version such as "1.100.200.3999"
We have defined _SD_SDK_MAX_VER_ as 32 wide characters.
You may use this information as you wish, for example set up your own registry keys on the remote machine,
in order to keep track of your files current version, before and after update!
Please note:
When both information is set, either the _dw* versioning data members and the _wchar _version* data members, the _dw* values will take priority in usage of such information.
The reason will be that you may want to preserve the native versioning information of associated files.