What do we need installations for? - installation

This is a conceptual question and I hope it fits into Stackoverflow's question and answer style. I wonder what the concept of installing applications is good for. In my naive understanding of operating systems we do not need a registry and to use an application it should be enough to just copy the executable and files onto your drive and launch that.
Am a Windows user but also worked with Linux a bit and noticed that there are package managers instead of installers. But even those do more than just a copy instruction, I guess.
I do not think that all the installers exist only because the common user expects them out of steady habit. So what is the advantage of installers in contrast to developing applications which are designed to run out of a single folder and copy that over?
I would really like if someone could explain that concept.

Installing applications is a way to embed them in the OS. It's a kind of standard, you offer procedures like installing and uninstalling that should have the same functionalities for all applications (even "change" under Windows).
Countless times I've "installed" applications with a single shell script that came with them, and then had troubles removing such programs, having to look for single files. If the programmer uses the standard of the OS to make an executable that can be installed, that won't happen.
You can also easily view a list of the installed programs at any time.
Under Linux, additionally, if we're talking about a package manager, it is convenient for the user to have an easy way to download and install a program by just typing its name.
Last but not least, some applications are required to be installed and recognized by the OS (for example services in Windows).

Related

What are the risks of doing my own cross platform (Win + OSX) installer?

I have a quite complicated build process involving different directories (for plugins) ; currently using NSIS on Windows and PackageMaker on OSX but have issues improving them as my install / uninstall process is getting more complex with time.
The more I look into it, the more I feel like I should code my own cross platform installer with a cross platform GUI like wxWidgets (I've used it before) and copy myself the right files in the right directories because I cannot find any good cross platform software installer OR even programmatically customizable software installers for both platforms.
Has anyone gone down that path ? Does anyone know what are the hardest things to achieve, blocking everyone to produce good softwares installers and why doesn't this exists right now ?
Thanks in advance!
Does anyone know what are the hardest things to achieve
The hard part about installers is not wizard GUI, it’s OS integration. That integration is dramatically different across OSes.
On Windows, you need to use MSI. NSIS doesn’t do particularly good job, MSI enables repair/modify functionality, by default MSI can upgrade stuff even when old version is still running (and it continues running while being replaced), some MS libraries ship as *.MSM merge modules… BTW, I usually use WIX for that.
Similarly, on Debian and Ubuntu Linux you need to create .deb packages. Even if you’re making a GUI installer. They also support repair & upgrades, versioning, dependencies, but they do it in completely different way than MSI.
I don’t have much experience with OSX but I think it has some other installer infrastructure implemented by the OS.

Installing a program without installation file

I've heard that you can take a program that is already installed in a PC and go home to you r own pc and write a program in any programming language to make it work without having to install the program. I wanted to know how does one go about in achieving that.
The class of applications you are describing are called Standalone or Portable Applications.
In such applications all files that are required to run the application are stored in the same directory as the application file itself. Which is not the way with most applications work, so, you cannot make all applications run in that fashion. There are various guides on Google when you search for 'creating portable applications'.
You might want to look at a good directory of portable applications here

A WIX Interpreter?

I have a need to describe deployments/installs, and possibly uninstalls as well - but I don't want to use Windows Installer. At the same time, I don't want to completely re-invent the wheel.
It occurred to me that I could perhaps use the WIX declarative schema, but create my own "WIX interpreter" that will perform the install / uninstall steps (as described by a target WIX xml document) without using the windows installer.
It would be nice to go a step further, so that I achieve a cross-platform (Linux, MAC) installer-interpreter. Of course WIX did not have Linux and MAC in mind. In which case I either add xml namespaces to extend WIX, or use some other industry format (that I am yet unaware of).
But perhaps I'm stretching too far. At the very least it would be nice to have a WIX interpreter or a WIX install executable that does not create any records in the windows installer. It need not fulfill every capability of the windows installer. I'd just like to see some basic capabilities fulfilled.
Does anyone know of such a thing, so I can save myself the effort of making it myself?
Each operating system has their own means of managing installed packages.
That means that if you implement your own package management scheme, it will not integrate well with the current operating system standard. This has a number of very bad side effects, mainly the people maintaining the operating system through standard tools run a high risk of not knowing your software was installed because the standard tool didn't report it was installed.
Microsoft's installer is quite different than many other installers, and it supports extension via programming, which is typically done in the VB C++ language. Also, Microsoft supports the mixing of configuration and installation, while many other package managers see these as different functions to be performed at different times. Finally, Microsoft attempts to ask for the configuration information PRIOR to installation, while installers that separate out the role of configuration and installation typically request that the configuration be done AFTER the program is installed.
In truth, there are way too many different "assumptions" about what constitutes installation, and when / how to do said items, and what tools can be expected on particular platforms to easily merge "all items" into a single multiple-system installation tool without the vendors coordinating a little bit to allow for some compatibility.

What is the problem with DLLs and the Registry?

I was watching the WWDC 2009 Keynote and something someone said about Windows 7/Vista got me curious..
The speaker claimed that 7 was still a poor operating system because it still used the same technologies such as DLLs and the registry. How accurate are his claims and how different is OS X doing it? Even os x has dynamically loaded libraries right? I guess the Registry thing might have some weight..
Can anyone explain to me the differences in each OS' strategy?
I'm not trying to incite fanboys here or anything, I just want to know how both operating systems tackle problems in general..
Thanks,
kreb
Of course both operating systems have facilities for using DLLs (they're called dylibs or Frameworks on OS X depending on how they're packaged).dylibs are very much like DLLs--they are a dynamically linked library and as such there may be multiple versions of them floating around. Frameworks, on the other hand, are really a directory structure. They contain dynamically linked libraries (potentially multiple versions of them), resources, headers, documentation, etc. The dynamic linker on OS X automatically handles choosing the correct library version from the framework for each executable. The system appears to work better than Windows' DLL management which is, well, quite a mess still (of course, Windows' system is tied by legacy issues that Apple dropped when they moved to OS X). To be fair, Unix has had a solution to this problem for a long time, as well using symbolic links to link dylibs to their correct versioned implementation, allowing multiple installed versions.
There is no OS X equivalent of the Windows registry. This is good and bad. The good side is that it's much harder to corrupt an entire OS X system with a registry screw up. OS X instead stores configuration in many separate files, usually one or more per application, user, whatever. These files are generally a plist (an XML schema representing dictionaries, arrays, and primitive types) formatted file. The bad side is that, by retaining this Unix-y heritage, OS X doesn't have the same über-admin tools that can churn through the registry and do all sorts of crazy things.
DLLs
The major difference between OS X and Windows is that Windows historically tried to save space/memory by having everyone share code (i.e. you install one DLL, everyone can use it). Apple statically compiles (well, not really, but it may as well be) all of the non-system libraries into every application. Wastes disk space/memory, but makes app deployment way easier and no versioning issues.
Registry
OS X does have a registry, they're just flat files called plists, instead of a magic component that's mostly like a filesystem except where it's not. Apple's approach makes it easy to migrate settings from one machine to another, whereas Windows' approach is faster in-memory, and allows apps to easily "watch" a key without taking a big perf hit (i.e. one app changes a key and the other instantly knows about it).
In conclusion
The keynote presenter's full of it, 10.6 is mostly the same code as 10.5, which was mostly the same code as 10.4 et al, just like Win7 is mostly Vista, which is mostly Server '03, etc. There's far too much tested code in an operating system to throw it away every release, especially if you actually want your customers' apps to work.
DLL's are bad variations of libaries since they are unable to operate on their own, to use them a further wrapper executable is called(automatically), which adds unrequired overhead and makes it much harder to tell which libraries are actually in use. Another less important flaw, is the inability for systems to truely share a library.
*nix systems avoid this by having libraries exist on the top level running on their own or under a larger wrapper(like kde-init ), the libraries may be shared by any applications, meaning only a single copy of each library is required, and you may at any time kill a single library with ease as required.
The registry is a great idea, except for the fact that it is used for so much, almost anything you install will use the registry, and a corrupt registry and render your operating system almost completely useless until it's fixed.
This is avoided in *nix systems by having multiple different files for different content, drivers are refered to via Xorg's config file, installed applications will be written to their own database, and keys or identification will often be written into a directory, rather than a single all purpose file. This reduces the likely hood of a serious failure and means that at any time you can probably still repair the system. If Xorg becomes corrupt you just reconfigure it, if the installed applications database becomes corrupt you can repair or rebuild it, and should an applications individual settings directory become corrupt you need only reinstall one application(and most good commercial aps should have a way to repair this anyway)

Packaging an application with dependencies under Windows

I've written an application using gtkmm and libpcap under Linux. Of course, gtkmm depends on GTK+.
After porting it to Windows and attempting to distribute it, the feedback I received is that there are too many dependencies to install.
The user has to run installers for the GTK+, gtkmm, and winpcap runtimes before they can run my little application, which admittedly is a pain.
GIMP for Windows seems to use an installer that launches a GTK+ installer if needed, but doing that for three different libraries seems a little excessive, especially in terms of the installer size.
Is there a better way to distribute this? I believe winpcap actually has to install a service, so it probably has to run the installer, but maybe I could bundle the GTK+/gtkmm libraries in the runtime folder?
I'm quite a bit more familiar with Linux development, so I'm not sure what the best course of action is.
I highly recommend using a tool like Advanced Installer to deal with this for you. Making a proper installer on windows is a real headache, so it's well worth your time to use a GUI tool to help you out. AI (and other installers, for that matter) can install and manage windows services, prerequisites, and so on, and in the long run you'll save a lot of time by using a tool like this to help with your deployment. Advanced Installer in particular has very good support for managing different dependencies, along with their associated versions, and it can also install a native Windows service during the install process. They have a freeware version, but depending on the nature of your product, you might want to spring for one of the commercial versions.
Basically, if you're serious about deploying on Windows, you should invest the time (and money, possibly) to make a proper MSI-style installer. Not to knock the NSIS crowd, but making non-standard Windows installers always results in a lot more work for the developer, and a more uncomfortable experience for the end user.
If you want to manually package the GTKmm runtime, see this link at gnome.org for more details (look under Redistributing). You can also silently run the GTKmm installer using the /S flag.

Resources