Deployment on Windows

From GNUstepWiki
Revision as of 14:02, 16 July 2005 by Comrade (talk | contribs) (Language cleanup)
Jump to navigation Jump to search

Preparation of your MinGW GNUstep environment

These directions seem to work but have been tested only on Lloyd Dupont's development machine so far - this has yet to be tested on a test machine without anything installed. (Please update this once someone's tested this!)

First-off, it is recommended you build GNUstep from CVS yourself using the MinGW README or following the instructions for Installation on Windows.

It's a relatively long but painless process.

Note: the installer "GNUstep-base-1.10.1-gui-0.9.4.exe" contains slightly buggy DLLs - please use a current CVS version!

Making sure that DLLs are available to your application

Once GNUstep is built, you'll need to do three things to deploy your application:

1. Make sure that all the dependency DLLs that are installed in the MinGW GNUstep environment are in your application's directory or in the PATH (see Installation on Windows step 11 and 14: libintl, libiconv, etc)

2. Make sure that all the DLLs in <GNUstep>/System/Tools are in your application's directory or in the PATH

3. The content of <GNUstep>/System directory (with the exception of <GNUstep>/System/Tools) should be pointed to by one of the following environment variables:

 GNUSTEP_SYSTEM_ROOT
 GNUSTEP_NETWORK_ROOT
 GNUSTEP_LOCAL_ROOT

Hint: make all three variables point to the same directory to avoid all suprises. You don't need System/Tools in these as you have already copied the DLLs.

The three variables are intended to support a more complex GNUstep environment than you may need for a single application deployement.

If you don't want to mess with system environment variables or want to have multiple (side by side) installations, you could set these variables at application startup time with:

 [NSProcessInfo initializeWithArguments: __argv
                                  count: __ argc
                            environment: (char**){
   "GNUSTEP_SYSTEM_ROOT=C:\AppLocalGSPath",
   "GNUSTEP_NETWORK_ROOT=C:\AppLocalGSPath",
   "GNUSTEP_LOCAL_ROOT=C:\AppLocalGSPath",
   NULL} ];

It is important to call this method early before any other part of the application triggers caching of incorrect GNUstep environment variables.

Warning: simply using putenv might fail if, for some reason, the class NSProcessInfo has already been initialized - it will have cached the environment variables.

Voila! Your GNUstep-based application can now be shipped without the user having to know about or install GNUstep - and you don't have the risk of an untested version of GNUstep being loaded by your application either.

Happy GSCoding ;-)


based on a mail from Lloyd Dupont