Skip to content

Windows Offline Installer 1580

rdsubhas edited this page Apr 29, 2013 · 31 revisions

In some situations, we may need to install RapidFTR in places where there is no internet connectivity. Hence we need an offline installer package which can then be installed offline via a CD or USB drive.

Technical Decisions

  • We are using WiX Toolset to generate the installer
  • WiX toolset provides helper utilities and APIs on top of the Windows Installer API
    • Normall we would use Visual Studio to develop for Windows Installer
    • WiX can generate installers just using XML files and command line tools, all using the same Windows Installer API
  • We decided against using any proprietary or non-open-source components (like InstallShield or Install4J)

General Workflow:

  • Create the package in a separate, Sys-Admin machine, with full access to internet
  • Copy it to the field in a CD or USB or any other medium
  • Install it on a Field Netbook, which does not have any internet connection

Assumptions

  • Windows XP SP3 and above
  • 32-bit (64 bit is not yet supported by some gems, specially ImageMagick)

In the Sys-Admin machine

First step is to get all the dependencies (like CouchDB, Ruby, etc), and then to create the offline installer package.

Download external dependencies

  • Download the following setup files (refer to footnote at end of this page for download locations):
    • RailsInstaller
    • CouchDB
    • ImageMagick
    • Java Development Kit
    • Google Chrome or Firefox (we don't support Internet Explorer yet)

Copy all these to the CD or USB that you intend to distribute.

Create the Installer

  • To create the installer, you must first install the following software in this order (refer to footnotes at end of this page for download instructions):
    • RailsInstaller
    • Windows Imaging Component (wic_x86_enu.exe) (install this only for Windows XP)
    • DotNet Framework (4.0 for XP, 4.5 for Vista and above)
    • WiX
    • Java Development Kit
    • 7-Zip (make a note where 7za.exe is present)
  • Rest of the steps are done in a command prompt
  • Optional Make sure that third-party gem documentations are not installed, since they take a long time. Some of the "echo" commands may fail, but don't worry, its enough if one of these commands succeeds, and anyways this is an optional step that reduces your download time and doesn't affect the installer:
echo gem: --no-ri --no-rdoc > "C:\Documents and Settings\All Users\gemrc"
echo gem: --no-ri --no-rdoc > "C:\Documents and Settings\All Users\Application Data\gemrc"
echo gem: --no-ri --no-rdoc > "C:\gemrc"
echo gem: --no-ri --no-rdoc > "C:\Program Files\gemrc"
echo gem: --no-ri --no-rdoc > "C:\ProgramData\gemrc"
  • Download RapidFTR code:
git clone https://github.com/rapidftr/RapidFTR.git
cd RapidFTR
  • Update RubyGems version
gem install rubygems-update -v 1.8.25
update_rubygems
gem install bundler -v 1.2.5
  • Vendorize the gems for packing into the installer:
del Gemfile.lock
bundle install --path=vendor/bundle
gem install rubygems-update -v 1.8.25 --install-dir=vendor/windows/ruby/1.8/
gem install bundler -v 1.2.5 --install-dir=vendor/windows/ruby/1.8/
  • Compile the assets (NOTE: this may take quite some time)
bundle exec rake app:assets_precompile
  • Copy 7za.exe from the 7-Zip software into "lib\tasks\windows"
copy <path-to-7za.exe> lib\tasks\windows\
  • Zip the entire codebase into one file:
lib\tasks\windows\7za.exe a -tzip lib\tasks\windows\Codebase.zip .\ -xr!.git -xr!spec -xr!test -xr!features -xr!capybara_features -xr!jmeter -xr!lib\tasks\windows -xr!log -xr!tmp
  • Generate the package using WiX:
cd lib\tasks\windows
set PATH=%PATH%;"C:\Program Files\WiX Toolset v3.7\bin"
candle -ext WixUtilExtension RapidFTR.wxs
light  -ext WixUtilExtension -ext WixUIExtension RapidFTR.wixobj

The last step may throw some warnings, ignore them as long as everything says "warning".

  • Now the installer is generated! It is available at:
lib\tasks\windows\RapidFTR.msi

Debugging the Installer

  • Run:
msiexec /i RapidFTR.msi /l*v Log.txt
  • This will generate a file called Log.txt which will contain troubleshooting information

Copying to a CD or USB

Once the dependencies are downloaded and the installer package is created, they can now be copied over to any medium for distribution.

  • Copy all the setup files that were downloaded in the first step
  • Copy RapidFTR.msi which was generated in the second step

In the Target Windows NetBook

  • First install the following software:
    • RailsInstaller
    • CouchDB
    • ImageMagick
    • Windows Imaging Component (required only for Windows XP)
    • DotNet Framework
    • Java Development Kit
    • Google Chrome or Firefox
  • Finally install RapidFTR.msi
  • During the first installation - you will be prompted if you have a CouchDB username/password. Say no - and it will create a default CouchDB username and password
  • During subsequent installations, say "yes" and enter the CouchDB username/password

FootNote: Software Download Instructions

  • RailsInstaller - IMPORTANT: Download the Windows Ruby 1.8 version
  • CouchDB - Download the 1.2.1 Windows version
  • ImageMagick - Download the static, x86 release (e.g. ImageMagick-x.y.z-Q16-x86-static.exe)
  • DotNet Framework (4.0 for XP SP3, 4.5 for Vista and above)
  • Java Development Kit - Download the JDK release, not the JRE
  • Windows Imaging Component - required only for Windows XP, download "wic_x86_enu.exe"
  • WiX 3.7 - The Installer toolset
  • 7-Zip - Download the 7-Zip Command Line Version, and extract it. There will be a file called "7za.exe" which is the only file that we need. Make a note of where this 7za.exe is present, we will be needing it
  • Google Chrome
  • Firefox
  • Either Google Chrome or Firefox required since we don't support Internet Explorer
Clone this wiki locally