News for hackers. Stuff that matters.
Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @04:58AM (#5175665)
The problem that I have with chocolatey is: It's all about the installs. You'd hope that the people doing it would know how installs work.

But the default place where chocolatey installs is "C:\chocolatey", and "C:\" is where people who don't understand windows file system layout put things.

The docs ( https://github.com/chocolatey/chocolatey/wiki/DefaultChocola... ) make a plausible case that this option might be justified sometimes. Saying "we'll always put it somewhere nonstandard because some people might sometimes want to install it when they don't have permissions to put programs where they belong" is unconvincing.

The other argument put forward "It's not installed through the registry" (so?) and "it's a Special core component tool" (it's not special to anyone who hasn't installed it yet) are equally weak.

This choice of install folder should arguably be allowed. But it's a rubbish default, a poor first impression and undermines confidence that they know what they're doing. It is inexcusable that "C:\Chocolatey" is default and "C:\Program Files\Chocolatey" is a set-up that one does manually.

Re:Kinda like apt-get, but for Windows by blablabla123 on Wednesday February 06, 2013 @06:15AM (#5175837)
I have tested Chocolatey, it's definitely not perfect but does its job.

Anyway, I can recommend it to anyone with a Linux background who plans unattended/automated installations on Windows Machines in small scale. It's easy to script and if you want to add registry entries yourself in a post-install script, it's dead easy.

In this context I absolutely agree to the argument "nonstandard because some people..." A common use case for Chocolatey is probably the installation on computers of users who cannot manage the systems for themselves. I think it fills the gap for small scale (semi-)automated installations. I bet for large scales Microsoft has some kind of solution.

Re:Kinda like apt-get, but for Windows by muraiki on Wednesday February 06, 2013 @08:47AM (#5176265)
Yes, the large scale solution from Microsoft is System Center Configuration Manager, which I use extensively at work. SCCM has a lot of strengths, but it's not really suited to small operations: it has a lot of complexity that smaller orgs simply wouldn't use. Doing something simple like pushing out the latest version of Firefox without customizations, aside from the time it takes to find and download the file, still takes a good number of steps afterwards. It's a sledgehammer when some people just need a mallet, and it also costs a good amount of money!

Active Directory users can utilize Group Policy for software deployment, but that has its own share of caveats (I haven't used it in a while, but last I checked deployed apps have to be an MSI).

The thing that appeals to me about Chocolately is that it does the work of going out and getting the package for you. If you're in an environment where you don't need to do any customization of packages, this seems like a way to save time and energy over using Group Policy. However, there doesn't seem to be any reporting capability nor is there a way to initiate deployments from a central server (I guess the idea is to designate a startup script in Group Policy or just have users type commands themselves). Even in a small environment, those two features really help with management.

It'd be nice if there was a way to create a local distribution point in order to minimize bandwidth usage. But that would be a big project in itself...

Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @09:19AM (#5176444)
> It'd be nice if there was a way to create a local distribution point

There should be. Choclatey "uses the NuGet packaging infrastructure" and NuGet has that.

Re:Kinda like apt-get, but for Windows by nfg on Wednesday February 06, 2013 @06:02AM (#5175808)
IME "root of C: drive" default install location is often a sign that software has bugs when run from paths containing space characters.
Re:Kinda like apt-get, but for Windows by e40 on Wednesday February 06, 2013 @10:30AM (#5176817)
If the app writes files into the installation, then you can't install in "Program Files", because Windows will capture and redirect those writes.

Cygwin goes to c:\cygwin because it's normal for all sorts of files in that directory to be written/changed. If it were in "Program Files", it wouldn't work at all.

To call this a bug is just absurd. It's Microsoft that changed the notion of what was valid and forced everyone else to conform. Some software isn't able to conform.

Re:Kinda like apt-get, but for Windows by drzaiusapelord on Wednesday February 06, 2013 @12:33PM (#5177674)
Well written software follows guidelines from the NT age (%APPDATA%, %PROGRAMFILES%, etc). I have no idea why people still think its the dos age of just making arbitrary folders on the root. Heck, this is currently a huge problem in android. The root of my /sdcard is a mess. Are we forced to relive every mistake with every new platform?

I have no idea what capturing and redirecting writes mean. If you want to write, write somewhere you have permission to write to. I deploy software and sometimes need to changeup permissions for badly written software that likes to write to its install folder. I don't know why people excuse developer laziness like this. Imagine if your linux configs were written to /bin/ instead of /etc/ or stuff that should be in your profile is written to /sbin/ or if your logs were put in /etc/. Thats the linux equivalant of what lazy developers do to Windows.

Re:Kinda like apt-get, but for Windows by dkl on Wednesday February 06, 2013 @02:31PM (#5178292)
I have no idea what capturing and redirecting writes mean.

All explained here:

http://superuser.com/questions/384107/why-cant-i-edit-a-prog...

Re:Kinda like apt-get, but for Windows by drzaiusapelord on Wednesday February 06, 2013 @03:24PM (#5178572)
Yeah that's still a permissions issue. The user/account did not have write permissions so instead of just erroring out its trying to preserve legacy software by taking the change and ignoring it silently. Who knows why MS chose this path but the fault is still on the installer.

The fix is either use the proper locations for app data OR change permissions on that folder. its not some insurmountable hurdle that forces you to use weird locations. If permissions were correct then it would be fine. Heck, install Apache on windows. Everything just works in the proper locations because they didn't half ass everything.

Its also worth mentioning that this change came along when Vista was released; prior to that this didn't happen, yet crappy installers pulled the same shit: install to c:\, attempt to write to c:\windows\temp, etc and other DOS/Win95 legacy habits.

Ironically, Vista helped fix all this. Now I see installers for open source or community projects uses proper locations much more often than not. I guess people got sick of the UAC prompts and corporate admins were complaining about how all these arbitrary writes weren't compatible with their limited users.

Re:Kinda like apt-get, but for Windows by Nilzor on Wednesday February 06, 2013 @11:22AM (#5177181)
Apps should write data files to %APPDATA%, not Program Files where the executables shall reside. The only excuse for installing to c:\chocolatey is lazyness
Re:Kinda like apt-get, but for Windows by Shorel on Wednesday February 06, 2013 @12:37PM (#5177694)
In this case, Chocolatey's data files are actually program files for the rest of the system.

It's just a simple consequence to the fact that Chocolatey is not 'a program' with clearly defined 'data files', but a general purpose software manager (and one that should really be a part of Windows).

The Von Neumann architecture won over the Harvard architecture for a reason. You should learn about it.

Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @02:29PM (#5178276)
> The Von Neumann architecture won over the Harvard architecture for a reason

And then we placed restrictions on it for another reason: security.

See Data Execution Prevention http://en.wikipedia.org/wiki/Data_Execution_Prevention Which, like these file system permissions, attempts to divide storage into things that you can write and things that you can execute, and the two only meeting in special cases.

You're saying that Chocolatey needs elevated privileges to do it's special thing. Sure. Then it shouldn't be designed around the needs of users who can't get those permissions.

Re:Kinda like apt-get, but for Windows by dkl on Wednesday February 06, 2013 @02:32PM (#5178306)
This is just plain naive. See Shorel's comment, and to that I'll add:

That is YOUR definition of where to write data files. Not mine and certainly not everyone's idea. Saying that all apps should fit this model is just absurd.

Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @03:05PM (#5178476)
> That is YOUR definition of where to write data files

Well, Him and the designers of the operating system.

Re:Kinda like apt-get, but for Windows by dkl on Wednesday February 06, 2013 @04:50PM (#5179063)
My point is they changed the definition. It wasn't always that way.
Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @05:59PM (#5179454)
You'd prefer that nothing changed? OSs evolve. Deal with it.
Re:Kinda like apt-get, but for Windows by chayesfss on Wednesday February 06, 2013 @09:00AM (#5176323)
like c:\oracle?
Re:Kinda like apt-get, but for Windows by mahmoudhossam on Wednesday February 06, 2013 @09:59AM (#5176644)
and C:\Python27
Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @10:26AM (#5176796)
For Python what may be happening is a good piece of software that is not native to Windows. It works well enough on Windows, but the windows installer is very low on the developers' priorities and expertise. So the windows install experience ends up an afterthought that just barely works.

It also shows how anyone claiming "my tool is special, unlike others it's better to install this under C:\" is not showing good neighbourliness. It just encourages others to make the same mistake.

For Oracle, that probably also holds ... except maybe for the "good software" part.

Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @07:19AM (#5175982)
Yep. That's old-school though, you don't see much of it these days.
Re:Kinda like apt-get, but for Windows by pjmlp on Wednesday February 06, 2013 @08:42AM (#5176247)
I never understood what is so hard in treating the space as just another character.
Re:Kinda like apt-get, but for Windows by j-kidd on Wednesday February 06, 2013 @08:46AM (#5176260)
Because space is not just another character. Space separates args.
Re:Kinda like apt-get, but for Windows by ygra on Wednesday February 06, 2013 @09:51AM (#5176604)
But an installer talking to the operating system shouldn't need to separate arguments anywhere.
Re:Kinda like apt-get, but for Windows by laumars on Wednesday February 06, 2013 @10:18AM (#5176751)
Which is why escape characters and quotations were invented
Re:Kinda like apt-get, but for Windows by jfb on Wednesday February 06, 2013 @12:07PM (#5177522)
It is an abject failing of software that perfectly reasonable characters are barred from filenames.
Re:Kinda like apt-get, but for Windows by pjmlp on Wednesday February 06, 2013 @11:04AM (#5177035)
which is why most arguments tend to have a way to be recognized like -, -- or /
Re:Kinda like apt-get, but for Windows by lotyrin on Wednesday February 06, 2013 @03:06PM (#5178478)
Those are how one differentiates flags from arguments, which is a separate problem.
Re:Kinda like apt-get, but for Windows by pjmlp on Thursday February 07, 2013 @01:29AM (#5180865)
Kind of.

If your flag is for a path, you can assume everything up to the next flag is a path name.

myprog -filename here is my path with spaces -another_flag

Of course this depends on how the shell gives the arguments to the program.

On the other hand, there is no excuse why some GUI programs cannot handle spaces.

Re:Kinda like apt-get, but for Windows by lotyrin on Thursday February 07, 2013 @04:47PM (#5184714)
cp path1 path2

So, that's just one file?

Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @10:33AM (#5176833)
Treating the space as just another character in a path means that sometimes paths have to be placed inside quotes so the space isn't taken for the end of a commandline arg. Some old software didn't do that.
Re:Kinda like apt-get, but for Windows by Nilzor on Wednesday February 06, 2013 @11:16AM (#5177116)
Chocolatey is not old software
Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @11:36AM (#5177300)
No, it does not have that excuse.
Re:Kinda like apt-get, but for Windows by darkchasma on Wednesday February 06, 2013 @01:45PM (#5178048)
But the packages it installs may.
Re:Kinda like apt-get, but for Windows by negativity on Wednesday February 06, 2013 @12:53PM (#5177773)
The tilde file names in windows harken back to ye olde days of MSDOS, where file names were only allowed to be 8 characters long, and the extension was only allowed to be a dot followed by three characters (aka: the "eight-dot-three" file naming convention).

Like, if someone generated several thousand files, all named: "New Text Document.txt"

In the background, some versions of Windows will also record an alternate file name for ye olde backwards compatibility, such as:

NEWTEX~1.TXT

NEWTE~10.TXT

NEWT~100.TXT

NEW~1000.TXT

NE~10000.TXT

N~100000.TXT

It's not really about the space characters, so much as it is about length constraints from back when 640KB should've been more memory than anyone will ever need.

Re:Kinda like apt-get, but for Windows by pizza on Wednesday February 06, 2013 @12:21PM (#5177603)
Couldn't you do PROGRA~1 for "Program Files" or PROGRA~2 for "Program Files (x86)"?
Re:Kinda like apt-get, but for Windows by niggler on Wednesday February 06, 2013 @01:27PM (#5177947)
If there were another directory like "Program Aardvarks", then the DOS names wouldn't necessarily be PROGRA~1 and PROGRA~2
Re:Kinda like apt-get, but for Windows by j-kidd on Wednesday February 06, 2013 @08:42AM (#5176249)
From their FAQ, it says that chocolatey is "CLI focused". So, "C:\chocolatey" makes sense. Paths with space are definitely less CLI-friendly than those without.
Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @09:04AM (#5176358)
Does install location matter to the CLI? The install location will be on path, so it will be usable from anywhere.
Re:Kinda like apt-get, but for Windows by gcr on Friday February 08, 2013 @11:30PM (#5191673)
Well rather, if you want to muck about in the installation folder, typing "C:\choc<TAB>" is easier than "C:\Progr<TAB>\choc<TAB>"
Re:Kinda like apt-get, but for Windows by ygra on Wednesday February 06, 2013 @09:55AM (#5176628)
Show me a CLI that doesn't auto-complete paths with spaces. I don't remember when I last had to type “Program Files (x86)” out in full.
Re:Kinda like apt-get, but for Windows by niggler on Wednesday February 06, 2013 @01:29PM (#5177961)
When you write CLI apps in .NET, for example, handling paths with spaces is a mess (argv splits on " ", even if you wrap arguments in quotes, so "C:\Program Files (x86)" is seen as 3 tokens.
Re:Kinda like apt-get, but for Windows by ajanuary on Wednesday February 06, 2013 @02:04PM (#5178153)
Really?

    C:\Users\andrewj\Desktop>type test.cs
    public static class Test {
            public static void Main(string[] args) {
                    foreach (string arg in args) {
                            System.Console.WriteLine(arg);
                    }
            }
    }
    C:\Users\andrewj\Desktop>csc test.cs
    C:\Users\andrewj\Desktop>test.exe a b "C:\Program Files (x86)" d e
    a
    b
    C:\Program Files (x86)
    d
    e
Do you mean "language x" on .NET?
Re:Kinda like apt-get, but for Windows by niggler on Wednesday February 06, 2013 @04:24PM (#5178910)
VB.NET shows the behavior with

Class Test Public Shared Sub Main() Console.WriteLine("GetCommandLineArgs: {0}", String.Join(", ", Environment.GetCommandLineArgs())) End Sub End Class

Re:Kinda like apt-get, but for Windows by csense on Wednesday February 06, 2013 @05:12PM (#5179183)
I hate programs that always put junk in C:\Progra~1. I've put my programs in C:\ since my pre-Win95 DOS and OS/2 days. IMHO there's nothing wrong with installing in the root of the drive, especially if it's only a default that you can change if you want to.

In fact, as far as I'm concerned, InstallShield(R) Wizard -- and the idea of installers in general -- is a piece of crap. I want my installer to be an editable batch file that just copies the files to C:\ -- and does any other setup if necessary. Not that other setup is usually actually necessary, but a lot of apps feel a need to call home over the Internet, install a ton of stuff on my desktop, my Start menu, my Windows directory, all over the Registry, etc., as well as transfer the damn executable from the CD-ROM to my hard disk, which is all a well-written program should really need to do.

I want to actually see what the program's doing, so I can keep track of the pieces. I can't count the number of times I've had to delve into C:\Users\Whoever\Applic~1 or C:\Progra~1 or C:\Progra~2 (on 64-bit Windows) or C:\IDontEvenKnowWhat\Users\Whoever\Whatever\Profiles\Roaming\TheCompany\TheApp to find my saved game so I can continue my adventure on another PC. Or had to regedit.exe into HKEY_LOCAL_MACHINE\Software\TheCompany\TheApp\TheSetting and edit some hex value when a plain-text configuration file in C:\PROGRAM would have been perfectly adequate.

I've been using Linux for years now, and frankly it isn't much better -- install $PKG and you might get /usr/bin/$PKG, /usr/lib/$PKG, /usr/share/doc/$PKG, /usr/share/$PKG, /var/$PKG, /var/log/$PKG, /var/run/$PKG, /etc/$PKG, /etc/init.d/$PKG, /var/www/$PKG, /home/$USER/.$PKG -- part of the reason for having a package manager is to stay in control of this sprawl. The simple and obvious solution of putting $PKG in /$PKG or /opt/$PKG is too much to ask, of course, since it breaks compatibility with the first UNIX where /usr/bin is different from /bin because the system outgrew the specific hard drive the developers were using, so they had to split some things off into a second drive, which was mounted at /usr.

Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @06:13PM (#5179526)
> I've put my programs in C:\ since my pre-Win95 DOS

I see your problem, you're confusing WinNt from the Vista-and-after era with MSDOS.

> IMHO there's nothing wrong with installing in the root of the drive, especially if it's only a default that you can change if you want to.

I disagree, the default is in C:\Program Files. Oddly, windows agrees with me. You are welcome to change that on your system, however.

Re:Kinda like apt-get, but for Windows by spoiler on Thursday February 07, 2013 @03:40AM (#5181136)
Technically, you agree with Microsoft, not the other way around. Also, I don't see what the big problem of chocolatey installing where it does. Cygwin, MinGW, Python, Ruby and others do it, too?

The default is in c:/chocolatey/. Oddly, chocolatey agrees with me. You are welcome to change that in your configuration, however.

Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Thursday February 07, 2013 @04:57AM (#5181294)
> Technically, you agree with Microsoft, not the other way around.

shrug that's much the same.

> Also, I don't see what the big problem of chocolatey installing where it does. Cygwin, MinGW, Python, Ruby and others do it, too?

They're wrong too, as mentioned in this thread http://news.ycombinator.com/item?id=5176323 and this one http://news.ycombinator.com/item?id=5176685

Re:Kinda like apt-get, but for Windows by samstave on Wednesday February 06, 2013 @08:23PM (#5179974)
Maybe it would be better to call it, or actually make it, a portable install?

Imagine making it install to a folder in your Dropbox - then any machine you put your Dropbox on you can run those apps?

(Disclaimer, I pay for the 100GB Dropbox, so I am not concerned about space)

Re:Kinda like apt-get, but for Windows by voltagex_ on Wednesday February 06, 2013 @06:35PM (#5179627)
Over at coapp.org, we are (were) doing this the "right way", with MSIs that install into Program Files and dependency management.
Re:Kinda like apt-get, but for Windows by gep13 on Thursday February 07, 2013 @01:56AM (#5180928)
To be clear, that is exactly what chocolatey does as well. The "package" is placed into the C:\Chocolatey folder, but the MSI installs to it's default location, which is typically the Program Files folder.
Re:Kinda like apt-get, but for Windows by spuz on Wednesday February 06, 2013 @08:44AM (#5176251)
I don't understand. What would be the correct default install location?
Re:Kinda like apt-get, but for Windows by lysol on Wednesday February 06, 2013 @09:28AM (#5176491)
c:\Program Files, like every other program since Windows 95.
Re:Kinda like apt-get, but for Windows by hartez on Wednesday February 06, 2013 @10:02AM (#5176663)
And technically you should just use the 'ProgramFiles' environment variable, since the folder might be called something else if your install is in another language.

And Windows allows side-by-side installs of 64- and 32-bit versions of the same software; so installers should be aware of 'C:\Program Files (x86)' and 'C:\Program Files'; the first is for 32-bit programs on 64-bit machines.

Re:Kinda like apt-get, but for Windows by e40 on Wednesday February 06, 2013 @10:31AM (#5176823)
Re:Kinda like apt-get, but for Windows by Lambdanaut on Wednesday February 06, 2013 @10:07AM (#5176685)
As a followup, what is supposed to go into C:\? I've always thought it was awful that Python gets installed into that directory.
Re:Kinda like apt-get, but for Windows by SideburnsOfDoom on Wednesday February 06, 2013 @10:30AM (#5176819)
I don't think that the user or an installer should put anything directly in C:\. I agree, it is awful that python goes there.
Re:Kinda like apt-get, but for Windows by thevdude on Wednesday February 06, 2013 @12:03PM (#5177484)
It's the same as going "I'll just save this folder on / so I don't have to remember the path later".
Re:Kinda like apt-get, but for Windows by csense on Wednesday February 06, 2013 @05:16PM (#5179213)
It is not awful.

I've put junk in the root of my drives since before Windows 95. Installers that default to putting junk C:\Progra~1 are what's awful.