amazon-cloudwatch-agent
amazon-cloudwatch-agent copied to clipboard
Add file version info in exe files
Is your feature request related to a problem? Please describe. We'd use Ansible win_package module (https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_package_module.html) to manage CloudWatch Agent on Windows servers. Sepcifically to be able to check the installed version and update it if it's not up to date.
There's a parameter "creates_version" which will check the file version property of the file at creates_path (of the CloudWatch Agent executable file) and use the result to determine whether the package is already installed.
It depends on the "file version property" of the executable files of CloudWatch Agent. Unfortunately such info does not exist in CloudWatch Agent.
If we right click any exe file such as "C:\Program Files\Amazon\AmazonCloudWatchAgent\start-amazon-cloudwatch-agent.exe" and choose "Properties" > " Details", the "File version" or "Product version" is blank.
Or we can check via PowerShell, e.g:
PS C:\Windows\system32> $path="C:\Program Files\Amazon\AmazonCloudWatchAgent\start-amazon-cloudwatch-agent.exe" PS C:\Windows\system32> [System.Diagnostics.FileVersionInfo]::GetVersionInfo($path) | Select-Object *
FileVersionRaw : 0.0.0.0 ProductVersionRaw : 0.0.0.0 Comments : CompanyName : FileBuildPart : 0 FileDescription : FileMajorPart : 0 FileMinorPart : 0 FileName : C:\Program Files\Amazon\AmazonCloudWatchAgent\start-amazon-cloudwatch-agent.exe FilePrivatePart : 0 FileVersion : InternalName : IsDebug : False IsPatched : False IsPrivateBuild : False IsPreRelease : False IsSpecialBuild : False Language : LegalCopyright : LegalTrademarks : OriginalFilename : PrivateBuild : ProductBuildPart : 0 ProductMajorPart : 0 ProductMinorPart : 0 ProductName : ProductPrivatePart : 0 ProductVersion : SpecialBuild :
Can such file version info be added into exe files of CloudWatch Agent for Windows?
Describe the solution you'd like Add file version info into exe file property.
Describe alternatives you've considered N/A
Additional context N/A
This issue was marked stale due to lack of activity.
Setting this property is a common problem for golang based programs, and I see a few solutions listed here - https://stackoverflow.com/questions/35126344/how-to-set-the-file-version-field-in-pe-header-of-exe-files