wiki:WindowsInstaller

OpenSC Windows installer

The purpose of the OpenSC installer is to distribute pre-built binary components of OpenSC and sub-projects to the end-user computer, manage simple configuration entries (like required registry keys) and removal of the components.

The contents of the package is:

  • OpenSC core (and dependencies):
    • OpenSSL
    • zlib

Possible installer steps / Windows environment description

  • The default installation location is C:\Program Files\Opensc Project\OpenSC or equivalent.
    • Only *.exe, *.profile and opensc.conf files are installed to the installation directory. To make applications like Firefox find the .dll dependancies, *.dll are installed to C:\Windows\system32 or equivalent.
  • Registry keys that OpenSC can use:
    • OpenSC: common key "Software\\OpenSC Project\\OpenSC" (names are case-preserved, but not case-sensitive)
      • ConfigFile - path to OpenSC config, searched from HKCU and HKLM, HKLM set to C:\Program Files\OpenSC Project\opensc.conf on install
      • ProfileDir - path to OpenSC PKCS#15 initialization profiles, searched from HKCU and HKLM, HKLM set to C:\Program Files\OpenSC Project\OpenSC\profiles on install
    • pkcs11-spy: common key "Software\\OpenSC Project\\PKCS11-Spy"
      • Module - path to the real PKCS#11 module to load, searched from HKLM, HKCU
      • Output - path to the log output file, searched from HKLM, HKCU

Open questions

  • TODO-s on this page.
  • What kind of documentation should be provided with the installer package?
  • How to harmonize the versioning of OpenSC and sub-projects.
  • Deal with locked files on installation (reboot-after-install) and uninstall (remove-after-reboot)

Download

Build instructions (Windows)

  • Windows x86 or x64 (tested with Windows XP SP3 x86 and Windows 7 SP1 x64). NB! All packages should be installed with default settings to default locations for the packaged scripts to work!
  • Windows  Platform SDK (contains Visual Studio 2008 compiler)
  • Installed  CNG SDK
  • For building the MSI installer:  WiX toolset 3.6.x (3.6.1629.0 used, installing the Wix36.exe from snapshot directory works)
  • (optional) For building .exe installer:  Inno Setup
  • OpenSSL, either built from source or a pre-built binary from  Shining Light Productions. Build scripts are tuned to the pre-built package.
  •  zlib
    • Unpack to c:\zlib-1.2.5 and compile from Platform SDK command prompt
      • x86: SetEnv.cmd /x86 /Release and nmake /f win32\Makefile.msc LOC="-DASMV -DASMINF" OBJA="inffas32.obj match686.obj" zlib.lib
      • x64: SetEnv.cmd /x64 /Release and nmake /f win32\Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -I." OBJA="inffasx64.obj gvmat64.obj inffas8664.obj" zlib.lib
  • If building from SourceCode repository and not from a snapshot targzip:
    •  MinGW/MSYS (install the basic development environment, the last option in the list) for autoconf/automake
    •  pkg.m4 from pkg-config to be placed into c:\mingw\share\aclocal. If still encountering problems on ./configure time, also put pkg.m4 to c:\mingw\share\aclocal-1.11
  • If building from Github, Git for Windows
  • Check out the build snippets on NightlyBuilds

Build instructions (Linux)

The following has been done on Ubuntu 10.10, x86_64

  • Building the .exe installer requires Mingw32 (mingw32-runtime >= 3.15.2) and Wine (for running Inno Setup)
    $ sudo apt-get install wine mingw32 docbook-xsl autoconf automake subversion libtool libpcsclite-dev patch nsis
    
  • You'll need Inno Setup, so fetch and install it (with defaults)
    $ wget http://www.jrsoftware.org/download.php/is.exe
    $ wine is.exe
    
  • Check out OpenSC:
    $ git clone git://www.opensc-project.org/OpenSC.git
    $ cd OpenSC
    
  • Prepare the repository checkout:
    $ ./bootstrap && ./configure --disable-doc
    
  • Build the installer, first building OpenSC:
    $ ./win32/installer_from_build.sh
     # build log removed
    Successful compile (2.170 sec). Resulting Setup program filename is:
    Z:\home\martin\OpenSC\win32\Output\OpenSC-0.12.0.exe
    
    real	5m53.208s
    user	5m4.780s
    sys	1m21.990s
    
    
  • Use the installer .exe from win32/Output/OpenSC-0.12.0.exe

Attachments