Skip to content

Windows Offline Installer 1580

kavithaRajagopalan edited this page Mar 13, 2013 · 12 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

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

Create the Installer

  • Install the following for creating the package:
    • RailsInstaller
    • Windows Imaging Component (wic_x86_enu.exe) (only for XP)
    • DotNet Framework (4.0 for XP, 4.5 for Vista and above)
    • Java Development Kit
    • WiX
  • 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"
  • Update RubyGems version
gem install rubygems-update -v 1.8.25
update_rubygems
  • Download RapidFTR code:
git clone https://github.com/rapidftr/RapidFTR.git
cd RapidFTR
  • Download the gems:
del Gemfile.lock
bundle install --path=vendor\bundle
  • Zip the entire codebase into one file:
bundle exec rake windows:package
  • Generate the package using WiX:
set PATH=%PATH%;"C:\Program Files\WiX Toolset v3.7\bin"
cd lib\tasks\windows
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".

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 lib\tasks\RapidFTR.msi which was generated in the second step

In the Target Windows NetBook

  • First install all the external software one by one
  • 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
Clone this wiki locally