From murdoch at stats.uwo.ca  Thu Jul 12 19:39:41 2007
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu, 12 Jul 2007 13:39:41 -0400
Subject: [Rd] In creating a Windows binary package (zip),
 how do I make the installation configurable
In-Reply-To: <B9A3DF402FE5A44CB903DB0F130225F907D024@VOO-EXCHANGE01.internal.sungard.corp>
References: <B9A3DF402FE5A44CB903DB0F130225F907D024@VOO-EXCHANGE01.internal.sungard.corp>
Message-ID: <4696675D.3050306@stats.uwo.ca>

On 7/12/2007 1:00 PM, rick.jones at sungard.com wrote:
> I would like to create a binary package for Windows which when
> installed will give the user an option of whether to install
> one version or another.
> 
> Here is the problem, I have a package 'FAME' that can run
> in two different modes on Windows. An old mode that uses
> R to connect to a remote linux machine and a new way that
> uses a locally installed database.
> 
> I would allow this decision to be made at run time, but
> the DLL in the later case depends upon the database's DLL
> being on the Windows machine. A runtime solution would 
> require at least one extra level of dynamic loading.
> 
> So I would like something like this to happen:
>  the zip file contains fame-local.dll and fame-remote.dll
>  when the user selects 'install packages from a zip file'
>  the user should be given the option of which DLL 
>  should be renamed to 'fame.dll'.
> 
> Is this possible??
> 
> If so, how would I do it?

I don't think it's possible:  installing from a .zip file basically just 
copies the files to the system, it doesn't execute the code.

It would be possible to do this if installing from a source package 
(just build one DLL), or you could install both and delay the decision 
until you attach the package:  there are hooks to execute code when a 
package is loaded.

> If not, then are there an recommendations for a solution?
>   An alternative I can try is to have 2 separate packages,
>   'fame' and 'fame-remote'.

I'd do it through a load hook.  The rgl package does this when running 
on a Mac, because it's not until load time that it knows if the user is 
using X11 or Aqua.  See the .onLoad function in zzz.R for details.

Duncan Murdoch



[Rd] In creating a Windows binary package (zip), how do I make the installation configurable
Duncan Murdoch