rick.jones at sungard.com
2007-Jul-12 17:00 UTC
[Rd] In creating a Windows binary package (zip), how do I make the installation configurable
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? 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'. Thanks, Rick Jones
Paul Gilbert
2007-Jul-12 17:22 UTC
[Rd] In creating a Windows binary package (zip), how do I make the installation configurable
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. >I hope this is a Windows version of the package called fame already on CRAN. Otherwise, you need to think of a different name, and it would be nice to have versions that work on Sun and Linux, not just Windows.>An old mode that uses >R to connect to a remote linux machine >Just remote linux machines, or does it handle remote Sun machines too? Does it handle the endian problem?>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'. > >I'm confused. If you want the user to be able to make a run time decision then you can't make this choice at install time can you? Should you not be installing both fame-local.dll and fame-remote.dll and then deciding at run time which one to call? (If this package is doing what I think it is doing, then users would want to make a run time choice. Actually, often I would want to use both at run time.) Paul>Is this possible?? > >If so, how would I do it? > >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'. > >Thanks, >Rick Jones > >______________________________________________ >R-devel at r-project.org mailing list >https://stat.ethz.ch/mailman/listinfo/r-devel > >=================================================================================== La version fran?aise suit le texte anglais. ------------------------------------------------------------------------------------ This email may contain privileged and/or confidential inform...{{dropped}}
Oleg Sklyar
2007-Jul-12 17:23 UTC
[Rd] In creating a Windows binary package (zip), how do I make the installation configurable
A configure.win file if found in the root of the package is executed during install before files from /inst are copied. What you can do is not to put your dlls in /libs but elsewhere in /inst and write a simple DOS script that will copy the required dll into /libs and rename it correspondingly. I have something similar for my package as I include a windows dll in the source package because compiling my package requires a lot of dependencies on Windows. So I have this dll in /inst/winlibs and the configure.win file deletes the /src directory (thus preventing it from compiling if inst/winlibs is not empty) and copies the dll to /libs Have a look at the source of http://www.ebi.ac.uk/~osklyar/EBImage/src/EBImage_2.1.10.tar.gz Best, Oleg 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? > > 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'. > > Thanks, > Rick Jones > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel-- Dr Oleg Sklyar * EBI/EMBL, Cambridge CB10 1SD, England * +44-1223-494466
Prof Brian Ripley
2007-Jul-12 17:26 UTC
[Rd] In creating a Windows binary package (zip), how do I make the installation configurable
On Thu, 12 Jul 2007, 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??No. You can use your own installer, though, just as we do for R itself.> If not, then are there an recommendations for a solution?Why not look for the in-FAME DLL in your .onLoad function, and load the appropriate DLL at that time? Or even put up a dialog box to ask the user (if there is: think about non-interactive use) at that point. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Gabor Grothendieck
2007-Jul-12 17:32 UTC
[Rd] In creating a Windows binary package (zip), how do I make the installation configurable
You could look at the Ryacas package for some ideas. zzz.R in http://ryacas.googlecode.com/svn/trunk/R/zzz.R is invoked at library(Ryacas) checking whether certain binaries are present and if not present then issues a message telling the user to run yacasInstall() without arguments. yacasInstall() in: http://ryacas.googlecode.com/svn/trunk/R/yacasInstall.R downloads the required binaries into the appropriate place. (Although Ryacas runs on UNIX, Mac and Windows the yacasInstall functionality and associated binaries are only available for Windows currently. Manual installation is required on UNIX and Mac.) It would have been possible to have zzz.R call yacasInstall() directly but we felt that downloading files to the user's computer transparently was not a good idea and we should make the user issue a specific command to do it to ensure that they really want to allow that. Also it gives the user the possibility of doing it manually instead of using the automatic procedure. On 7/12/07, rick.jones at sungard.com <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? > > 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'. > > Thanks, > Rick Jones > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >
Duncan Murdoch
2007-Jul-12 17:39 UTC
[Rd] In creating a Windows binary package (zip), how do I make the installation configurable
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