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

Windows installer: Use PowerShell to update PATH value to avoid 1024 char truncation #4362

Conversation

blueelvis
Copy link
Contributor

@blueelvis blueelvis commented May 28, 2019

  1. Fixes the issue where setx was truncating PATH Environment variable on Windows when > 1024 characters
  2. Made some Misc fixes to the NSIS Script so that the user is able to see the log during installation/uninstallation

Fixes #2587.

Verified on the following -

  1. Windows 10 Enterprise v1809
  2. Windows 7 SP1 N Edition

@k8s-ci-robot
Copy link
Contributor

Welcome @blueelvis!

It looks like this is your first PR to kubernetes/minikube 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/minikube has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 28, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @blueelvis. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 28, 2019
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: blueelvis
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: tstromberg

If they are not already assigned, you can assign the PR to them by writing /assign @tstromberg in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@blueelvis
Copy link
Contributor Author

/assign @tstromberg

@blueelvis
Copy link
Contributor Author

I signed it

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 28, 2019
@@ -0,0 +1,70 @@
<#
.DESCRIPTION
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not familiar with this format - but shouldn't .DESCRIPTION be indented the same amount as .PARAMETER?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks to be properly indented in my IDE -
image

Copy link
Contributor

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

This looks great. I regret that we have no automated testing of the installer at the moment, so I will have to trust you that this does the right thing with >1024 PATH values.

Truncated PATH's have been a long-standing user complaint, but until now no one has stepped forward to contribute a fix. Thank you for being the one to do so!

@tstromberg
Copy link
Contributor

@minikube-bot OK to test

@tstromberg tstromberg changed the title Bug/2587 -- path being destroyed when too long Windows installer: Use PowerShell to update PATH value to avoid 1024 char truncation May 28, 2019
@tstromberg tstromberg merged commit 05332bd into kubernetes:master May 29, 2019
@blueelvis
Copy link
Contributor Author

Thanks! I do have the following questions though -

  1. Is there any need for an installer which can do silent installations? Maybe we can then write some tests as well to check the PATH variable and ensure that minikube version returns proper output?
  2. I downloaded the latest installer after this PR was merged but I didn't see this new code in the installer. Are releases not continuous for this?

@Al4DIN
Copy link

Al4DIN commented Mar 28, 2022

Hello I tried the same process to add Minikube to my path bu It's giving me this error.
I'm new to K8s so don't mind my small knowledge.

System.ArgumentOutOfRangeException: La valeur doit être supérieure ou égale à zéro et inférieure à la taille de la mémoire tampon de la console dans cette dimension.
Nom du paramètre : top
La valeur réelle était -1.
   à System.Console.SetCursorPosition(Int32 left, Int32 top)
   à Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
   à Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
   à Microsoft.PowerShell.PSConsoleReadLine.Paste(Nullable`1 key, Object arg)
   à Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
   à Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   à Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics) ```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minikube not added to PATH: installer uses setx.exe which runcates PATHs longer than 1024 chars
5 participants