image image Home About Products Downloads Support Links Contact
image

IntraWeb
» News
» Blog
» General features
» Why IntraWeb?
» How does IW Work?

Bundled Users
» Delphi 7 Users 
» Delphi 2005 Users
» BDS 2006 Users
» Delphi 2007 Users

Technical info
» Why IntraWeb?
» Comparison with
   Other Web Tools

Resources
» Getting Started
» Documentation
» Articles
» Books
» Third Parties
» Tutorials
» Training

What others say
» Case Studies
» Companies using IW
» Demos
» Magazine Reviews
» User Quotes

Miscellaneous
» Just for Fun

Registered Users
» Bug System
» Login





Copyright
2002 - 2008
Atozed Computer
Software Ltd.

image
Buy Online   Download Support  FAQ Questions
Atozed Home  »  IntraWeb  »  FAQ

Deploying IntraWeb standalone application in a Wine/Linux system

Note: The information on this page has to be considered as EXPERIMENTAL and ALPHA. That is we do not guarantee in any way that the steps described below will work for you. Also do not use the described technique in a production system.

We are currently evaluating the possibilities of deploying IntraWeb applications to Linux via Wine. This is a basic list of steps, to get that going:

  1. Getting the software
    1. First of all, I use Debian testing (Sarge) but there should be no problems with your favourite distribution. For the remaining of this post I'll indicate each Debian specific command with (*Debian*).
      If you want to give Debian a try (why not) you can get a Sarge netinst cd image here:
      http://cdimage.debian.org/pub/cdimage-testing/sarge_d-i/i386/rc3/sarge-i386-netinst.iso
      It's 'only' one 100MBytes iso. As the name suggest, most of the system (depending also on your package selection) will be installed from the Internet.
    2. Wine, Winetools and all other related utilities can be found here:
      www.winehq.com/site/download
  2. Installation
    1. Wine, Winetools and related packages installation.

      On Debian you simply have to add the following line to your /etc/apt/sources.list file:
      deb http://wine.sourceforge.net/apt/ binary/
      (*Debian*)
      Then with
      # apt-get update
      # apt-get install wine winetools wine-utils
      (*Debian*)

      All the Wine and related software is installed.
  3. Configuration
    1. Wine user
      If you need to deploy an IntraWeb application that listen on a port < 1024 you must perform all the Wine configuration logged as root user. However it is still possible to configure and run Wine as non privileged user using a reverse-proxy like Pound:

      www.apsis.ch/pound/index_html

      Pound has a subset of OctaGate's features. This reverse-proxy can be used to dispatch incoming requests to one or more IntraWeb application(s) listening on several port/ip. This feature makes possible to have one or more IntraWeb application(s) listening on unprivileged port and thus to run the IntraWeb application(s) under Wine with non privileged user.

    2. Wine environment
      All the Wine files are placed under ~.wine/ where '~' is the user home directory. The 'C:\' drive will be placed in ~.wine/drive_c/ (symlinked to ~.wine/c/)

    1. Wine configuration
      I assume that X is properly installed and configured. If not:
      # apt-get install x-window-system fluxbox
      (*Debian*)
      From an xterm session (logged as root) type
      # winetools
      Then follow these steps:
      1. Base setup -> Create a fake windows drive
      2. Base setup -> DCOM98
      3. Base setup -> Internet Explorer 6.0 SP1
      4. Install Windows system software -> Windows Installer
      5. Install Windows system software -> Microsoft Foudation Classes 4.0
      6. Install Windows system software -> Visual C++ run-time
      7. Install Windows system software -> MDAC 2.8
      8. Install Windows system software -> Common Controls 5.0

        That's all. Almost for sure not all the packages from 1) to 8) are strictly required to our purposes. Feel free to experiment if you're worried about disk space or unnecessary dll boot loading.
  4. Running Windows executables
    At this point your Wine configuration is quite finished. You can run your .exe file with the command
    # wine <exe-file>
    The <exe-file> could reside anywhere in the Linux filesystem but It's advisable that you put it under the 'C:\' drive ( ~.wine/drive_c ) before starting it up.
  5. Database drivers
    If your IW application system needs an odbc driver, you can install it (with # wine <exe-installation-file>) and configure in the control center. The control center is accessible from the main winetools menu.
  6. Starting the IntrawebApplication
    This is rather simple. In an xterm session type:
    # wine <your-application-filename>
  7. X-Window configuration for dedicated IW deployment server
    All the steps permormed so far to start our IntraWeb .exe require that a user logs in and issues some commands. In order to fully automate the IntraWeb application(s) launch you can configure X to start automatically the IntraWeb application(s) at the end of the startup process. First you have to know the final runlevel at which your distribution sets at the end of the boot sequence. In Debian this runlevel is 2. You can find the current runlevel simply with the command:
    # runlevel

    Then follow these steps:
    1. create a file named '/etc/init.d/ziwstart'. This file should contain the following lines:
      #!/bin/sh
      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
      HOME=/root
      export PATH HOME
      /usr/X11R6/bin/xinit
    2. make the file executable with the command
      # chmod +x /etc/init.d/ziwstart
    3. symlink the above file in the startup directory /etc/rc2.d
      # ln -s /etc/init.d/ziwstart /etc/rc2.d/S99ziwstart
      Please note that /etc/rc2.d was chosen because the final runlevel of Debian is 2. If your distribution ends with runlevel 7 you have to use /etc/rc7.d in the lines above
    4. create a file named root.xinitrc with the following content:
      /usr/bin/wine root.wine/c/<exe-file1> &
      /usr/bin/wine root.wine/c/<exe-file2> &
      /usr/bin/wine root.wine/c/<exe-file3>
      where <exe-file*> are the exe application(s) you want to load at the system startup. If you want to start only one .exe, the ampersands ('&') are not needed.
    5. Disable any display manager like xdm, gdm, kdm. Simply edit the startup batch file found int /etc/init.d/ or elsewhere. For example on Debian xdm is installed with x-window. To disable it, you can edit the file /etc/init.d/xdm and put 'exit' (without quotes) on the first line.
    6. if you fear that your IntraWeb application can quit due to an unhandled exception :-) , you can substitute the last line of the file '/etc/init.d/ziwstart' created at point a) with the following:
      while (true) do  
        /usr/X11R6/bin/xinit;
      done 
    7. reboot and enjoy.



CodeGear - Where Developers Matter