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

Include version information on terraform.exe #32785

Open
ajklotz opened this issue Mar 6, 2023 · 3 comments
Open

Include version information on terraform.exe #32785

ajklotz opened this issue Mar 6, 2023 · 3 comments
Labels
enhancement new new issue not yet triaged

Comments

@ajklotz
Copy link

ajklotz commented Mar 6, 2023

Terraform Version

N/A

Use Cases

To see version information on .exe when renaming older executables

Attempted Solutions

n/a

Proposal

When I want to try a new version of Terraform on a Windows desktop, I go to the website and download the latest executable. When I go to my system32 folder, I rename the current one in there, but I cannot tell which version it is by looking at the properties of the file. It would be nice to see what version of the executable I have.

References

No response

@ajklotz ajklotz added enhancement new new issue not yet triaged labels Mar 6, 2023
@apparentlymart
Copy link
Member

apparentlymart commented Mar 6, 2023

Hi @ajklotz,

Given any official Terraform release, you should be able to run terraform version to have it report which version it is. Is that not working on your system? 🤔

I'm also a little unsure as to what role the system32 directory plays in this situation. That directory is for parts of the operating system, so I wouldn't expect you to need to change anything in there when you are installing or uninstalling Terraform.

@apparentlymart
Copy link
Member

After writing the above I remembered that Windows executables can include various additional metadata, including a product name and version number, and I guess that's what you are asking about.

Since we build Terraform using the Go compiler using essentially the same steps on every platform it might be tricky for us to add an extra step specifically for Windows builds, but goversioninfo seems like possibly part of an answer. We'll need to investigate further to see what this would entail.

I'm still curious as to how the system32 directory is involved, since I wonder if I'm missing some interaction with part of the OS that would change how the version information is reported.

@ajklotz
Copy link
Author

ajklotz commented Mar 6, 2023

Hi, I could have left out the part where I mentioned system32, its probably the path I chose for terraform.exe to exist it so that my powershell/cmd shell would automatically recognize the application without specifying a path. But, yes, the issue is just being able to identify the version of terraform from executable itself when switching from version to version. Terraform versions come out quickly, so I usually test out the newest version locally before upgrading the version in our Azure Devops pipeline, which runs on a provisioned VM in Azure :)

theaquamarine added a commit to theaquamarine/CMPackager that referenced this issue Jun 28, 2023
terraform.exe is not currently versioned, see hashicorp/terraform#32785
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants