Re: Install GTK on windows using no official installers
- From: Manuel Ferrero <mferrero reer it>
- To: gtk-list gnome org
- Subject: Re: Install GTK on windows using no official installers
- Date: Thu, 09 Feb 2012 18:09:40 +0100
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 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.
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:
atk_1.32.0-2_win32.zip
gdk-pixbuf_2.24.0-1_win32.zip
glib_2.28.8-1_win32.zip
gtk+_2.24.10-1_win32.zip
pango_1.29.4-1_win32.zip
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):
mingw32-gcc.exe
-Wall
-mms-bitfields
-IC:/Programmi/Gtk+/include/gtk-2.0
-IC:/Programmi/Gtk+/lib/gtk-2.0/include
-IC:/Programmi/Gtk+/include/atk-1.0
-IC:/Programmi/Gtk+/include/cairo
-IC:/Programmi/Gtk+/include/gdk-pixbuf-2.0
-IC:/Programmi/Gtk+/include/pango-1.0
-IC:/Programmi/Gtk+/include/glib-2.0
-IC:/Programmi/Gtk+/lib/glib-2.0/include
-IC:/Programmi/Gtk+/include
-IC:/Programmi/Gtk+/include/freetype2
-IC:/Programmi/Gtk+/include/libpng14
-O2
-c C:\Progetti\callbacks.c
-o obj\Release\callbacks.o
And the cli for the linker:
mingw32-g++.exe
-o bin\Release\my_app.exe obj\Release\callbacks.o obj\Release\my_app.o
-LC:/Programmi/Gtk+/lib
-lgtk-win32-2.0
-lgdk-win32-2.0
-latk-1.0
-lgio-2.0
-lpangowin32-1.0
-lgdi32
-lpangocairo-1.0
-lgdk_pixbuf-2.0
-lpango-1.0
-lcairo
-lgobject-2.0
-lgthread-2.0
-lgmodule-2.0
-lglib-2.0
-lintl
-s
-lgtk-win32-2.0
-lgobject-2.0
-lglib-2.0
-lgmodule-2.0
-mwindows
Any help, please?
--
Regards,
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]