-
Notifications
You must be signed in to change notification settings - Fork 161
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
Using Invoke-ChocolateyBoxstarter to install .NET 4.7 causes Boxstarter to do a Windows update #293
Comments
Looks like starting Windows Update Service triggers this. Packages that install MSUs will typically ensure Windows Update service is turned on. |
@ferventcoder thanks for the feedback, I thought it may have been something long those lines. However, I don't believe that's the complete picture because:
Furthermore, if turning on Windows Update Service is what's triggered the Windows Updates shouldn't the updates be applied in the background service as it usually does? BTW I've turned of the Windows updates, i.e. the Windows auto-updater. I have not turned off the Windows Update service. Still feels like a bug in Boxstarter. |
The only reason why Boxstarter would perform a windows update is if it is being told to via |
Isn't |
|
@mwrock The Chocolatey package is
|
@colin-sim I think you are on to something |
Now that we know what the problem is, does anyone have any suggestions on how I might be able to workaround this issue or fixing it in Boxstarter? |
Scope. The naming of the function is understandable into why there would be a collision. Having the package be able to call back out to Boxstarter functions feels like a scope thing that could be corrected. As far as how exactly... that I'm not sure on. Since you can't control the scoping issue in the packages themselves, control the scoping at the Boxstarter level. Alternatie ideas:
Tangent - why isn't the Boxstarter one called |
@ferventcoder Thanks for your input. I agree with all your suggestions and feel the best approach would be to scope the Boxstarter functions into it's own namespace. Since namespaces don't exist in PowerShell (not that I know of in a conventional sense anyway) I would suggest the best approach is to rename all Boxstarter functions to include Boxstarter in its name. It is conceivable that other function names in the Boxstarter module to collide with other setup or install operations that comes from outside of Boxstarer. @mwrock What do you think? I guess rename every Boxstarter function is no easy task and I'm sure will break everyone's existing setup/scripts. @mwrock Can you think of a way to change the way Boxstarter scopes functions so that downstream scripts/operations do not invoke functions that's defined in Boxstarter? |
Yeah. Ideally if I were writing this over again or embarking on a major version bump, I'd rename all functions to include "Boxstarter" not to mention making |
So is there a workaround or is the only option one of ferventcoder's suggestions (none of which are ideal and kind of defeats of motivation to use Boxstarter in the first place - unless I've missed something)? |
Maybe look at the parameters and if it is not what was being looked for, look for another function with the same name. To do this though, Boxstarter would need to inspect the functions already being imported and then just rename them if they conflict. That way it would be aware when it receives a function with things that don't look quite right. The trick is seeing them during import since they are all getting imported at the same time. |
Why is choco importing the boxstarter modules anyway? |
Boxstarter comes as Chocolatey packages - I'm guessing that is why. Design of Boxstarter |
I'm initiating the choco package install via Boxstarter, e.g. @jberezanski The fix I proposed in your repo will explicitly import the @jberezanski How do you feel about that pull-request? |
@ferventcoder OK, but this does not by itself explain why Boxstarter commands are automatically available in Chocolatey. After all, @mwrock I feel I'm missing something regarding Boxstarter architecture. Does it, perhaps, somehow share a single PowerShell instance with Chocolatey? Or does it install its PowerShell modules systemwide, to Program Files? Does it have to do so?
I know exactly how you feel; I now regret letting myself be talked out of prefixing the extension's functions when I originally developed it. @colin-sim I responded to the PR. TL;DR: not thrilled about your suggestion, but I mentioned an alternative I would be willing to consider. |
Just to clear up a few things in regards to boxstarter module installation and loading. When one installs boxstarter, the boxstarter modules are added to the SYSTEM
Admittedly this architecture has grown quite tangled particularly after choco evolved to a C# program. This was fairly straightforward when everything was powershell. If I were to rewrite Boxstarter today, I would not drive the API but would rather just shell out to an installed choco.exe. However there are already products that do just that so I'm not personally motivated to spend large quantities of free time rewriting or refactoring boxstarter :) |
@mwrock I agree with your sentiment. However, it may mean Boxstarter will/may not work (or at least as well as it should) moving forward; particularly, with changes in the Chocolatey community. You mentioned other products that do similar things as Boxstarter, are you able to share this with me please. I'm in the process of re-writting my slimmed down version of Boxstarter that just forks off a process to run Chocolatey (as you've already stated) - obviously my version wouldn't be as feature rich as Boxstarter. |
Well one is also my employer :) Chef. It has a chocolatey cookbook and it has pending reboot detection and the ability to reboot. I'm sure puppet has the same capabilities but @ferventcoder would know more about that. Both products are open source and free. |
Oh... I was hoping for something much simplier like Boxstarter :S |
Make sure to call the correct Install-WindowsUpdate function. chocolatey/boxstarter#293
Make sure to call the correct Install-WindowsUpdate function. chocolatey/boxstarter#293
I have been able to reproduce this issue on a bare Windows 8.1 64-bit virtual. The machine has the following applied to it:
I run the following, which installs .NET 4.7; however, Boxstarter starts doing a Windows update while this Chocolatey package is being installed - not desirable. This behaviour is also observed when invoking Boxstarter via the
Install-BoxstarterPackage
cmdlet but only if .NET 4.7 is the last package.The console output while .NET 4.7 is installed is:
The text was updated successfully, but these errors were encountered: