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

Support version upgrade for MSI packages #1786

Closed
wants to merge 14 commits into from
12 changes: 10 additions & 2 deletions tools/packaging/windows/aws-otel-collector.wxs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<?xml version='1.0' encoding='UTF-8'?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
<Product Id="82568046-50CE-FCDE-9645-518945DACEFC"
bryan-aguilar marked this conversation as resolved.
Show resolved Hide resolved
UpgradeCode="B7C263DD-95A5-436A-A025-DCA5200C2BE3"
Name="ADOT Collector"
Version="0.0.1"
Version="0.25.0"
Codepage='1252'
Manufacturer="Amazon.com, Inc."
Language="1033">



<Package Id='*'
Keywords='Installer'
Description="ADOT Collector Installer"
Expand All @@ -20,6 +22,12 @@ SummaryCodepage='1252'
InstallScope="perMachine"
Platform="x64"
/>

<MajorUpgrade
AllowDowngrades="no"
DowngradeErrorMessage="A later version of ADOT Collector is already installed. Setup will now exit"
AllowSameVersionUpgrades="no" />
bryan-aguilar marked this conversation as resolved.
Show resolved Hide resolved

<MediaTemplate EmbedCab="yes"/>

<Feature Id="ProductFeature" Title="ADOT Collector" Level="1">
Expand Down
3 changes: 3 additions & 0 deletions tools/release/bump-version-and-create-release-note.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ docker run --rm -it -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-chan
# bump the version
echo "${RELEASE_VERSION}" >VERSION

#update aws-otel-collector msi file
sed -i '' "s/\(<Product [^>]*Version=\"\)[^\"]*\"/\1${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post test results for this oneliner?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running it locally but the file was not updated

RELEASE_VERSION=0.26.0 sed -i '' "s/\(<Product [^>]*Version=\"\)[^\"]*\"/\1${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, does RELEASE_VERSION usually include a v prefix? Do we need to remove that before doing the search and replace?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please add a comment saying that this only supports [0-9]*.[0-9]*.[0-9]* version pattern. If we decide to release with a full sem ver vX.XX.XX-prerelease then the .wxs file will need to be manually updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried running it locally but the file was not updated

I have updated the sed pattern. Here are the results

.wxs file before

Screen Shot 2023-02-01 at 4 51 58 PM

.wxs file after (as expected)

Screen Shot 2023-02-01 at 4 53 16 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, does RELEASE_VERSION usually include a v prefix? Do we need to remove that before doing the search and replace

the RELEASE_VERSION has 'v' prefix it is but this first character is removed by ${RELEASE_VERSION:1}

Also, please add a comment saying that this only supports [0-9].[0-9].[0-9]* version pattern. If we decide to release with a full sem ver vX.XX.XX-prerelease then the .wxs file will need to be manually updated.

Added it in PR description along with comment inside the shell script

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RELEASE_VERSION=v0.26.0 sed -i '' "s/^Version\=\"[0-9]*.[0-9]*.[0-9]*\"/Version=\"${RELEASE_VERSION:1}\"/" tools/packaging/windows/aws-otel-collector.wxs
Results in Version=".26.0" when I run it locally.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disregard above. This was a local environment issue. I can confirm it works.


# git commit
git add VERSION "docs/releases/${RELEASE_VERSION}.md"
git commit -m "bump version to ${RELEASE_VERSION}"