deploy wxHaskell app on Windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

deploy wxHaskell app on Windows

Olaf Klinke
Dear Cafe,

I need help deploying a wxHaskell application on Windows.
(The [hidden email] list seems to be dormant, as is wxhaskell-users on sourceforge.) I am explicitly CC-ing some people who recently posted about wxHaskell on this list.

TL;DR: How to deploy a wxHaskell application on several Windows machines?
Option (a): Automate the installation of DLLs and tweaking of PATH
Option (b): Build static libs of wxWidgets to be linked into a static binary.
I don't know how to do either.

I developed a GUI application based on wxWidgets. I love the wx package, since wxWidgets provides all the high-level dialogs I need, like file and date pickers. The necessary installations on my Linux development machine went like a charm. Next I tried a Windows 10 machine.
I installed stack, which installed a ghc.exe in %HOME%/AppData/Local/Programs/.../bin/ and cabal and stack binaries in %HOME%/AppData/Roaming/local/bin/.
I downloaded a wx-config.exe binary and placed it in the latter directory and added that to the PATH.
I downloaded wxInstall-Achelanne-64.0.1 and after adding the above path to ghc.exe to it's Install.bat, the Installation completed. Install.bat suggested to add two directories to the PATH, which I did.
I set WXWIN to wxInstall-Achelanne-64.0.1/wxWidgets
and   WXCFG to gcc_dll/mswu
With this, wx-config outputs some flags if requested.
Next, I added
%WXWIN%/include
to extra-include-dirs        
and
%WXWIN%/lib/gcc_dll
to extra-lib-dirs in my stack.yaml.    
I also added %WXWIN%/DLLs
to the extra-lib-dirs in the .cabal file.

%WXWIN%/include/wx/platform.h mentions wx/setup.h which is not there.
Remedy: Copy %WXWIN%/include/wx/msw/setup.h to %WXWIN%/include/wx/setup.h

I believe I did set SHARED=0 in the wxWidgets config but there are no .lib, only .dll files in %WXWIN%, so I can not use ghc -optl-static. Hence the binaries produced by stack need to be told the place of the DLLs via the PATH environment variable. This is something I'd like to avoid on all the machines.

Any suggestions welcome.
Olaf
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: deploy wxHaskell app on Windows

Matthias Kühlke
Hello,

the easy solution would be to place the DLLs into the same directory as
the .exe file. Windows looks there first:
https://docs.microsoft.com/en-us/cpp/build/search-path-used-by-windows-to-locate-a-dll
We did that with GTK, and it worked perfectly.

HTH,
Matthias
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Re: deploy wxHaskell app on Windows

Ivan Perez
Hi

On 22 September 2017 at 19:45, Matthias Kühlke <[hidden email]> wrote:
[T]he easy solution would be to place the DLLs into the same directory as
the .exe file.

I also do this. I wrote a GTK Haskell program for a company in 2011 that placed the DLLs with the executable. It's been in use ever since on machines, up to windows 7 I believe, without changing that.

Ivan
 

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.
Reply | Threaded
Open this post in threaded view
|

Solved: deploy wxHaskell app on Windows

Olaf Klinke
Thanks all for the hint! The DLLs and executable even work on both Windows 10 and Windows 7, which I feared would require yet another setup of stack.

Now I have got only one cosmetic problem to solve: Static text in wxWidgets seems to accept bgcolor attributes, but the background itself seems to be transparent (or equal to the parent's). Graphics.UI.WXCore.WxcDefs exports far fewer constants than there could be. I'd like to color cells of a table composed as a grid of static text elements.

Cheers,
Olaf

> Am 23.09.2017 um 00:22 schrieb Ivan Perez <[hidden email]>:
>
> Hi
>
> On 22 September 2017 at 19:45, Matthias Kühlke <[hidden email]> wrote:
> [T]he easy solution would be to place the DLLs into the same directory as
> the .exe file.
>
> I also do this. I wrote a GTK Haskell program for a company in 2011 that placed the DLLs with the executable. It's been in use ever since on machines, up to windows 7 I believe, without changing that.
>
> Ivan
>  

_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.