Zenity for Windows






Description:

Zenity is a utility used to add GUI forms to scripts and receive feedback from the user. It was designed for use with Linux and GNOME. It uses GTK+ and GLADE libraries. The official website for Zenity is: http://live.gnome.org/Zenity. I have ported the latest version (2.28.0) of this software to Windows (win32). It should work for both XP and Vista.

Screenshot:

Zenity screenshot


Downloads:

Win32 installer:
 
Source code: http://ftp.gnome.org/pub/gnome/sources/zenity/

Known problems:

1: Help files don't build.

2: When executing from a batch script, the annoying black window belonging to "cmd.exe" stays in the background all the time. I have a written a program, "bg_start", to take care of this http://www.placella.com/software/bg_start/.

3: Even though the "win32-3" version is built with support for LIBNOTIFY, this feature does not really work as it requires a "notification daemon", yet I'm not able to find one that works in windows.

How to build from source:

Warning: this is my personal experience, correct as of October 2009 for Zenity 2.28.0, your results may vary!

First thing required is a build environment consisting of a console, a compiler, as well as, GTK+ and GLADE. I set one up as described here: http://www.gtkforums.com/post-4848.html#4848. I also installed "Strawberry PERL", required by intltool, and added the path to PERL binaries to the "$PATH" environment variable in "/etc/profile". And since "intltool" provided with MINGW was outdated I build one from source code and installed it. After downloading Zenity source code and extracting it it, I went ahead and ran the "configure" script. There were many missing dependencies. Most of these are available as binaries from http://ftp.gnome.org/pub/GNOME/binaries/win32/ and http://gnuwin32.sourceforge.net/packages.html. They can be downloaded as a compressed file and extracted into either your GTK or your mingw directory (as you see fit). There are, however, also a few pesky ones, like "scrollkeeper". As far as I know, there is no way to build it using MINGW and MSYS. To get around this, one can execute the following commands from your bash shell (MSYS) (excluding the dollar signs):
$ echo "int main(){}" > foo.c
$ gcc foo.c -o /bin/scrollkeeper-config
$ rm foo.c
This made the "configure" script happy, but, as far as I can see, it also made impossible to build the help files for Zenity.

After the configure script was happy that all the dependencies were satisfied, Zenity still didn't build and "GCC" was complaining about not being able to find "langinfo.h". Eventually I found it in the form of the "libgw32c" library from http://gnuwin32.sourceforge.net/packages.html. I extracted the archive in "/mingw". To make the system aware of this library and resolve a conflict, the following commands need to be issued in MSYS (modify the path to libgw32c to match it's location on your PC):
$ export CFLAGS="-I/mingw/include/glibc -DMINGW_BUILD"
$ export LIBS="-lgw32c"
$ mv /mingw/include/glibc/stdlib.h /mingw/include/glibc/stdlib.h.bak
At this point it is necessary to run "./configure" again to enable "LC_MESSAGES". This should fulfill all requirements and Zenity should build. It will, however, not work. Paths to external files are hard coded into the executable at compile time. For Linux this is perfectly fine as the files within the operating system are very well organised, for Windows this does not work. My solution to this was to modify the source code and get Zenity to check an environment variable (which can be set at install time) to get a path to external files. You can download my patch here: zenity-2.28.0_win32-3.patch It can be applied from inside Zenity's root folder (where the configure script is and where you should have saved the patch) with the following command:
$ patch -p0 < zenity-2.28.0_win32-3.patch
And now Zenity can be built:
$ make
After you export the environment variable "ZENITY_DATADIR" and assign it a value corresponding to the directory containing "zenity.ui" and the pictures from the "data" directory, the program should actually run, too!

I'm not going to explain how the program should be packaged for it to work correctly, if you need to know this I suggest you download the installer and have a look around. Also, you can look at my NSIS script here: zenity-2.28.0_win32-3.nsi


Comments:

Comments to date: 5. Page 1 of 1. Average Rating:

Agnus   Brazil

2:19pm on Wednesday, July 21st, 2010 

Thanks a lot!
Great Job!

Thx
Regards

Hans   Austria

1:38am on Monday, April 19th, 2010 

Fine tool, this makes life for scripters much easier.

Jack   France

5:07pm on Friday, January 29th, 2010 

I am trying to run it with a portable version of Octave. How to make zenity on win portable.

Admin:  Sorry man, I don't even know what Octave is...

Eric HAMON   Gretz, FRANCE

3:38am on Tuesday, December 29th, 2009 

Excellent. It's very easy to make it portable too.
Thx
Regards

steve   Hungary

4:44am on Monday, November 30th, 2009 

Thanks a lot! :)
Great tool, i missed it from win...

Leave a comment
Your Name:
Your Location:
Vote:
Your Comment:

Security check *

security image



This page was last updated: 8/Nov/2009