Thursday, March 17, 2011

rough guide to create windows packages

here are some notes I made while making the last packages for windows.

with this and using my repo you should have a fully working version (with some bugs, but those are from emesene and note because of the packaging)

download the following files and install them in the order they appear

download the following two and follow the instructions below

  • extract the webkit file on:
    • C:\Python26\Lib\site-packages\gtk-2.0\runtime\
    • if it asks for an override select "No"
  • extract the pywebkit file on:
    • C:\Python26\

install the following files

open the git shell and do

git clone
cd emesene
git submodule init
git submodule update

cd emesene
cp ../dlls/* .

cp -r e3/papylib/papyon/papyon/ . 
cp -r e3/jabber/xmppy/xmpp/ .

set the python path (rigth click on "My Computer", click on properties, go to
the advanced tab, click the "Environment Variables" button, on the "System
variables" section select the "Path" variable and click edit, on the "Variable
value" dield go to the end and add ";C:\Python26" without the quotes and click
ok to close all the dialogs. Open a new shell and go to the directory where you
where before and do


creating the installer

first you need to override the file from py2exe to avoid displaying an annoying dialog at exit.

to do this you have to copy the file in windows/ on the emesene repository to the py2exe directory, in my case in the command line (using the git command line that has come cool unix tools) is:

you only need to do this once.

cp ../windows/ /c/Python26/Lib/site-packages/py2exe/

and then

cp ../ ../ ../emesene.ico .
python py2exe
cp *.dll ../dist/
cd ../dist/

copy "etc" "lib" and "share" from C:\Python26\Lib\site-packages\gtk-2.0\runtime
to emesene/dist

on the git shell it would be

cp -r /c/Python26/Lib/site-packages/gtk-2.0/runtime/etc/ .
cp -r /c/Python26/Lib/site-packages/gtk-2.0/runtime/lib/ .
cp -r /c/Python26/Lib/site-packages/gtk-2.0/runtime/share/ .

then remove some unused files to make the installers smaller

cd share/
rm -rf aclocal/ dtds/ doc/ icon-naming-utils/ locale/* gtk-doc icons/Tango/scalable/
cd themes/
rm -rf Default/ Emacs/ Raleigh/
cd ../..

you can still remove more files (like unused icons)

now right click on the .nsi files on emesene/ and select "Compile NSIS Script"

they will create the installer and the protable versions for you

and that's all


klesus12 said...

Finally! A set of instructions that makes sense.

But just out of curiosity, is it really necessary to include NSIS?
I memory serves correctly, NSIS is for making an installer, but what need is there for an installer if all files already is available?

luismarianoguerra said...

this are instructions to create a windows package, that's why nsis is required.

Markuz said...

Hello, i just tried your instructions and they work fine. Emesene2 compiles, installs and opens but as soon as i try to send a message from an open contact window it crashes/closes automatically without any error

Markuz said...

Running it from bash console I can see it prints a warning saying it couldn't find gtk-spell, then closes

Ariel said...

Same here, it crashes without any error just after opening a conversation.

Using the text output it works right.

Ariel said...

It's weird, I've tried the installer on another pc and it doesn't crash with adium themes (I still can't see custom emoticons, but avatars are shown).

I'll try removing everything I can find on my computer from webkit and python and all those things and try again.

Ariel said...

Done! removed all python/webkit/pywebkit related files and registry entries, reinstalled everything again and just one extra tweak (I had to copy most dll's from emesene/dll to c:\python26\lib\site-packages\gtk2.0\runtime\bin to fix a "load dll failed" error)

Now it doesn't crashes but it's (again) not showing emoticons or avatars. I have to debug that now :P.

It looks like the installed version tries to use the system's version of webkit instead of the bundled one (it was crashing until I removed everything except emesene2).

Markuz said...

Ariel, guess avatar problem coul be related to recent emesene mtn fixes. Try using repository since they merged mariano fixes for windows :)

Marienne said...

Could you please upload the package if you manage to make it work please Ariel? :D

syst3m said...

Created this today (Apr 12, 2011) if anyone is interested.



use at own risk.

luismarianoguerra said...

@syst3m: I get this

Traceback (most recent call last):
File "", line 735, in
File "", line 732, in main
File "gui\gtkui\__init__.pyo", line 31, in gtk_main

File "gtk\__init__.pyo", line 40, in

File "gtk\_gtk.pyo", line 12, in

File "gtk\_gtk.pyo", line 10, in __load

ImportError: DLL load failed: The specified procedure could not be found.

syst3m said...

That was my first attempt, it worked for me but I guess I messed up somewhere.

More recent packages can be found at:
I'm uploading new ones everytime I build one for myself.

Markuz said...

@syst3m: Your latest build doesn't work with exactly the same error as mariano pointed out. It seems some dll is missing in the package

syst3m said...

@Markuz Thats weird. It works fine for me, both the installer and the portable one.

Any suggestions for fixing this?I was just following the guide.

luismarianoguerra said...

try installing a VM with a clean windows and try the installer and portable there, maybe it works on your machine because you have all the needed software installed.

the guide is open to improvements :)

Markuz said...

Something is weird if you consider I tried the installer on a computer where i downloaded everything needed by the guide. I suppose it's something related to system webkit or so..

syst3m said...

@luismarianoguerra I will try later, on XP. I did try one of my packages a few days ago on a school computer and it seemed to work. I just couldnt log in because they blocked ports or something.

syst3m said...

Im getting the same error on in XP, donno whats causing it. I can still run it fine on my comp though. I'm open to suggestions on how to fix it.

Markuz said...

Try with to see what DLL emesene loads. Maybe there's one win7 have and xp doesn't

Markuz said...

Yeah it works on win7 but still have bugged theme (works just with plain text output, crash with adium) Anyway you can try something like process explorer to catch the missing dll :D

arielj said...

you can also use this to find out the missing dependencies

syst3m said...

Using dependency walker, the following are missing on windows xp.








Not sure if i'm using it right.

luismarianoguerra said...

they don't seem to be related to python/gtk/emesene, you could try getting them but I think they are false positives..

Marienne said...

Lots of error with last build,can't even see half of my contacts (under windows 7). Also using adium theme for conversation crashes emesene. Everything is fine with emesene 1 and/or other clients

arielj said...

@Marianne, the empty list problem was caused by animated avatars on Windows, i've fixed this today

Markuz said...

@syst3m: Could you please upload newer builds since the official one is late? :-)

syst3mfailur3 said...

Sorry for the lack of updated packages. Going to try to upload a new one every few days or so. Going to be uploading mostly 2.11.5-devol builds.

New download link:

Also going to be trying to solve some of the issues with the packages. See

syst3mfailur3 said...

Link above added a . to the end which messed it up. Proper link to the list of current issues is .

Markuz said...

Thanks syst3m, u've been really fast and gentle. The only thing that is currently bogging me is the fact that with adium ouput enabled it crashes as soon as i open a contact window. And of course with text output i can't even see emoticons, so there's really a lot of work needed with dependencies

syst3mfailur3 said...

@Markuz Never realized that it was just crashing under the adium output. I thought it was just crashing when ever it was being opened no matter what. Hopefully that might help with a fix. Not a developer, just packaging.

On a side note, I think I have solved the problem with my packages not working on windows XP. Build time 20110505 (1815) and newer should hopefully work on 7, XP, and vista. Haven't tested anything on vista, just assuming it will.

Markuz said...

I can confirm it works on xp now with a clean install (the problem was still there when i tried to overwrite the old install :P) About adium I guess it's related to webkit dll since that's what it uses for displaying it... maybe it's cause i use google chrome or any program that make use of webkit, don't know