Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version information to RC file and display in About dialog box #89

Merged
merged 6 commits into from
Apr 12, 2018

Conversation

matthewjustice
Copy link
Contributor

This change does the following:

  1. Removes the dependency on ntverp.h. Without this change, versioning is set by ntverp.h. This makes sense for building Windows where all binaries are versioned together, but that no longer applies to this code.
  2. Versioning and related strings are now defined in res.rc. These values could be updated programmatically at build time if needed. This addresses issue In executable properties the product name is "Win7 DDK driver" #53 and supersedes the changes in PR Specify product name rather than rely on ntverp default #67.
  3. Building on pull Add WinFile-specific about dialog box #76 for issue Create WinFile specific About box #40, The About Dialog now displays the VER_PRODUCTVERSION value that is contained in the VS_VERSION_INFO in the winfile.exe binary. This means that the values shown in explorer file properties will match what is in the About box. If we choose to update these values in some way other than the RC file, the about box will still pick up the correct values at runtime.

Notes:

  • mincore.lib was added as a new linker dependency for GetFileVersionInfo and related functions.
  • strsafe.h was included to allow for StringCchPrintf
  • Example of updating the product version below. The version below is just an example; in the code the version is 10.0.0.0 for now.

winfile-version

src/wfdlgs3.c Outdated
if (GetFileVersionInfo(wszCurrentModulePath, 0, cbVerInfo, pFileVerInfo))
{
// Get the pointer to the VS_FIXEDFILEINFO structure
if (VerQueryValue(pFileVerInfo, L"\\", (LPVOID *)&pFixedFileInfo, &uLen))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you are using VerQueryValue (not VerQueryValueW), is there a reason why you use L"\\", rather than TEXT("\\")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I was assuming UNICODE would be set at build time, but I agree that using TEXT would be more consistent. I'll make that change and also use TCHAR rather than WCHAR.

@craigwi
Copy link
Contributor

craigwi commented Apr 12, 2018

Hi @matthewjustice , can you update this PR now that I have reverted b51bf08? Thanks.

@matthewjustice
Copy link
Contributor Author

matthewjustice commented Apr 12, 2018

@craigwi - I'm not sure if this is what you had in mind, but I was able to also revert b51bf08 in my about-version branch (see commit 71bce76). I think the changes in my branch should merge cleanly. I'll admit to not being an expert in Git, so let me know if I need to take a different approach.

@craigwi
Copy link
Contributor

craigwi commented Apr 12, 2018

Looks fine. A squash and merge gives the right result.

@craigwi craigwi merged commit 8a29c12 into microsoft:master Apr 12, 2018
@craigwi
Copy link
Contributor

craigwi commented Apr 12, 2018

Your change, squashed, is checked in. I hope I didn't screw up again.

@matthewjustice
Copy link
Contributor Author

Thanks @craigwi! The commit looks good to me.

@NazmusLabs
Copy link
Contributor

So are we going to use gitversion to have the version number automatically updated with commits? It sounds the most practical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants