Thursday, October 8, 2009

Bundled Deployment of Adobe AIR applications in- Windows using NSIS (Nullsoft Scriptable Install System) - Two Step Method

“ Nullsoft Scriptable Install System (NSIS) is a script-driven Windows installation system with minimal overhead backed by Nullsoft, the creators of Winamp. NSIS has risen to popularity as a widely used alternative to commercial and proprietary products like InstallShield.
NSIS is released under a combination of free software licenses, primarily the zlib license, thus making NSIS free software “ - wikipedia.org

There are two approaches that we can take.

Bundled Deployment of Adobe AIR applications in Windows using NSIS (Nullsoft Scriptable Install System)
Two Step Method

1.Using the script, we programmatically detect from the registry whether Adobe AIR runtime has been installed.
2.Installs the Adobe runtime if not previously installed and then install the


!define PRODUCT_NAME "My Application 2009"
!define PRODUCT_VERSION "2.1.0"
!define PRODUCT_PUBLISHER "My Group Pty Ltd"
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
Icon "C:\InstallFiles\MyAppIcon.ico"
OutFile "MyAppInstaller.exe"
Section -Prerequisites

SetOutPath "C:\InstallFiles"
SetOverwrite ifnewer
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe AIR" "DisplayVersion"
IfErrors notinst
Goto installProgram
notinst:
MessageBox MB_YESNO "Install Adobe AIR Runtime?" /SD IDYES IDNO endInstall
File "AdobeAIRInstaller.exe"
ExecWait "C:\InstallFiles\AdobeAIRInstaller.exe"
Goto installProgram

installProgram:
MessageBox MB_YESNO "Install My Program?" /SD IDYES IDNO endInstall
File "MyApp.air"
ExecWait '$PROGRAMFILES\Common Files\Adobe AIR\Versions\1.0\Resources\airappinstaller.exe /C:\InstallFiles\MyApp.air'
endInstall:
SectionEnd