Skip to content

Windows Offline Installer 1580

rdsubhas edited this page Apr 30, 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)

Creating the Installer

  • To create the installer, you must have an active internet connection
  • Download and install all the software specified in the Footnotes
  • 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 into C:\RapidFTR. NOTE: The installer will not be generated if you place this in any other drive.
C:
cd \
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/bundle/ruby/1.8/
gem install bundler -v 1.2.5 --install-dir=vendor/windows/bundle/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 EXCEPT WiX
  • Copy RapidFTR.msi which was generated in the second step

In the Target Windows NetBook

  • Install all the software EXCEPT WiX 3.7 (WiX is only for generating the installer, not required during the actual installation)
  • 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

NOTE: WiX 3.7 is required only for generating the installer. Its not required when installing in the NetBook.

  • 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)
  • NodeJS - Required for Javascript compilation
  • 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