These are chat archives for chocolatey/ChocolateyGUI

9th
Dec 2016
Manfred Wallner
@mwallner
Dec 09 2016 07:11
@RichiCoder1 just fixed in current upstream/develop and created a pull request.. anyway there seems something odd, now I've got a commit from you as well in the PR .. (sorry - just starting to contribute via git/github/PRs .. normally a accurev guy :worried: )
Gary Ewan Park
@gep13
Dec 09 2016 07:57
@mwallner sounds like you need a rebase. What approach did you take to update the PR?
@mwallner ^^
Manfred Wallner
@mwallner
Dec 09 2016 07:58
darn .. didn't do the rebase thing .. just pulled from new upstream
Gary Ewan Park
@gep13
Dec 09 2016 07:59
that would do it :-D
never pull, always rebase :-D
:-D
Manfred Wallner
@mwallner
Dec 09 2016 08:00
do you think chocolatey/ChocolateyGUI#345 can be merged or do I have to the rebase and create another PR ?
:D
Gary Ewan Park
@gep13
Dec 09 2016 08:00
creating a new PR is almost never needed. Give me a minute...
do you have any changes in your local cloned branch that you wouldn't want to lose?
Manfred Wallner
@mwallner
Dec 09 2016 08:02
hm .. lemme check
well, no, as @RichiCoder1 already merged feature_overhaul - that's basically what I did - so a 'clean' upstream/devel + the PR is all I need
Richard Simpson
@RichiCoder1
Dec 09 2016 08:05
Darn't git. Y u complicated?
Gary Ewan Park
@gep13
Dec 09 2016 08:07
does that cover it?
I have rebased your branch, and force pushed onto it
Manfred Wallner
@mwallner
Dec 09 2016 08:07
:D thanks
Gary Ewan Park
@gep13
Dec 09 2016 08:07
if you want to grab the latest, you would need to delete your local version of it git branch -D issue/331
and then do git fetch
Richard Simpson
@RichiCoder1
Dec 09 2016 08:08
Yup.
Manfred Wallner
@mwallner
Dec 09 2016 08:08
yup, all there .. silly to have 3 persons struggle with git for a one-liner ^^
Gary Ewan Park
@gep13
Dec 09 2016 08:08
git checkout issue/331
and you should be back in line
i.e. if you wanted more changes to be done etc
there is also a git reset command that you could use, but I prefer deleting and re-fetching
Richard Simpson
@RichiCoder1
Dec 09 2016 08:09
Random: @/all would the preference for Gui to be that it always starts as Admin, or that it starts as User, and then elevates as need?
I ask because the latter would require elevating (aka spinning up a new gui) the first time you wanted to install/uninstall/pin/etc... which might get irritating. Possibly thinking about adding a run as admin shortcut for chocolatey gui, but that might also be complicated. shrug
Gary Ewan Park
@gep13
Dec 09 2016 08:09
@mwallner the fact that I can now do what I just did, on your repo, without needing to be a collaborator on it, it a HUGE step forward though
means we can step in, if/when required
rather than having you struggle with it, when you are just ramping up on git
@RichiCoder1 I would suggest prompting on startup
@scottisafool might think otherwise though :-)
Manfred Wallner
@mwallner
Dec 09 2016 08:11
@RichiCoder1 elevate once on startup .. anything else might be annoying :-)
Richard Simpson
@RichiCoder1
Dec 09 2016 08:11
Hmm. Sort of a "first run", "Would you like to run as admin?" kind of thing? Throw in a Don't ask again check box, and it might not be overly user hostile.
Mordechai Zuber
@M-Zuber
Dec 09 2016 08:11
👆👆👆👆
Richard Simpson
@RichiCoder1
Dec 09 2016 08:11
@M-Zuber Was that a yes to me or @mwallner ?
Mordechai Zuber
@M-Zuber
Dec 09 2016 08:12
To you, although the two of you seems to be saying pretty much the same thing
Richard Simpson
@RichiCoder1
Dec 09 2016 08:13
I'm not so sure. Sounded lik @mwallner was voting for elevate by default, no?
Not even asking?
Manfred Wallner
@mwallner
Dec 09 2016 08:14
I'd ask on ChocoGUI startup - and always use the setting of the first run
Richard Simpson
@RichiCoder1
Dec 09 2016 08:14
Hmm. Indeed.
Manfred Wallner
@mwallner
Dec 09 2016 08:15
but well, there should be an option to change the setting somewhere ..
Richard Simpson
@RichiCoder1
Dec 09 2016 08:15
Agreed
Manfred Wallner
@mwallner
Dec 09 2016 08:15
(i.e. the user click's no 'let me alone' - but figures out he needs/wants the eleveation afterwards..)
Gary Ewan Park
@gep13
Dec 09 2016 08:18
@RichiCoder1 what works today, without elevating?
in terms of choco commands
Richard Simpson
@RichiCoder1
Dec 09 2016 08:18
Details.
Gary Ewan Park
@gep13
Dec 09 2016 08:19
but in order to get to Details, you need to do List, which needs elevation?
Richard Simpson
@RichiCoder1
Dec 09 2016 08:19
Nope. Listing is free, actually.
So ChocoGUI could view installed and feed packages without admin
Gary Ewan Park
@gep13
Dec 09 2016 08:19
gotcha
and then the first installation/uninstall/upgrade would need elevation?
Richard Simpson
@RichiCoder1
Dec 09 2016 08:20
Yup.
Gary Ewan Park
@gep13
Dec 09 2016 08:20
hmm, I see...
let me ponder this one
Manfred Wallner
@mwallner
Dec 09 2016 08:20
hm .. in that case I'd actually be interesting to ask of elevation when needed only .. and save it for session
Gary Ewan Park
@gep13
Dec 09 2016 08:20
I could see a re-loading of ChocolateyGUI making sense on the first installation attempt
@mwallner exactly
Richard Simpson
@RichiCoder1
Dec 09 2016 08:22
Well, the nature of elevation is that the process either is or isn't elevated. "Elevating" is literally restarting to the process. The question is should the default start be elevated (and non-admin hostile) or unelevated (and power user hostile). Devils advocate all says that you have to imagine the minority of time in Gui is spent just looking at the list views.
I rarely would pop open GUI and then not perform some operation
Manfred Wallner
@mwallner
Dec 09 2016 08:23
@RichiCoder1 same here
Richard Simpson
@RichiCoder1
Dec 09 2016 08:23
And the current implenation of elevation would cause you to "lose" your place, since it's a full restart and I'm not to keen on developing an entire uri system just for this.
Gary Ewan Park
@gep13
Dec 09 2016 08:24
sorry, went afk
I was just away to say the same thing...
Manfred Wallner
@mwallner
Dec 09 2016 08:24
so .. for the sake of convenience just put the auth/elevation question on startup?
Gary Ewan Park
@gep13
Dec 09 2016 08:24
I would want the GUI to remember what i was trying to do, so that when it restarted, it immediately did that action
Richard Simpson
@RichiCoder1
Dec 09 2016 08:24
See, this is why I went with requireAdministrator from the beginning haha
Gary Ewan Park
@gep13
Dec 09 2016 08:25
ha ha :-D
that is certainly the "easiest" approach
Richard Simpson
@RichiCoder1
Dec 09 2016 08:26
Where it gets interesting is Chocolatey's "base" directory can be installed in other places that ProgramData. And when that happens, suddenly pin/unpin don't require admin, and install/uninstall on non-system packages don't either.
But that's almost an edge case in and of itself.
Manfred Wallner
@mwallner
Dec 09 2016 08:27
well it certainly works in the majority of use-cases .. I (and my collegues) are pretty happy with the current version (including feature_Overhaul ;-)), just that I have to patch chocolatey.dll for chocolatey/choco#1047
Richard Simpson
@RichiCoder1
Dec 09 2016 08:27
I swear, the fact that every comand short of list rewrites that damned config drives me up the bloody wall
I corrupt that thing on a regular goddamn basis debugging
RichiCoder1 @RichiCoder1 glares at @ferventcoder
Richard Simpson
@RichiCoder1
Dec 09 2016 08:29
@mwallner I've thought about adding config backup and bad-config recovery, but it's really something chocolatey should handle better
Manfred Wallner
@mwallner
Dec 09 2016 08:29
agreed.
Richard Simpson
@RichiCoder1
Dec 09 2016 08:31
Back on message though, I think first-start config option is what I'm leaning towards.
Gary Ewan Park
@gep13
Dec 09 2016 08:34
yip yip yip
Manfred Wallner
@mwallner
Dec 09 2016 08:34
@RichiCoder1 glad you have time for ChocoGui again, when 0.15 is out I'll start working on "feature/multilang" ;-) .. hopefully this is something that @/all will need
Richard Simpson
@RichiCoder1
Dec 09 2016 08:35
Localization?
Manfred Wallner
@mwallner
Dec 09 2016 08:35
(sadly I can only provide 'de-de' & 'de-at' ..)
yes
bad idea?
Richard Simpson
@RichiCoder1
Dec 09 2016 08:35
No, not at all. It's been on the backlog for far too long
Gary Ewan Park
@gep13
Dec 09 2016 08:37
that, and improved accessibility
Richard Simpson
@RichiCoder1
Dec 09 2016 08:37
Yup. I definitely let that fall by the wayside :<
Gary Ewan Park
@gep13
Dec 09 2016 08:37
@mwallner wo wohnst du?
Manfred Wallner
@mwallner
Dec 09 2016 08:45
lulz @gep13 - Österreich / Südsteiermark
Gary Ewan Park
@gep13
Dec 09 2016 08:47
ich wohne in Scotland. Ich bin Schotte. Ich habe deutsche in die schule gelernt.
ah...
it's all coming flooding back :-D
Manfred Wallner
@mwallner
Dec 09 2016 08:48
:D one of the best holidays I've ever experienced: 2 weeks in Schotland / Isle of Skye! ;-)
back to topic: I'll have some spare time between christmas and new year - so hopefully the localization should be a early-2017 feature ;-)
Gary Ewan Park
@gep13
Dec 09 2016 08:49
ah, that is a great part of the world!
@mwallner that would be great!
When the first run wrote, and added a configuration option in %LocalAppData%\ChocolateyGUI\appsettings.json that allows turning on and off admin-by-default.
Also added UAC shields to all buttons that iniate "priviled" actions when not running as admin
Example of UAC
@gep13 @mwallner eh?
Manfred Wallner
@mwallner
Dec 09 2016 09:51
looks nice!
Gary Ewan Park
@gep13
Dec 09 2016 09:58
LGTM!
Richard Simpson
@RichiCoder1
Dec 09 2016 09:59
I'ma hit the hay now. If someone wants to pull that branch down and give it a swing I'd be <3
Manfred Wallner
@mwallner
Dec 09 2016 10:12
@RichiCoder1 ;-)
manfred.wallner@WALLNERM MINGW64 /e/git/ChocolateyGUI (develop)
$ git checkout feature/UAC_Default
Branch feature/UAC_Default set up to track remote branch feature/UAC_Default from origin.
Switched to a new branch 'feature/UAC_Default'

manfred.wallner@WALLNERM MINGW64 /e/git/ChocolateyGUI (feature/UAC_Default)
$ git branch
  develop
* feature/UAC_Default
Rob Reynolds
@ferventcoder
Dec 09 2016 10:20
@RichiCoder1 Appreciate the glare, but the commands only rewrite the config when config has changed.
Manfred Wallner
@mwallner
Dec 09 2016 11:03
blob
looks nice @RichiCoder1
dragon788
@dragon788
Dec 09 2016 18:10
@RichiCoder1 I don't think I've ever corrupted my Chocolatey config and I do some weird stuff. Are you maybe running a command that modifies it while another process is reading it? ie ChocolateyGUI is holding the file open and something else writes it?
Richard Simpson
@RichiCoder1
Dec 09 2016 22:34
@dragon788 It's mostly because I'll hit an exception in ChocolateyGUI or otherwise pause the process, and that will usually interrupt the config write
@ferventcoder Why is choco install and a handful of other commands writing to the config then?
None of the commands that ChocolateyGUI is currently able to execute through the UI (with the exception of Sources which was temporarily stripped out) have any reason to write to the config, yet it get's written regularly during testing
Richard Simpson
@RichiCoder1
Dec 09 2016 22:46
I stand corrected. Doesn't look like it happens anymore. Though the continous creation and deletion of chocolatey.config.update does seem a bit wasteful.
Does choco create the update file and then compare it to the original? I might be running to a race condition or something.
Richard Simpson
@RichiCoder1
Dec 09 2016 22:53
That's so odd, a race condition probably isn't it either. The only thing I could think of is some how Choco's copy_file is getting interrupted midway through.
dragon788
@dragon788
Dec 09 2016 22:56
you shouldn't go pausing processes :P
of course it's probably a Heisenbug, so if you go into debugging mode and monitor the calls it'll never happen
Richard Simpson
@RichiCoder1
Dec 09 2016 22:57
Nah, It would happen too when force-quitting choco. shrug
@mwallner Tell me I'm not being crazy, this is a thing that happens right?
Yah, the issue he posted up above is exactly it: chocolatey/choco#1047
dragon788
@dragon788
Dec 09 2016 23:04
I've seen a weird behavior if I run choco from two different places at once, but I don't know that it resulted in corruption, that's definitely no bueno
Richard Simpson
@RichiCoder1
Dec 09 2016 23:06
shrug
Ironically running GUI unelevated gets around the whole issue as it can't write to config haha. Running GUI under user results in 100% less writes :P
Rob Reynolds
@ferventcoder
Dec 09 2016 23:08
haha
@RichiCoder1 it writes the config.update every time to see if it needs to update
and throws it away otherwise
Richard Simpson
@RichiCoder1
Dec 09 2016 23:09
Is there a reason you write the file out? You can do an in memory hash check and pay half the IO costs
Rob Reynolds
@ferventcoder
Dec 09 2016 23:09
not terribly efficient, but I want the writes to be as locked down as the original and it's effective at knowing if the file changed.
I'd prefer an in memory hash check.
but the file would still also need written out if there is a difference, then replaced.
just to reduce issues in starting to write a file and something going wrong and corrupting it
also, a little hardening on that method would be :+1:
Richard Simpson
@RichiCoder1
Dec 09 2016 23:12
Have you though about using something like File.Replace? Then, if choco ran into an issue processing the malformed XML, it'd just fall back to the .backup. Probably should get down into the why of what's happening, but that's an hardening possiblility.
I'll dig into it later and see if I can get you a PR.
And fix my existing PR haha