Difference between revisions of "Deployment on Windows"

From GNUstepWiki
Jump to navigation Jump to search
(moved introductory paragraph out of section)
 
(One intermediate revision by one other user not shown)
Line 44: Line 44:
  
 
Happy GSCoding ;-)
 
Happy GSCoding ;-)
 +
 +
[[Category:Deployment]]
 +
[[Category:Microsoft Windows]]

Latest revision as of 11:15, 29 October 2011

These instructions are based on a mail from Lloyd Dupont. You find more recent instructions from Nicola Pero in the file core/make/Documentation/README.MinGW. Keep in mind that either ones are experimental. You may have to try out yourself which files you need to ship. The medium-term goal is to provide a separate runtime package that puts libs to a standard place so that it will suffice to zip&deploy the .app directory.

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!)

Preparation of your MinGW GNUstep environment

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

It's a relatively long but painless process.

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 ;-)