Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    pgutil: Read product name and version from file

    Scheduled Pinned Locked Moved Support
    4 Posts 3 Posters 16 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      caterina
      last edited by

      Hi,

      in pgscan it was possible to read the product name and version from a given file using --fileInfo (for 'identify) or --consumer-package-file (for 'publish').

      I think this is missing in pgutil? Or am I missing something here?
      It looks like the SbomCommand and the ScanCommand can only handle the properties --project-name and --version. But I can't see an option for a file.

      Hopefully you can help me with this issue.

      Thanks,
      Caterina

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @caterina
        last edited by

        Hi @caterina ,

        I guess those never made it over... they were undocumented and we basically started fresh. Following in my other post, we want to really make surea ll commands fit together nicely and are documented well.

        I'm almost certain know you contributed them, but can you help to document what they are?

        I found the code here:
        https://github.com/Inedo/pgscan/blob/master/PgScanCommon/Program.cs#L231

        Does this only work with .NET?

        Also... I don't think we have the identify command anymore, right?

        Thanks,
        Alana

        1 Reply Last reply Reply Quote 0
        • C Offline
          caterina
          last edited by

          Hi @atripp,

          this feature is necessary for us because we have products where we are not able to access the version otherwise. But we want to have the according information about this project, so we implemented the possibility to read the version from a .dll or .exe.
          It just extends the current functionality and I think it would also be a great addition for pgutil.

          It is not limited to .NET since we were using System.Diagnostics.FileVersionInfo.GetVersionInfo() to retrieve the information in pgscan.

          I think instead of 'identify' it is now 'builds scan'. It is a property which is necessary for sbom generation. So I would suggest that 'builds scan' and 'builds sbom' in pgutil should support this option.

          Thanks,
          Caterina

          1 Reply Last reply Reply Quote 0
          • Dan_WoolfD Offline
            Dan_Woolf inedo-engineer
            last edited by

            Hi @caterina,

            We're a bit concerned that this is too specific for your usecase, and we're really struggling documenting it.

            Instead of doing this, we're thinking it might just make more sense to run (Get-Item 'C:\path\to\file.exe').VersionInfo using PowerShell and export these into variables instead.

            For Example:

            $versionInfo = (Get-Item 'C:\path\to\file.exe').VersionInfo
            $version = if($versionInfo.FileVersion) { $versionInfo.FileVersion} else { $versionInfo.ProductVersion }
            $productName = $versionInfo.ProductName
            pgutil builds scan --input=myApplication.csproj --project-name$productName" --version=$version
            

            Thanks,
            Dan

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation