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

Do not install tab completion (edit of profile) under certain conditions #833

Closed
4 tasks done
ferventcoder opened this issue Jun 25, 2016 · 3 comments
Closed
4 tasks done

Comments

@ferventcoder
Copy link
Member

ferventcoder commented Jun 25, 2016

During install, do not try to update/create the profile if an environment variable exists.

We may want to look at the execution policy for the machine and respond accordingly to not automatically installing the profile unless it meets a minimum level to reduce issues with running PowerShell later.

  • Do not create profile if it doesn't already exist.
  • Do not set profile if user is SYSTEM.
  • Do not create set profile if $env:ChocolateyNoProfile exists.
  • Don't edit the profile if it is authenticode signed.
@RedBaron2
Copy link

@ferventcoder Wouldn't something like this work the best.

Install-ChocolateyEnvironmentVariable -variableName "ChocolateyProfile" -variableValue {true/false}

This is then checked by function Add-ChocolateyProfile for {true/false}

The only thing I see as an issue will be those that had the profile installed previously without the environment variable. I might suggest they add the variable to windows manually ( I know not exactly automated )

The alternative is to just add a chocolatey cmd line switch when installing chocolatey.

@dragon788
Copy link
Contributor

dragon788 commented Jul 29, 2016

As in the above referenced issue, this is causing "failures" in the vagrant-dsc plugin due to an extra "Preparing modules for first use" message that appears if the Chocolatey created profile exists, but only with PowerShell 5. The temporary workaround has been to remove the $profile during a script provision before the plugin attempts to run its own provisioning.

@ferventcoder
Copy link
Member Author

I think we are just going to pull this from the installer and move to an additional command to install/uninstall the profile.

@ferventcoder ferventcoder changed the title Do not Create/Update PowerShell Profile if Environment Variable exists Only Create Profile with "profile" command Aug 1, 2016
@ferventcoder ferventcoder changed the title Only Create Profile with "profile" command Do not set profile under certain conditions Aug 6, 2016
@ferventcoder ferventcoder self-assigned this Aug 6, 2016
@ferventcoder ferventcoder changed the title Do not set profile under certain conditions Do not install tab completion (edit of profile) under certain conditions Aug 6, 2016
ferventcoder added a commit that referenced this issue Aug 10, 2016
- Do not create profile if it doesn't already exist.
- Do not set profile if user is SYSTEM.
- Do not create set profile if `$env:ChocolateyNoProfile` exists.
- Don't edit the profile if it is authenticode signed.
ferventcoder added a commit that referenced this issue Aug 10, 2016
* stable: (23 commits)
  (GH-897) Fix DISM /all for newer Windows versions
  (maint) bring back in nuspec into solution folders
  (GH-598) Add output directory for choco pack
  (version) bump to 0.10.0
  (doc) update CHANGELOG/nuspec
  (GH-840) Do not set User Environment for SYSTEM
  (GH-840) Set TMP to cacheLocation as well
  (GH-830) Ensure process PSModulePath items
  (GH-112) Relax HTTPS checksum failure
  (maint) move noop run
  (GH-833) Don't set profile under certain conditions
  (doc) update generated docs
  (GH-112) update options for new version
  (GH-112) Checksums / Install Template
  (GH-112) Update parameter documentation
  (GH-112) Require checksums
  (GH-112) Allow Empty Checksums
  (GH-112) Checksum remote files unless checksum
  (GH-112) Allow user passed checksums
  (GH-112) rename checksum files for proper casing
  ...
ferventcoder added a commit that referenced this issue Aug 11, 2016
Don't attempt to set tab completion when `$profile` comes back as a
null or empty string. Adjust all messages about not setting tab
completion for consistency.
ferventcoder added a commit that referenced this issue Aug 11, 2016
* stable:
  (GH-112) update tab expansion
  (doc) update generated docs
  (GH-112) Get-ChecksumValid - update debug params
  (GH-833) Don't set tab completion if profile null
  (doc) update CHANGELOG/nuspec
  (GH-866) Fix - packages.config fails on licensed config
  (GH-112) clear existing environment vars
  (doc) add checksum verification notes
  (GH-112) Empty Checksums for Secure Locations
  (maint) remove magic strings for environment vars
  (maint) move environment vars to env section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants