Re: Install GTK on windows using no official installers
- From: Michael L Torrie <torriem chem byu edu>
- To: gtk-list gnome org
- Subject: Re: Install GTK on windows using no official installers
- Date: Wed, 25 Apr 2007 10:27:43 -0600
On Wed, 2007-04-25 at 08:02 -0700, David J. Andruczyk wrote:
> Beware that doing so (incorporating a "private" GTK+
> release intro your installer) will mostly likely BREAK
> or screw up ANY OTHER GTK+ apps on the box..
Nope it won't.
>
> I have this problem with my software (MegaTunix). I
> recommend my users to use the gladewin32.sf.net GTK+
> runtime as it has GTK+, glade, and gtkglext, all in a
> simple 5 click installer.
>
> Users report that if they had gaim installed, this
> breaks things horribly. They can't run my SW with
> gaim's GTK+ as it is missing gtkglext, and cairo
> dll.s, and instlaling the sladewin32.sf.net runtime
> doesn't resolve it as gaim's "privatized" gtk+ screws
> up the rest of the system except for itself.
You are not shipping a private version of GTK in the sense that Tor was
advocating. You are shipping a global version of GTK. No wonder it
clobbers Gaim (which, alas, also uses a global version of GTK).
>
> So adding in your own privatized version is likely to
> affect other applications.
No. Shipping your own version of GTK within your program's directory
structure is completely safe. GTK exploits the Windows default search
pattern for DLLS. Windows first looks for a DLL in the same path as an
executable that's asking for it. Thus you're directory structure will
look like this:
Program Files
\--Your app
\--bin
\--your exe, plus GTK dlls
\--lib
\-- gtk dependencies such as image loaders
\--etc
\-- gtk configuration files, theme rcs
\--share
\-- more gtk stuff
etc
Your shortcut (lnk file) to the application that you write into Start
Menu specifies the full path to the binary, and says to start in the bin
folder (very important). GTK dlls are all smart and will look for their
other dependencies relative to their own locations. Thus this little
GTK app and libraries are completely self-contained.
>
> The best "all in one" runtime I have found for me is
> the gladewin32.sf.net as it keeps it's DLL's OUT of
> the window's dir (everything goes into C:\GTK)
All GTK runtimes I've ever seen keep stuff out of the windows system
dir.
>
> It also includes bits that other GTK+ libs DO NOT
> have, like gtkglext (openGL extension),
> glade/libglade, libxml2, cairo, etc.
Cairo is a requirement for GTK. In the self-contained tree that Tor
described, you put all these in the bin folder, along with your exe.
Michael
>
>
> --- Tor Lillqvist <tml iki fi> wrote:
>
> > 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
> > _______________________________________________
> > gtk-list mailing list
> > gtk-list gnome org
> > http://mail.gnome.org/mailman/listinfo/gtk-list
> >
>
>
> -- David J. Andruczyk
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]