RKWard on Windows/Packaging

From RKWard
Revision as of 04:57, 8 October 2010 by Kapatp (Talk | contribs)

Jump to: navigation, search


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), and kdelibs-mingw4 (Bin, Devel). The needed dependencies will be included automatically.
  • 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/
  • 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


  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 (name of the file??) 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