Re: Install GTK on windows using no official installers



Bleriot Trece writes:
 > is it possible to copy a set of GTK files (DLLs or whatever) and,
 > in this way, make GTK available WITHOUT using an official GTK
 > installer?

Of course. And anyway, the degree of officialness of the various GTK
installers out there isn't that clear.

 > what files should be copied, what environment variables
 > modified... and so on?

I could try to list them, but you learn best by doing, so I will tell you
how to do that:

Start by fetching from http://ftp.gnome.org/pub/gnome/binaries/win32/
the latest run-time zipfiles (not the *-dev-* ones) for gtk+, pango,
atk, glib. From the depencensies subfolder get the latest cairo,
gettext, and libiconv run-time zipfiles. If you know that your app
will need the libpng pixbuf loader at run-time, also get libpng and
zlib.

Unzip all the above in some new empty folder. Add the "bin" folder of
that to your PATH environment variable.

Then start removing stuff you think your app and your customers won't
need. For instance, if you don't have any need for localised strings from
gtk+ etc, you can remove everything from lib/locale . If you want localised
strings, but not for some "exotic" languages, remove the corresponding
subfolders from lib/locale.

If you don't need pixbuf loaders for "exotic" image formats, remove
those dlls from lib/gtk-2.0/2.10.0/loaders .

If you don't need gtk+ input modules, drop lib/gtk-2.0/2.10.0/immodules
. Also, then edit etc/gtk-2.0/gtk.immodules.

If you want the MS-Windows theme to be the default, create a file
etc/gtk-2.0/gtkrc with the line gtk-theme-name = "MS-Windows" . Otherwise,
if you don't want the end-users to be able to change theme engine, drop
lib/gtk-2.0/2.10.0/engines and share/themes/MS-Windows .

If you don't need the Freetype2 Pango backend (and you presumably
won't), remove bin/linpangoft2-1.0-0.dll.

Hmm, that should be about it. If I forgot something obvious that can
also be dropped, please follow-up...

Then you add what's left to your application's installer. 

Don't change the folder substructure. Keep the DLLs in the "bin"
subfolder for instance.

It's easiest to put your application's exe file in the same "bin" folder
and have your Start Menu etc shortcuts point to that. Otherwise you will
have to make sure that the "bin" folder is included in PATH when the
end-user runs your app, either by having your installer modifying the
environment variable, using the App Paths Registry method, using a tiny
wrapper executable that modifies PATH, or something else.

The recommended way (at least if I am doing the recommentation) is indeed
to install a copy of GTK+ with each application (or set of applications
originating from the same maintainer / packager) that uses it. This is
unlike Linux, I know. But attempts to use a shared GTK+ installation on
Windows between applications developed and distributed by unrelated parties
have not really been successful.

--tml



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]