Skip to content

Conversation

@okankoAMZ
Copy link
Contributor

Description of the issue

  1. The script was limited to Linux environments due to its dependency on Linux-specific commands like sed, which prevented successful Agent builds on exclusively Windows platforms
  2. The conversion process was unidirectional - there was no functionality to convert MSI versions back to Agent versions

Description of changes

  1. Replaced all OS-specific commands with platform-independent Go standard library functions
  2. Implemented a new --reverse flag that enables MSI-to-Agent version conversion through comprehensive tag comparison

Note

Full tag history is required for reverse lookup since the original integer division conversion for MSI versions cannot be mathematically reversed

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

I ran the following commands to test it:

  1. go run msiversionconverter.go 1.300052.0 ../amazon-cloudwatch-agent.wxs '<version>'
    Output:
1.4.37908
Replacing <version> with 1.4.37908 in ../amazon-cloudwatch-agent.wxs file

amazon-cloudwatch-agent.wxs:

...
  <Product Id='*'
    Name='Amazon CloudWatch Agent'
    UpgradeCode='c537c936-91b3-4270-94d7-e128acfc3e86'
    Language='1033'
    Codepage='1252'
    Version='1.4.37908'
    Manufacturer='Amazon.com, Inc.'>
...
  1. go run msiversionconverter.go --reverse 1.4.37908
1.300052.0
  1. go run msiversionconverter.go 1.300052.1024
1.4.37908

@okankoAMZ okankoAMZ requested a review from a team as a code owner February 21, 2025 21:58
@okankoAMZ okankoAMZ changed the title Made msiversion converter OS agnostic and Reversable Made Msi Version Converter OS agnostic and Reversible Feb 21, 2025
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.

1 participant