aws / aws/amazon-cloudwatch-agent-test

MSI installer uses 32-bit powershell for running the permission.ps1 script

Open
#451 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
22
Forks
45
Avg merge
2d 21h
Merged PRs (30d)
10

Description

Hi!

I've noticed that some of actions that CWA MSI installer runs on Windows are using 32-bit registry lookup and subsequently powershell to run `permission.ps1` script. There is nothing wrong with that per se, it works on most setups, but in some rare cases, using 32-bit powershell is not desirable/possible in the 64-bit environment. Overriding POWERSHELLEXE parameters doesn't solve the issue completely as well, as 32-bit powershell is still being used under the hood:

Image

Assuming everything about the CWA build and packaging is already 64-bit, is there any reason these operations remain 32-bit (at least from the consistency point of view)?

If I apply a few transformations to the default AWS MSI with just 2 changes equivalent to the following WSX operations, all subsequent operations are done by the 64-bit powershell:
* `s/WixQuietExec/WixQuietExec64/` in https://github.com/aws/amazon-cloudwatch-agent-test/blob/df584e59883d973a3664677fe8cd055ffe41b78d/msi/tools/amazon-cloudwatch-agent.wxs#L176-L181. [docs](https://wixtoolset.org/docs/v3/customactions/qtexec/#running-64-bit-executables)
* Add `Win64='yes'` to `RegistrySearch` in https://github.com/aws/amazon-cloudwatch-agent-test/blob/df584e59883d973a3664677fe8cd055ffe41b78d/msi/tools/amazon-cloudwatch-agent.wxs#L28-L32 [docs](https://wixtoolset.org/docs/v3/xsd/wix/registrysearch/)

I'm happy to submit a patch if you think the changes above are a good idea, otherwise sorry for the noise!

Thanks in advance!

Contributor guide

Open the contributing guide

Research direction

Start with msi/tools/amazon-cloudwatch-agent.wxs, especially the RegistrySearch and custom-action sections linked in the issue, and read the referenced WiX documentation for 64-bit execution and registry searches. Verify the MSI’s permission.ps1 path and registry lookup on a 64-bit Windows environment; done means those operations consistently use 64-bit PowerShell without breaking installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.