How to build software that doesn't require a framework on the user's machine? - frameworks

I am an ASP.NET developer, but now I want to build a software that can be installed on my PC. Software built in .NET platform only works when the .NET Framework is installed, and software written in Java only works if the JDK is installed. When I install programs like Firefox, uTorrent, etc., I don't need to have any frameworks (.NET, JDK, etc.) installed. How do I write software that doesn't depend on a framework?

You will have to use a language that isn't dependent on a framework or otherwise only target clients that are already have your framework installed.
If you chose C or C++ for example, you would distribute binaries to your client that contained machine code. This code would not be dependent on a runtime environment (like C# or Java) or an interpreter (like Python or Ruby). This is the way that applications like Firefox and uTorrent are written.

"When I install programs like Firefox, uTorrent, etc., I don't need to have any frameworks."
Actually, you do. They just tend to use the C++ frameworks, such as MFC, some of which are already installed. Even then, there are installers for these frameworks that are included with other application installers (usually called Microsoft Visual C++ 2008 SP1 Redistributable Package or something like that. See Also: Visual C++ Deployment).
Now, having said that, they don't require a virtual machine (like a JVM for Java or a CLR for .NET), because C++ compiles down to x86 / x86-64 machine language to be executed directly by the operating system.

Fundamentally you always have a "platform", which is the operating system. Traditionally if you want to write code that will run on multiple operating systems you would use a fairly portable language such as C++ that produces native executables for a target operating system. Still, there are differences between how different operating systems work. There will therefore be parts of the C++ (or other portable language) code that are specific to that OS. You try to isolate those parts as much as possible to minimize the effort to port between OSes. Still, that effort is typically very substantial. You are also limited to the least common denominator of features available on all target operating systems (unless you create a custom version for a given OS that exposes its special features).
This is complex, time consuming and expensive. That's the reason technologies such as Java and .NET were created.

If You want to build really platform independent software You will finally end up with solution like Java Runtime or .NET. What You could do, You could thing about writing application in such way that You are able to compile/run it on most known platform, and of course then You need middleware to translate Your application's objects into platform objects (functions, whatever...).
I have seen solutions made in Pascal for DOS in such layer of abstraction that with little effort it was moved directly to Delphi for Windows without touching application logic.

Related

Can I use VxWorks OS as Normal OS on my PC?

I am New to VxWorks. First of all Can I use VxWorks OS as Normal OS on my PC? I mean Can I run my application software on VxWorks OS?
While VxWorks can run on PC hardware, it is not a general-purpose OS for running independent executables. VxWorks is an RTOS library; you statically link it to your application and the whole runs as a monolithic executable.
It does support a command line interface (intended primarily for development and debug), and from that it is possible to dynamically load and link object files, but these are not independent executables in the sense they are in a GPOS; they essentially become part of the monolithic application.
An RTOS such as OS/9 or QNX would be more suited as these can operate more like a GPOS in the sense of loading and executing independently linked executables.
In any event, application software must be specifically built for these targets.
For versions of VxWorks prior to VxWorks 6, the answer by clifford provides a good explanation of why this is not really possible.
VxWorks 6 introduced Real Time Processes (RTPs). These are independant, user mode applications, running on top of the VxWorks OS. Dependant on how the VxWorks OS has been configured and built, these RTP applications may have access to POSIX libraries, and so you may be able to run POSIX applications (eg linux programs) with little modification.
However, these must still be built for VxWorks, ideally linked against your own VxWorks Source Build.
You cannot, however, just pick up any old application and expect it to run. You are never going to get Word or Excel to run.

Cross platform project automation

The web shop where I work we do both .Net and PHP/Linux development. We'd like to start automating a lot more of our deployment processes using a common system that can be used for both. What would you recommend as a good common scripting language or automation system (like Ant or Maven) that works well for both .Net and Linux development?
I have no experience with Maven, but we've managed to get Ant to do everything we've wanted on multiple platforms, just by virtue of the fact that you can extend it with any Java program to do special tasks not included with the Ant application itself.
And then Java can, if necessary, call any external program you want to by using Runtime.exec(). Loses a bit of the portability but it was required for some command-line tools under both Linux and Windows.
You may want to see how Perl does cross platform automation. The design for Perl6, seems to be a bit better designed, but the Perl5 design has had many years to develop.
Perl has been ported to many different platforms, not just Linux and Windows.
You may get some mileage out of Capistrano. It is rails centric but it is pretty general purpose, and I believe it has been extended to do other things also. Not sure how well it plays with Windows and .NET, but worth a look.
You can develop .net on linux using Mono.
On that linux server you can use both .net and php.

Are there any USB stick runnable, no-install, cross platform software frameworks (with GUI)?

Does anyone know of a good software development framework or similar that has the following properties?
Cross platform: it should be runnable on XP, Vista, OSX and common versions of Linux (such as Ubuntu and Kubuntu).
No installation: Be able to run the software from a USB stick without having to copy anything to the host machine.
Have good GUI support (this is why this question doesn't give a suitable answer, as far as I can tell).
Permissive licensing such as LGPL or BSD or such.
Among the softer requirements are having a set of abstractions for the most common backend functionality, such as sockets, file IO, and so on (There is usually some platform specific adaptations necessary), and supporting a good language such as Python or C++, though it is usually fun to learn a new one (i.e. not perl).
I think possible candidates are Qt 4.5 or above (but IFAIK Qt software will not run on Vista without any installation(?)), some wxWidgets or maybe wxPython solution, perhaps gtkmm. The examples I have found have failed on one or another of the requirements. This does not mean that no such examples exist, it just means that I have not found any. So I was wondering if anyone out there know of any existing solutions to this?
Some clarifications;
By "framework" I mean something like Qt or gtkmm or python with a widget package.
This is about being able to run the finished product on multiple platforms, from a stick, without installation, it is not about having a portable development environment.
It is not a boot stick.
It is ok to have to build the software specifically for the different targets, if necessary.
The use case I am seeing is that you have some software that you rely on (such as project planning, administration of information, analysis tools or similar) that:
does not rely on having an internet connection being available.
is run on different host machines where it is not really ok to install anything.
is moved by a user via a physical medium (such as a USB stick).
is run on different operating systems, such as Windows, Vista, Ubuntu, OSX.
works on the same data on these different hosts (the data can be stored on the host or on the stick).
is not really restricted in how big the bundled framework is (unless it is several gigabytes, which is not really realistic).
It is also ok to have parallel installations on the stick as long as the software behaves the same and can work on the same data when run on the different targets.
A different view on the use case would be that I have five newly installed machines with Vista, XP, OSX, Ubuntu and Kubuntu respectively in front of me. I would like to, without having to install anything new on the machines, be able to run the same software from a single USB stick (meeting the above GUI requirements and so on) on each of these five machines (though, if necessary from different bundles on the stick).
Is this possible?
Edit:
I have experimented a little with a Qt app that uses some widgets and a sqlite database. It was easy to get it to work on an ubuntu dist and on osx. For windows xp and vista I had to copy QtCored4.dll, QtGuid4.dll, QtSqld4.dll and mingwm10.dll to distribution directory (this was debug code) and I copied the qsqlited4.dll to a folder named "sqldrivers" in the distribution directory.
You mention wxWidgets but dismiss it as failing at least one of the requirements.
I don't know what your requirements are and in what way wxWidgets wouldn't work for you, but IMO it does fulfill them:
Cross platform: it should be runnable on XP, Vista, OSX and common versions of Linux.
It does run on those platforms, but "common versions of Linux" isn't good enough, as you can never be sure that the necessary GUI libraries for wxGTK (which should not be linked to statically) will be installed. This is however a problem for other solutions as well, unless you plan to put everything onto the stick.
No installation: Be able to run the software from a USB stick without having to copy anything to the host machine.
See the previous point, you would need to specify which libraries are needed on Linux. Also you could specify at build time not to use some of the system-provided libraries (for example for graphics, compression, regexes) but to use the wxWidgets-internal libraries instead.
Have good GUI support
Check.
Permissive licensing such as LGPL or BSD or such.
Check. You can statically link wxWidgets into your application too.
supporting a good language such as Python or C++
Supports both, and there are bindings to other languages as well.
having a set of abstractions for the most common backend functionality, such as sockets, file IO, and so on
It does have some abstractions like that, but you can link to other cross-platform libraries as well.
We use wxWidgets for FlameRobin, a graphical administration program for the Firebird SQL server. It has active ports to Windows, Linux and Mac OS X, and has been compiled for at least some BSD variant and Solaris as well. It definitely runs from a stick on Windows, I haven't tried with Linux or Mac OS X, but I don't see why it shouldn't there too.
Java.
It has GUI support.
It provides your network/file/etc. abstractions.
It is cross-platform. Most platforms you can think of have a JRE available.
No need to install a JRE. Most users probably already have one, and if not, you can run the appropriate JRE right off the stick.
You can provide several startup scripts for various platforms to run the app under the appropriate JRE.
Something else to consider is HTML+Javascript. :D
You can look at Mono it cross platform, has GUI (GTK+, or Winforms 2.0) and I can execute code without installing.
This might not be crossplatform, but is maybe even better, it dont even use the platform : linux on a stick :-)
The subtitle is
Take your Java workspaces wherever you go on a USB key
Here with java and eclipse, but nothing stops you there of course.
http://knol.google.com/k/inderjeet-singh/installing-a-ubuntu-hardy-heron-java/1j9pj7d01g86i/2#
Well, it depends on what you mean by 'package'. Kylix came close to being such a thing. It was QT based, and it allowed you to write once and compile for Windows + Linux. However, it was not an open source solution.
I asked a similar question in this link
http://www.24hsoftware.com/DevelopersForum/CrossPlatform-C-Library.html
and the best asnswer seems to be QT.
I have started using QT, but it is not as easy as I expected mainly due to deployment problems due to the DLL hell, Winsxs hell and manifest hell.
Tclkit is a single-file, self-contained Tcl/Tk system. The mac version I have is about 3.8 megs. You can get a version for just about any modern OS. I carry around a thumb drive that has mac, windows and linux binaries so I can run my scripts on any platform. No install is required, just copy one file wherever you want.
The most recent versions of tcklit use native, themed widgets (though, on *nix there really isn't a single "native" set of widgets...)

Creating installers for complex cross-platform programs

I'm sketching an application deployment process for a bunch of relatively complex desktop applications. We have both native and Java apps, so the deployment must be able to check for existence of the JRE and install it if needed. Some of the apps depend on special hardware, so the deployment must also be able to launch the necessary driver installers. Some of the apps are multiplatform, and preferably the same mechanism should be able to create Windows, Linux and Mac OS X installers. That is:
The installer must be able to install, in addition to the application itself:
Java Runtime Environment.
Drivers (hardware) - that is, launch other installers.
The installer builder must be operable from the command line so that it can be integrated with an automatic build mechanism that generates installer packages for each platform as nightly builds.
In addition, I need to create "update from the web" mechanisms for the applications. It could be included in the installer, or it could also be a separate custom mechanism built into the application.
Now, this is getting a bit complex, and I suspect that there might be no single installer that could do this all. Therefore I'm thinking between two fundamentally different approaches:
Platform-specific mechanisms: NSIS would create .exe or .msi for Windows, XXX would create .deb for Ubuntu, and YYY would create .dmg for OS X.
Cross-platform installer that would handle all the requirements above: ZZZ?
Any recommendations? Some options that I've looked include:
NSIS - Excellent, but Windows only.
IzPack - Good, but requires JVM to run.
Is there an universal tool for this, or should I just pick an appropriate tool separately for each platform? In the latter case, what would be "NSIS equivalents" for Ubuntu and Mac OS X?
I have some recommendations as follows.
Use WIX (Windows Installer XML) for creating MSI installers for Windows
Use Package Maker (part of XCode tools) on MAC OS X, preferably the command line version
Write wrapper scripts (in Python or so) to drive the over-all installer creation process.
to aggregate all the components you need to install (may be from ur version control system)
generate necessary files for Wix and Package Maker as much as possible
to run the packaging tool and generate the package
Make sure that the overall installer creation process is a simple one command operation overall (with options to create different versions of your package based on criteria like release branch etc.)
Overall, developing this workflow requires some initial effort and quite a lot of thinking. But the end result is quite worth the effort.
I haven't done this on the Linux side, but I guess would use RPM/DEB on that front in this workflow.
BitRock InstallBuilder meets all the requirements, including being multiplatform and providing an autoupdate mechanism
You should take a look at InstallJammer. It will definitely handle the cross-platform elements that you want and can even add entries to the DEB and RPM databases on the target system during installation. OS X support is still experimental, but it mostly works.

open solaris code vs solaris code

How compatible is code written under Solaris with Open Solaris ? I would be interested specifically in some kernel modules .
I think it is hard to quantify software compatibility, but I'd say code written for Solaris is quite forward compatible with OpenSolaris kernel. OpenSolaris source code evolves into what will be Solaris 11, and Sun's commitment to backwards compatibility is quite a fact.
Kernel modules written for Solaris should function in OpenSolaris following a simple recompile providing you are using the exposed kernel APIs that are compatible between the releases that you are using in Solaris and OpenSolaris.
There is a huge amount of work in Sun to ensure that programs written using publicly exposed interfaces are compatible. There is a listed 'Exposure/Stability' entry at the bottom of manual pages for most APIs that state in defined terms how someone can use it.
Kernel modules in particular will be very compatible between Solaris and OpenSolaris. OpenSolaris (via Project Indiana) is evolving the user-space components more heavily, including the installer and packages.
This is with regard to core OS daemons only and not kernel modules, but I've had success compiling OpenSolaris components from source and using the resulting binaries on commercial Solaris just fine. It's obviously easier with a Makefile but I did one manually.
I tried this with a small handful of binaries that I needed to add debugging output to and compiled them directly on the commercial Solaris system using gcc without issue. As mentioned earlier YMMV based on what app/module it is.