Hacker News new | ask | show | jobs
by vlovich123 455 days ago
What about a standalone executable that just offered the ability to install itself without having a dedicated separate installer?
3 comments

It would be annoying. If the use-case is as a portable application, but the application would want to let the user know (in a sufficiently loud manner) that it can install itself, then either the user would be forced to pay attention at that aspect every time it opens the application, or that "portable" application will have to somehow pollute the environment with (at least) a note for itself of the fact that user was offered but chose not to install anything. That note is usually just a first change in the system and, for a non trivial application, is way too easily followed by many other kind of saved changes, which in itself looks like a creeping install. Then, if the user would actually choose to install, the app will have to do what, make shortcuts to its current location, which may be a thumb-drive, or another less ideal placement for a program (because how many of us take time to think about file management anyway)? Or, if the application makes a copy of itself to a conventional place (for an application) in the system, then now the useless standalone executable either gets forgotten about or becomes a burden for the user (who has to decide what to do with it).

The most appropriate behavior for a portable application is for it to stay clean by default and only offer the user to explicitly enable persistency-dependent functionality. When the application starts, it checks if there's any previous trace of itself and depending on that it either keeps its portable-like clean behavior or switches to installed-like one.

Why would it have to let the user know via an obtrusive splash or anything? Could just be a very simple unobtrusive option on app launch or a menu item.

Same goes for post install - not too hard to arrange to auto delete the old copy.

The really tedious answer is that there's special (very badly documented) magic to installers on Windows. I suppose you could shove an MSI inside the executable, then write it out and shellexec to install the MSI.
I remember a game that did this in like 2006 (it was a small GUI program called drug baron or something like that - you bought and sold drugs and weapons with your sales and purchases affecting the market - like a text-based game without having to use the command line).

It didn't work so well (probably not programmed that well I guess).

I suspect there were a few games like this, but I think the most popular one was called Drug Wars, in case anyone cares to go looking.

Yes, it was very poorly programmed. It always surprised me how popular it was. I think it was kind of a middle- to high-school meme game. I think the main popularity was that A) it was edgy, and B) kids could run it in school computers.

Yeah Drug Wars was probably it.