chocolatey/boxstarter

Allow usage of the chocolatey.org/install.ps1 to be overridden

Opened this issue · 7 comments

vexx32 commented

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my request.

Is Your Feature Request Related To A Problem? Please describe.

There are a couple places where the Chocolatey install script is pulled from https://chocolatey.org/install.ps1 where it would be good to allow overriding it in some fashion, so that we can test functionality or building Boxstarter prior to publishing updates to the script, and ensure we're not breaking the things in Boxstarter that use the install.ps1

Describe The Solution. Why is it needed?

Allow overriding the install.ps1 URL with either another URL or a file path, perhaps by looking up an environment variable or some other mechanism to permit it to be overridden in places where it is currently used.

Additional Context

No response

Related Issues

No response

@mwallner @flcdrg I think this has already been discussed in Discord, however, we need to remove the Chocolatey CLI installation script from Boxstarter and use the one at https://community.chocolatey.org/install.ps1.

Are either of you able to test Boxstarter using this new script?

@gep13 would it be possible to bring the new script in each time a release is done?

I can look into this in the next couple of days, note that we still need to be able to use the bundled/offline Installer in some scenarios - will try to come up with a list of the different options available for initial deployments.

@pauby said...
@gep13 would it be possible to bring the new script in each time a release is done?

It could certainly be added to the release process to do this, would be better if this was automated though, rather than requiring human work.

@gep13 said

It could certainly be added to the release process to do this, would be better if this was automated though, rather than requiring human work.

I wasn't expecting this to be done manually but through automation.

imo the most efficient way of reducing the usage of https://chocolatey.org/install.ps1 would be as follows:

  • rip out old/unused code and modules (looking at you, Boxstarter.Testrunner, Boxstarter.Azure) - that'd reduce the number of different bootstrapping-paths
  • evaluate IF we may remove the usage of the boostrapping-url altogether, we need to be able to use the bundled version of chocolatey.nupkg anyway (remote + fully-contained scenarios)
  • replace hardcoded strings to the install script with a Get-BoxstarterChocolateyBootstrapURL function, inside the function, look if a env-var (something like env:BoxstarterChocoBootstrapUrl) is defined, otherwise fall back to the official url

@vexx32 / @pauby - how would you feel about adding ad $env:BoxstarterChocoBootstrapUrl => if this is set prior to bootstrapping Boxstarter, it will use this environment variable to fetch the chocolatey install script from.

NOTE: if choco is being bootstrapped from https://chocolatey.org/install.ps1, also .net framework 4.5 (4.0.30319) will be installed beforehand atm. (which is outdated as minimum requirement iirc)

how would you feel about adding ad $env:BoxstarterChocoBootstrapUrl => if this is set prior to bootstrapping Boxstarter, it will use this environment variable to fetch the chocolatey install script from.

This sounds like a good idea to me.