RKWard on Windows/Packaging

From RKWard
(Difference between revisions)
Jump to: navigation, search
m (add rkward install file name)
Line 19: Line 19:
* MinGW compiler: Use the [http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe/download GUI Installer] as described [http://www.mingw.org/wiki/Getting_Started here].
* MinGW compiler: Use the [http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/mingw-get-inst-20100909/mingw-get-inst-20100909.exe/download GUI Installer] as described [http://www.mingw.org/wiki/Getting_Started here].
* Perl (strawberry flavored): http://strawberryperl.com/
* Perl (strawberry flavored): http://strawberryperl.com/
Install these to path which does not include the ''space'' character. (For example, do '''not''' install to ''C:\Program Files\...'')
=== Procedure ===
=== Procedure ===

Revision as of 05:10, 17 October 2010


Packaging RKWard for Windows

RKWard for Windows is currently distributed in two different variants: as a single installer, and as an installation bundle including R and KDE. This page details the steps needed to create these two packages.

Creating the RKWard for Windows installer


  • An installation of KDE, compiled with MinGW4 (see KDE techbase). Make sure to include cmake (Bin), kdebase-runtime-mingw4 (Bin, Devel), kdebase-workspace-mingw4 (Bin, Devel), kdelibs-mingw4 (Bin, Devel), qt-mingw4 (Bin, Devel), phonon-mingw4 (Bin, Devel), soprano-mingw4 (Bin, Devel), .... The needed dependencies will be included automatically.
    • You will also need automoc4 (Bin) as well. Some KDE versions, such as 4.4.4, do not have the automoc binary available with the installer; in such cases, find one from an older version, such as 4.3.2 version and just unpack it in the KDE installation root. (Hacks such as these may not always work!)
    • Hack for KDE 4.4.4: You will need to edit the file KDEDIR\share\apps\cmake\modules\KDELibs4LibraryTargets-release.cmake around lines 20 and 36) and replace "U:" by "${_IMPORT_PREFIX}".
  • An installation of R (http://www.r-project.org). You should use a 32-bit version for best compatibility.
  • An appropriate version of Rtools: http://www.murdoch-sutherland.com/Rtools/
    • Do not install MinGW and Vanilla Perl with Rtools, we will do so separately.
    • Do not add the Rtools\bin to PATH if/when asked. We'll do it in the batch file.
  • An SVN client. A command-line client is available from the KDE windows installer. Update: with KDE 4.4.4 the subversion package is no longer available/installable; try, for example, Silk SVN or TortoiseSVN.
  • NSIS: http://nsis.sourceforge.net/Download
  • MinGW compiler: Use the GUI Installer as described here.
  • Perl (strawberry flavored): http://strawberryperl.com/

Install these to path which does not include the space character. (For example, do not install to C:\Program Files\...)


  1. Check out a clean copy of the RKWard source from SVN. When creating the installer package, you will probably want to check out a release branch, rather than trunk. Thus, typically you will use something like:
    svn co http://rkward.svn.sourceforge.net/svnroot/rkward/branches/release_branch_0.5.4
  2. CD to the "windows_nsis"-subdirectory of the sources.
  3. There is a batch file "make_release.bat", here. Edit this (e.g. using kwrite). Adjust the top few lines to reflect the details of you installations. Follow these guidelines:
    • If D:\RKWard_devel\KDE4\bin\kwrite.exe exists, set
    • If C:\Program Files\R\R-2.11.1\bin\R.exe exists, set
    RHOME=Program Files/R/R-2.11.1
    • If C:\Program Files\R\Rtools\bin\cat.exe exists, set
    SH_PATH="C:Program Files\R\Rtools\bin"
    • If C:\Program Files\NSIS\makensis.exe exists, set
    MAKENSIS="C:/Program Files/NSIS/makensis.exe"
  4. Run
  5. If all goes well, an .exe-file (eg: install_rkward_0.5.4.exe) of roughly 1.4MB will be created. Test this installer, by simply running it.

This should be it.

Creating the installation bundle


  • The latest KDE windows installer.
  • The latest stable 32-bit installer of R.
  • The RKWard for Windows installer, as created with the above procedure.
  • 7zip.


Note: Please use clean installations of KDE and R as detailed, below. Do not use your existing installations of KDE or R, to avoid shipping any cruft that has accumulated, there.

  1. Create a directory "RKWard", somewhere. It seems best to root the installation in a drive other than C:\ (otherwise there are some problems when moving the RKWard.lnk, later on).
  2. Use the regular KDE for windows installer to install KDE to RKWard\KDE. As usual, select MinGW4 as compiler. Install kdebase-apps and dependencies. We could save a (small) amount of space by installing only kdebase-runtime, but adding "kwrite" might be useful in its own right.
  3. Use the regular R installer to install R to RKWard\R.
  4. Use the RKWard for Windows installer to install RKWard
  5. Edit RKWard\KDE\bin\rkward.bat to use a relative path for R_BINARY and RKWARD.BIN:
    SET R_BINARY=%~dsp0\..\..\R\bin\R.exe
    SET RKWARD.BIN=%~dsp0\rkward.bin.exe
  6. Fire up R (or RKWard) in the installation, and install the R2HTML-package.
  7. Create a link to rkward.bat, and place it in RKWard. Use RKWard\KDE\bin\rkward.ico as icon. Change the working-directory to "%USERPROFILE%".
  8. Place a copy of the GPL v2 and the Readme.html (get the current version from the existing bundle) in RKWard.
  9. Use 7zip to zip it up in a self-extracting archive.
  10. Rename this to RKWard-X.X.X_KDE-X.X.X_R-'X.X.X.exe, substituting the appropriate version numbers.

Next, you also need to create a source bundle, for GPLv2-compliance. You can use the existing source bundle as a template.

  1. For R and RKWard, simply place the source packages into the respective directories (don't forget including Rtools).
  2. For KDE, use the fetch_kde_sources.sh script (you need sh and wget). Personally I do this step on Linux.
  3. Tar it all up.
Personal tools