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

Made Msi Version Converter OS agnostic and Reversible #468

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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