Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to package a haskell gtk2hs glade application on windows?

I made a little GUI app with gtk2hs, Glade and Haskell. It runs fine on Windows XP, but users need to install GTK+, gtk2hs (it asks for libglade-2.0.0.dll) and GHC (as it's a gtk2hs dependency) in order to run it.

I'm a Windows n00b myself, but how can I simplify installing my little GUI from a user's perspective? Is there a way to package it with the needed .dll's? And how can I best find out which .dll's will be needed? What's a good practice?

Thanks a lot, Jarra

like image 269
user639556 Avatar asked Mar 07 '11 18:03

user639556


1 Answers

I finally found the answer for my own question. I used de Inno Setup utility (which you can find here: http://www.jrsoftware.org/isdl.php) to make a Windows installer. For a GTK / Glade / Gtk2hs application called Crosschecker I used this confiuration:

; -- crosschecker.iss --
; For making the crosschecker installer.

[Setup]
AppName=Crosschecker
AppVersion=0.1
DefaultDirName={pf}\Crosschecker
; Since no icons will be created in "{group}", we don't need the wizard
; to ask for a Start Menu folder name:
DisableProgramGroupPage=yes
UninstallDisplayIcon={app}\crosschecker.exe
OutputDir=userdocs:Inno Setup Examples Output

[Files]
Source: "crosschecker.exe"; DestDir: "{app}"
Source: "window.glade"; DestDir: "{app}"

; GTK+ dependencies
; DLL
Source: "libs\libcairo-2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libpangocairo-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\jpeg62.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libtiff3.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libpng12-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\zlib1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\intl.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libgdk_pixbuf-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libgdk-win32-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libglib-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libgmodule-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libgobject-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libgthread-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libgtk-win32-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libpango-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libpangoft2-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libpangowin32-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libglade-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libatk-1.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libgio-2.0-0.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\libxml2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "libs\iconv.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "etc\gtk-2.0\gdk-pixbuf.loaders"; DestDir: "{app}\etc\gtk-2.0"; Flags: ignoreversion


[Icons]
Name: "{commonprograms}\Crosschecker"; Filename: "{app}\crosschecker.exe"
Name: "{commondesktop}\Crosschecker"; Filename: "{app}\crosschecker.exe"

Most of the .dll's come from GTK, a few from the gtk2hs package... I copied all .dll's to a lib directory, so that's where the Inno Setup config looks at.

HTH,

Jarra

like image 99
user639556 Avatar answered Oct 18 '22 00:10

user639556