Replace ascii cue to visual cue for "installing package" #376
Conversation
@ferventcoder : For every package you see the full statement
Would be nice to see the message about Chocolatey once (and licenses also once, if you have to). The packages can be mentioned once (apt-get style) because the package is mentioned again on the next line anyway.
Or something. I don't know where to add a once-only message in the installation process, but then these messages can be left out: https://github.com/chocolatey/chocolatey/search?q=is+installing+%27&ref=cmdform |
Following up on #375 (comment) : Am home now (where I have Windows 8) and here is the output of default 80 width terminal for installing C:\Users\Redsandro>cinst krita paint.net
Chocolatey (v0.9.8.21-beta1) is installing 'krita' and dependencies. By
installing you accept the license for 'krita' and each dependency you are
installing.
______ krita v2.7.9.0 ______
Downloading Calligra Krita 64 bit (
http://heap.kogmbh.net/downloads/krita_x64_2.7.9.0.msi) to
C:\Users\Redsandro\AppData\Local\Temp\chocolatey\Calligra Krita\Calligra
KritaInstall.MSI
Installing Calligra Krita...
Elevating Permissions and running msiexec /i
"C:\Users\Redsandro\AppData\Local\Temp\chocolatey\Calligra Krita\Calligra
KritaInstall.MSI" /quiet /norestart . This may take awhile, depending on the
statements.
Calligra Krita has been installed.
Calligra Krita has finished successfully! The chocolatey gods have answered
your request!
Calligra Krita has finished successfully! The chocolatey gods have answered
your request!
Finished installing 'krita' and dependencies - if errors not shown in
console, none detected. Check log for errors if unsure.
Reading environment variables from registry. Please wait... Done.
Chocolatey (v0.9.8.21-beta1) is installing 'paint.net' and dependencies. By
installing you accept the license for 'paint.net' and each dependency you
are installing.
______ paint.net v3.5.11.20130909 ______
Mode LastWriteTime Length Name
---- ------------- ------ ----
da--- 12/21/2013 14:39 paint.net
Downloading paint.net 64 bit (
http://www.dotpdn.com/files/Paint.NET.3.5.11.Install.zip) to
C:\Users\Redsandro\AppData\Local\Temp\chocolatey\paint.net\paint.netInstall.zi
p
Extracting
C:\Users\Redsandro\AppData\Local\Temp\chocolatey\paint.net\paint.netInstall.zi
p to C:\Common\Chocolatey\lib\paint.net.3.5.11.20130909\tools...
C:\Common\Chocolatey\lib\paint.net.3.5.11.20130909\tools
paint.net has finished successfully! The chocolatey gods have answered your
request!
Installing paint.net...
Elevating Permissions and running
C:\Common\Chocolatey\lib\paint.net.3.5.11.20130909\tools\Paint.NET.3.5.11.Inst
all.exe /auto DESKTOPSHORTCUT=0 . This may take awhile, depending on the
statements.
paint.net has been installed.
paint.net has finished successfully! The chocolatey gods have answered your
request!
Finished installing 'paint.net' and dependencies - if errors not shown in
console, none detected. Check log for errors if unsure.
Reading environment variables from registry. Please wait... Done. Here is what I think it should look like: C:\Users\Redsandro>cinst krita paint.net
Chocolatey (v0.9.8.23) is installing the following packages:
krita paint.net
By installing you accept the licenses for these packages and dependencies.
krita v2.7.9.0
Downloading Calligra Krita 64 bit
From: http://heap.kogmbh.net/downloads/krita_x64_2.7.9.0.msi
To: %Temp%\chocolatey\Calligra Krita\Calligra KritaInstall.MSI
Installing Calligra Krita...
Elevating Permissions...
Running MSI installer...
Calligra Krita has been installed.
paint.net v3.5.11.20130909
Downloading paint.net 64 bit
From: http://www.dotpdn.com/files/Paint.NET.3.5.11.Install.zip
To: %Temp%\chocolatey\paint.net\paint.netInstall.zip
Extracting...
Installing paint.net...
Elevating Permissions...
Running EXE installer...
paint.net has been installed.
Chocolatey installed 2 packages. 0 packages failed.
See the log for details.
The chocolatey gods have answered your request! |
That last couple of lines looks somewhat like Yum report summary. |
I'm not even using To illustrate that we don't need large error messages. Just output the error to the log, and output a single line saying installation failed to the output. It will say, e.g. (...)
paint.net installation failed. :(
Chocolatey installed 1 packages. 1 packages failed.
See the log for details.
The chocolatey gods have answered your request! |
If we are going to say see the log for details, then I think we should include where the log file is located, or have a Read-Host, or something, asking if you want to open the log file. |
By the way, I really like the suggestion for the new, trimmed, output. |
The only thing I would change with the new output might be to list the On Saturday, December 21, 2013, Gary Ewan Park wrote:
Rob http://devlicio.us/blogs/rob_reynolds |
A few suggestions:
|
Agree with @mwrock wholeheartedly. |
I agree*, as long as it fits in a 80 character line, otherwise it needs to be shortened.
I absolutely disagree. Nothing should hang the process. Not waiting for input. It should be able to complete on it's own. Maybe with an exit code.
I agree*, but you would not have to open the log file to figure that out. Because now that the new output is actually a pleasure to read, you'll quickly spot a red line. Here's a colored mockup:
I agree.
I don't understand so I'll leave opinions to the professionals. :) *) There's more interesting stuff we could do, for example, list the dependencies of all packages after the to-be-installed packages. But I thought: Let's clean this up first, and add features later. Small steps have a bigger chance of actually being stepped. :) We could also remove the |
@mwrock is this the way Boxstarter currently does it? Can you link to a specific example? @Redsandro all valid points :-) |
Yeah. In v2.1 I reworked Boxstarter output to this model. Regarding the verbose output, you can handle this with Write-Verbose or Write-Debug or both. Its not always crystal clear when to use one over the other. I use Write-Verbose but Chocolatey already makes use of Write-Debug and proxies the "real" Write-Debug function in order to intercept the output and write it to the log. So as long as you use Write-Debug for all output you want to be logged but NOT displayed, that is exactly what will happen. If the user wants the debug output to print to the console, they just need to set $DebugPreference to "Continue". Thats a PowerShell automatic variable and tells PS how to handle Write-Debug. The default value of $DebugPreference is "SilentlyContinue" which causes Write-Debug to do nothing (or in Choco's case, JUST log to disk). What makes this tricky for choco are the Batch redirects. Setting $debugPreference to "Continue" wil only have the desired effect if calling choco's Chocolatey.ps1 directly because then the choco call runs in the same scope as the caller. Using the batch redirect like cinst creates a new powershell session with the preferences set to the defaults. So you would need to add -Debug parameters to the choco commands that will set the $debugPreference of the choco powershell session to print debug output if specified. The PSObjects make parsing and reacting to chocolatey results much more script friendly. Instead of (or in addition to)
You have
This means I can inspect the results like so:
Again this is tricky due to the batch stuff. I lose the Powershell pipeline since the chocolatey batch file spawns a new PS session. So using cinst or another one of the batch file gateways, $result would not capture the output but I do believe it would at least print the object to the console. Users who want to take advantage of the pipeline would just need to call chocolateys powershell functions directly. |
Textually this is pretty awesome! 👍 However, the color doesn't really add anything. And the text can be more 80-friendly. So please allow me to comment on that:
Mockup: |
Right. :) On Friday, April 18, 2014, Sander notifications@github.com wrote:
Rob http://devlicio.us/blogs/rob_reynolds |
Ah I already made a two-package mockup, shame to throw it away. So I'll paste it anyway. But sounds cool. I'm not sure about anything PowerShell either, but it is supported in Unix escape codes and I used to do that for |
Who said anything about powershell? You mught look at the image I pasted a On Friday, April 18, 2014, Sander notifications@github.com wrote:
Rob http://devlicio.us/blogs/rob_reynolds |
It's a frickin binary! |
Well I've only been talking about it since late 2011, ask @jeremydmiller. |
I believe you. :) This is better! Any rough* idea when we're all going to use this? *) a month, season, year, lustrum? |
Roughly less than a month. |
Very nice! 👍 |
And I forgot verbose, so here you go: By the way, this is what that last set of code looks like (super clean, IMO): this.Log().Debug("This is a normal debug message.");
this.Log().Debug(ChocolateyLoggers.Important, "This is an important debug message.");
this.Log().Info("This is a normal message.");
this.Log().Info(ChocolateyLoggers.Important, "This is an important message.");
this.Log().Warn("This is a normal warning.");
this.Log().Warn(ChocolateyLoggers.Important, "This is an important warning.");
this.Log().Error("This is a normal error.");
this.Log().Error(ChocolateyLoggers.Important, "This is an important error.");
this.Log().Fatal("This is a normal catastrophic error.");
this.Log().Fatal(ChocolateyLoggers.Important, "This is an important catastrophic error.");
this.Log().Info(ChocolateyLoggers.Verbose, "This is a verbose logging statement."); |
I added the code because I'm removing those lines now... ;) |
Of course I can update that a bit now that I have the better logging constructs in. |
The new output formatting looks really nice, much more readable than current Chocolatey output. But the fact that it comes from the new binary implementation is even better news :) Do you plan on providing only an exe, or perhaps a PowerShell module as well? Personally, I find it very convenient to be able to invoke chocolatey.ps1 directly from a PS script without paying the overhead of spawning a new process. PS cmdlets could also return objects as their output, making processing that output in scripts much easier and more reliable. |
Module as well... First step is this On Friday, April 18, 2014, Jakub Berezanski notifications@github.com
Rob http://devlicio.us/blogs/rob_reynolds |
Love this output. +1 for a Powershell module. |
Really cool. What language is that? |
C#. Did I mention I'm also testing this on OSX? On Friday, April 18, 2014, Sander notifications@github.com wrote:
Rob http://devlicio.us/blogs/rob_reynolds |
That's probably cool but not something that will get me excited. |
It's more for system admins who want to build and push pkgs and not have to On Friday, April 18, 2014, Sander notifications@github.com wrote:
Rob http://devlicio.us/blogs/rob_reynolds |
Oh I would love that for Linux! I find myself every now and then making a (requested) update, only having to wait a week before I have access to a Windows machine for |
Well how about this summer sometime? .......Things always take longer than you hope. |
The current output and new colors are looking nice! 👍 The limegreen package titles are very distinctive, the output is friendly to look at. If stuff goes wrong, the |
Change old school ascii "underline" style cue to a visual cue by writing installing package title in brighter green.
This is especially convenient when you install 10 packages at once.
Just a proposition. Pending review.
See #374 @ #374