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

Missing version numbers #347

Open
sphengle opened this issue Oct 13, 2023 · 1 comment
Open

Missing version numbers #347

sphengle opened this issue Oct 13, 2023 · 1 comment

Comments

@sphengle
Copy link

When I create a new SBOM with the tool using the add files option I am finding that the version numbers are of the form 0.0.0-. Mostly I'm OK with this but I'm finding that for DLL files it is the same format - rather than listing the actual version of the file. The version of the DLLs is important to me. It's the main reason I need to have an SBOM.

Am I using the tool incorrectly or should I be using a different tool to generate the SBOM?

@carolinexpenn
Copy link

carolinexpenn commented Oct 24, 2023

I have the same issue - we are using the SBOM primarily to check dll versioning. As a workaround, try adding this to the Commands/Add/AddFilesCommand, starts at line 138.

Edit: slight tweak of the if statement as certain file names were causing exceptions:

                    if (fileComponent.Name.ToLower().EndsWith(".dll"))
                    {
                        FileVersionInfo fileVersionInfo = FileVersionInfo.GetVersionInfo(fullPath);
                        fileComponent.Version = fileVersionInfo.ProductVersion;
                    }
                    else
                    {
                        var shortHash = fileComponent.Hashes.First(h => h.Alg == Hash.HashAlgorithm.SHA_1).Content.Substring(0, 12);
                        fileComponent.Version = $"0.0.0-{shortHash}";
                    }

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

No branches or pull requests

2 participants