ImageMagick standalone to package in application - air

I'm building an AIR application using Flex where I use the NativeProcess API to resize images through ImageMagick using the convert program. Does anyone know how I can package "convert" with my application without needing to install ImageMagick on the user's system?
I'm looking for a solution on Mac and PC. (especially on Mac).
I don't have that much experience with building/installing something like ImageMagick so I'm wondering if it can be done in one file (convert only) so that I can directly call it in my app without the user needing to install anything prior on his/her system.

You have to package your AIR application as native installer or with a captive runtime. Both methods allow you to add additional files to your package. Adding the convert executable won't be enough, though, because it depends on a number of ImageMagick shared libraries, loadable modules for different image formats, and possibly other files. To get started, you can add the whole ImageMagick directory to your package. You can find the path to the packaged convert executable using File.applicationDirectory.

I'm not an expert on Flex, but there is a documented method for packaging native extensions at Adobe. Won't this work?

I know this question is very old, but I have the same issue so I stumbled on it !
I actually found a Mac only workaround solution, that is to use sips instead of ImageMagick. Advantage being that sips is included in all Mac's (Well as far as I know, from 10.4 to 10.8).
In my case, all functionalities that I used ImageMagick for are also available in sips, so maybe it could fit you too !

I found someone who created static libs of convert and identify programs for Mac. For Windows these are available already on the ImageMagick website but for Mac you need to build these from source. Important on Mac is to not call Convert directly but use a bash script which sets the export paths first and then runs convert in order for it to work!

Related

I have created a package of an App using nw.js. How can i create a dmg file to distribute it?

Actually there i have a html, CSS and java script based app and i created build of it using nw.js technology using build command. The problem is i want the application in dmg format. please help me finding way.
thank you.
There are many different ways to package your app. You should read the documentation:
https://nwjs.readthedocs.io/en/latest/For%20Users/Package%20and%20Distribute/
I do not know of any tutorials for creating an NW.js package as a DMG. Because the final dist is a single .app file, you could distribute that directly, or compressed in a Zip file or something similar. You may be able to look up instructions around DMG packaging that is not specific to NW.js and apply the concepts. If so, and you get it to work, you should write a blog post or tutorial about it.
You can use https://www.npmjs.com/package/appdmg to create an installer for your NW App on macOS platforms.
In my ongoing development for the same i found the making a .pkg installer is better than making .dmg with reasons you can search for.
so i found two solutions for the same.
packages(an application you can package anything with signed developer id)
buildPkg(a command line process to make package)
in both you just need to add your application.app as mentioned in documentation and follow the steps.

Distributing TideSDK application

I recently finished an application based on Titanium, Javascript, HTML, CSS. I have only been a web designer to date so I have little experience in distributing applications. I was accustomed to the TiDev Community deploying app, which prepared the app for download and made it available for download at a given link.
But tidev community is no longer supported, so I use TideSDK Developer to package the app, which doesnt do all the hard work the other one did so nicely.
I am obviously a complete rookie to this.
Could anyone outline the steps I would need to take to go from the bundled application folder I have now (put together by TideSDK Developer), to a link that will allow customers to download and install the app or online? I know there is an issue with packaoging the app for platforms other than your own, and that appcelerator is working on a solution to this I think. I also realise I would probably have to pay to host the download online. Any guidance would be greatly appreciated.
You must use the tidebuilder.py script. to compile a installation package. To compile a binary for a Mac, you must run the script on a Mac, to compile a binary for windows, you must be on a windows box etc.
There is some documentation on how to use it here per platform. The command is very simple and works.
Once you have your application file (DMG for OSX or a MSI for Windows) then just distribute it however you see fit, email, putting it on your web server, whatever works for you.

DbLinq and Mono 2.4: Working Together?

Hopefully this is a silly question and there's really a simple solution somewhere out there but...
Has anybody successfully gotten DbLinq to play nicely with Mono 2.4 on Mac OS X 10.5?
I've got my SQLite database ready but for the life of me, I can't find sqlmetal to generate my objects.
I'm guessing I might have to download a previous version of Mono that included sqlmetal, build and install it, and then just use the code generated from that version on Mono 2.4...but I'm hoping to avoid it at all costs.
I'd avoid using DBLinq for production code... many of Linq-To-SQL's features aren't implemented, and walking through the source code shows a low level of maturity... many of the methods are not implemented or marked as "unterminated".
...you've been warned!
Using the pre-compiled binary in this case just doesn't work.
To get a properly generated DbLinq data layer, you have to use the sqlmetal tool included with Mono (but, apparently, not with the pre-compiled binaries for OS X). You have to pull down the Mono trunk (along with all the dependencies) and build Mono from the source.
Once you build and install Mono from source, you should have the sqlmetal tool. Once you generate your code, it's as easy as including the generated *.cs file and importing Mono.Data.Sqlite.
Mono 2.6 will include for the first time a preview of DbLinq with Mono. You can take it out for a spin today if you install DbLinq on your own side-by-side with your current Mono setup.

Cross platform patching

I have a program that I intend to install on Linux and Windows machines. I have it cross-compiling fine (with autotools), but at some point I would like the program to be able to update its binaries. The only ways I can think of doing this are:
Give users write access to "C:\Program Files\Foo Program" or "/usr/bin/foo_program".
or
Install the program to the user's profile/home directory.
Neither of these seems like a good idea. What would you do?
You need to give us more details on what you are trying to do - I don't understsand the link between cross platform, patching and your question.
If you need to be able to auto update the program, on linux at least, the best solution is to provide a binary package (rpm, deb, whatever, depending on your target), which is updated regularly - so that new versions will be picked up by the package manager. On windows and mac os x, things are usually more decentralized, each program has its own update manager. The best technical solution depends on the technology (C/C++/python/whatever). One exception I can think of on Linux is vmplayer, which tells you when there is a new version - but you still have to install the new version.
If the program binary is writeable, you could download the patch or the new bits to %TEMP% or /tmp then apply them to the binary. I don't think you need to be able to create new files in the directory. But you're going to run into problems on Windows with the file being in use while you try and patch it.

How to write a cross-platform program?

Greetings,
I want to write a small cross-platform utility program with GUI in it. What language/GUI-library should I stick to? Is it possible whatsoever?
This is gonna be a small program, so I don't want to make people download JVM or .NET Framework. Is it possible to develop it natively?
Update 1.
By "natively" I mean that the end result will be native code without intermediate layers like Java Virtual Machine or .NET Common Language Runtime
Update 2.
A FREE solution is preferable ;)
If you know C or C++ the first cross platform GUI framework I can think of are:
QT (C++, proprietary but free with the LGPL licensing)
wxWidgets (C++, the most complete and stable but also huge)
FLTK (C++)
FOX (C++)
IUP (C, simpler and cleaner than the ones above)
If you know Pascal, you can try freepascal+Lazarus. I've never used it, though.
The problem is: If you do not want to have a GUI but you do not want to ask the user to download an eternal API, Framework or virtual machine to run it in, be it TCL/TK, Java or QT etc. then you get lost pretty fast.
The reason is: You would have to rebuild all the (GUI) functionality those APIs, frameworks and virtual machines provide you with to be platform independent. And that's a whole lot of work to do... .
On the other side: The Java virtual machine is installed on nearly any operating system from scratch, why not give this one a shot?
You want to develop a cross-platform program natively? Uh...I don't think that'll work, mainly because that phrase is a paradox. If you write native code, it by its very nature will only run on the platform you programmed it for. ;-) That's what the Frameworks are all about.
So what you should do instead is use a very slim framework if your program is going to be so small. itsmatt's idea of Qt is a possibility.
WxWindows? Oh, it's called WxWidgets now: http://www.wxwidgets.org/
wxWidgets has bindings to all sorts of languages - python for instance, if your app is small enough.
Lazarus is great. GTK2 on Linux, win32/64 on Windows, WINCE on euh, Wince. It even uses Carbon on Mac (working on COCOA). Also easy to sell to your boss (the code is Delphi compatible)
How about Python using Qt or Wx and then using PythonToExe to make a 'distributable'
Thought will have to giving to the development to ensure that no native functionality is used (i.e. registry etc.) Also things like line breaks in text files will have different escape characters so will need to be handled
Which OS's do you have in mind when you say cross-platform?
As Epaga correctly points out, native and cross-platform are mutually exclusive. You can either write multiple versions that run natively on multiple platforms, or you need to use some cross-platform framework.
In the case of the cross-platform framework approach, there will always be extra installs required. For example, many here suggest using Python and one of its frameworks. This would necessitate instructing people to install python - and potentially the framework - first.
If you are aiming at Windows and OS X (and are prepared to experiment with alpha-release code for Linux if support for that OS is required), I'd highly recommend you take a look at using Adobe AIR for cross-platform GUI applications.
I agree with Georgi, Java is the way to go. With a bit of work, you can make your desktop application work as a Java applet too (so that users do not need to actively download anything at all). See http://www.geogebra.org as an example of an application with runs smoothly as a cross-platform Java application AND has a simple port to a web applet.
Two other advantages to using Java are:
They have extensive libraries for building the UI, including UI component builders.
The Java runtime framework is generally updated automatically for the user.
One disadvantage:
The version of Java installed on your end users computer may not be totally compatible with your application, requiring you to code to the lowest likely denominator.
Try RealBasic. Visual Basic-like syntax, targets Win32, OS X and Linux. I don't know any details about targetting Linux, but for any cross-platform development I've done between Win32 and OS X its been a dream.
http://www.realbasic.com
Edit: Generates native executables. There is a small cost - $100.
Have you looked at Qt?
Flash? It's installed pretty much everywhere.
If it "HAS" to be Desktop use Qt. Nothing beats it right now.
However personally I gave up on desktop and any UI based project I do is normally Browser/Server based. You can easily write a little custom server that listens to some port so the program can run locally with no need for your users to install Apache or have access to the net. I have a small Lua, Python and C++ framework I made for that purpose (Want to add Javascript for the backend with V8 :)
If you're going to look at Qt and WxWidgets, don't forget to also check out GTK+ !
I agree with David Wees and Georgi,
Java is cross-platformness par excellence. You literally write once and run everywhere. With no need of compiling your code for each target OS or bitness, no worries about linking against anything, etc.
Only thing is, as you pointed out, that a JRE must be installed, but it's quick and straightforward to do even for novice end-users (it's a matter of clicking "Next>" a few times in the installer).
And with Java Web Start deployment gets even easier: the user just clicks the launch button on a webpage and the application runs (if the proper JVM is installed according to what specified in the JNLP descriptor) or the user gets redirected to the Java download page (if no suitable JVM is found).