Re: Install GTK on windows using no official installers

Tor Lillqvist wrote:

  >  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
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

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.

First of all, sorry for resurrecting such an old thread.

I'm done coding, now I'd like to deploy my application to a customer.
I read about how GTK should not be static compiled in my application and how I sould rather distribute the toolkit with it. I stumbled in this message and I tried to follow all the steps to create my package, but it's not working.

My application (let's call it my_app.exe) is for win32 and it's compiled with Code::blocks and MinGW, I used Glade3 to create the GUI and GtkBuilder to load it.
I used Inno setup to create the installer.

I downloaded the following packages:

Then I unzipped all the packages in a directory and then I added my_app.exe file in the bin directory.

Right now I don't need to reduce the installer so I don't removed any file from the GTK tree, even if the application don't use some of them. During the installation process I don't want to set up any environment variable and afaik placing my_app.exe file in the bin directory is the way to avoid it.

If I try to install the package on a new machine and run my application I get an error about the entry point for g_strcmp0 in libglib-2.0-0.dll.
I checked, that dll is in the bin directory in the new machine.

The command line I used to compile one of the project file is this (I separate all the compiling switches for reading commodity):

-c C:\Progetti\callbacks.c
-o obj\Release\callbacks.o

And the cli for the linker:
-o bin\Release\my_app.exe obj\Release\callbacks.o obj\Release\my_app.o

Any help, please?
Manuel Ferrero
R&D department

Reer SpA	
Tel.  +39 011 2482215
Fax. +39 011 859867

L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe costituire reato.
Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve essere considerato
come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, via e-mail,
ce ne comunicasse l'errata ricezione.

The unauthorized use of this e-mail is prohibited and could constitute an offence.
If you are not the intended recipient of this message its contents shall be understood as neither
given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in that case.

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