7 Replies Latest reply on Jun 8, 2010 11:57 AM by KevinMacDonald

    Installing a LARGE AIR application

    KevinMacDonald

      Hello,
      I am attempting to create an installer for Windows that installs the AIR runtime, our application, and all the content required such that any user can log in and use the application. Our application is an educational tool for autistic children, and will be installed in lab environments in schools.
      Our AIR application by itself is not large - about 5MB. However, it relies upon about 600MB of external assets. These include various forms of media: images, audio clips, SWFs etc. If I try to bundle all of this into a single AIR file using FlashBuilder 4, FlashBuilder dies due to lack of memory to the JVM. I have tried to increase memory to the JVM, but even given the maximum it still does not work. I then attempted to package and sign the AIR file using the command line tools. That appears to work, however that operation results in a bloated AIR file that is over 1GB in size, almost double the size of the content packaged into it. If I attempt to use the sidecar installer provided by Adobe to install this AIR file the installer dies. Further investigation shows that others have hit this same size limitation with AIR files, but there is no resolution in site to this problem.
      Since it seemed impossible to package the entire application into a single AIR file my next attempt was to keep the content separate from the AIR application. I have experimented with Installshield, but have found no way to chain together the sidecar installer MSI with another MSI that installs the content to the same location. I could install the AIR application, and then let the application itself finish the installation by copying the content to app-storage://, but then the application is only usable by the user who installed it. In a lab environment in a school this doesn't work, because typically the person who is installing the application is an administrator, not the end user. app-storage:// resides under a user's directory, not in a shared location. The application is unable to copy files to the app:// location due to the security model of AIR.
      I know that I can do a silent install from the command line using the sidecar installer, but I haven't found a way to chain this together with another MSI that installs the content. It could be that I am too limited by what Installshield Express offers. I am now attempting to use NSIS.
      Any advice anyone may have on how to do this is very appreciated. Surely others have needed to install large media rich AIR applications on Windows. AIR is a great platform for us in many respects, but I must be able to create an easy seamless install process for end users. Our product will be going into use over the next 6 months by over 1000 users, and that number will grow quickly. I would be willing to pay for a support incident from Adobe if that is warranted.
      Thanks
      Kevin MacDonald

        • 1. Re: Installing a LARGE AIR application
          KevinMacDonald Level 1

          After much gnashing of teeth I I came up with what appears to be a workable solution. I am posting my solution here for the benefit of others. I was able to use NSIS to create an installer that first installs my AIR application via Adobe silent install feature (http://help.adobe.com/en_US/AIR/1.5/air_runtime_redist/air_runtime_redist.pdf), and then proceeds to install the content in the same folder. The end result is an application that should work for all users and is a reasonably seamless installation experience . The only downside is that you wind up with a total of 3 new items in the Programs & Features control panel: one for Adobe AIR, one for the NSIS installer, and one for the AIR application. The uninstaller only removes the NSIS installer, but that zaps all the content off the disk so it's not terrible. Another little gotcha is that the install folder in this script needs to match the folder in the descriptor file of the AIR application, because everything needs to wind up in the same folder.

           

          This also assumes you have permission from Adobe to redistribute the AIR runtime.

           

          My NSIS script is below.

           

          ; Script generated by the HM NIS Edit Script Wizard.

           

          ; HM NIS Edit Wizard helper defines

          !define PRODUCT_NAME "My Product Install Kit"

          !define PRODUCT_VERSION "2.0"

          !define PRODUCT_PUBLISHER "mycompany"

          !define PRODUCT_WEB_SITE "http://www.mycompany.com"

          !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Adobe AIR Application Installer.exe"

          !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"

          !define PRODUCT_UNINST_ROOT_KEY "HKLM"

           

          ; MUI 1.67 compatible ------

          !include "MUI.nsh"

           

          ; MUI Settings

          !define MUI_ABORTWARNING

          !define MUI_ICON "..\..\..\..\..\__staging\InstallerResources\TT.ico"

          !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"

           

          ; Welcome page

          ; License page

          !insertmacro MUI_PAGE_LICENSE "..\..\..\..\..\__staging\InstallerResources\License.txt"

          ; Directory page

          !insertmacro MUI_PAGE_DIRECTORY

          ; Instfiles page

          !insertmacro MUI_PAGE_INSTFILES

          ; Finish page

          ; NOTE: This provides an option to run the AIR application. This depends upon the Client.air file creating this executable. It doesn't get created by this installer.

          ;       Also, The directory 'My Product 2.0' shown anywhere in this script must match the installation directory created by Client.air or nothing will be in the right spot.

          !define MUI_FINISHPAGE_RUN "$INSTDIR\My Product 2.0\My Product 2.0.exe"

          !insertmacro MUI_PAGE_FINISH

           

          ; Uninstaller pages

          !insertmacro MUI_UNPAGE_INSTFILES

           

          ; Language files

          !insertmacro MUI_LANGUAGE "English"

           

          ; MUI end ------

           

          Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"

          OutFile "Setup.exe"

          InstallDir "$PROGRAMFILES\mycompany"

          InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""

          ShowInstDetails show

          ShowUnInstDetails show

           

          var removePreviousInstall

           

          Section "MainSection" SEC01

           

            StrCpy $removePreviousInstall "A previously installed version of My Product 2.0 has been detected at $INSTDIR\My Product 2.0 that must be un-installed before proceeding. Please go to Control Panel --> Programs and Features and fully un-install any mycompany components. Also, make sure that this folder is deleted. Then, you may attempt to re-install. The installer will quit now."

           

            SetOutPath "$APPDATA\mycompanyAIRInstaller"

            SetOverwrite try

            File /r "..\..\..\..\..\__staging\mycompanyAIRInstaller\*.*"

           

            ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe AIR" "DisplayVersion"

            IfErrors installAIRRuntime

            Goto installAIRFile

           

            installAIRRuntime:

            MessageBox MB_OK "NOTE: The Adobe AIR Runtime will now be installed. Please accept the AIR license agreement in the following dialog and allow the installation to complete."

            ExecWait '"$APPDATA\mycompanyAIRInstaller\AdobeAIRInstaller.exe"' $0

            ${If} $0 != '0'

              MessageBox MB_OK|MB_ICONSTOP 'Adobe AIR Installer returned error code ("$0"). Adobe AIR must be installed for this installation to complete.'

              Quit

            ${EndIf}

           

            installAIRFile:

           

            ;Check for existence of a previous installation

            IfFileExists "$INSTDIR\My Product 2.0" ExistingInstallDetected NoExistingInstallDetected

            ExistingInstallDetected:

               MessageBox MB_OK $removePreviousInstall

               Quit

            NoExistingInstallDetected:

           

          ;  MessageBox MB_OK "Installing Adobe AIR Runtime and Application via silent installation"

           

            ExecWait '"$APPDATA\mycompanyAIRInstaller\Adobe AIR\Versions\1.0\Adobe AIR Application Installer.exe" -silent -eulaAccepted -location "$INSTDIR" -desktopShortcut -programMenu "$APPDATA\mycompanyAIRInstaller\Client.air"' $0

            ${Switch} $0

            ${Case} '0'

              ${Break}

            ${Case} '1'

              MessageBox MB_OK 'A restart is required to complete this installation'

              ${Break}

            ${Case} '3'

              MessageBox MB_OK 'The Adobe AIR runtime was not found. Please try fulling un-installing any intalled components and attempt to re-install.'

              ${Break}

            ${Case} '4'

              MessageBox MB_OK 'Failed to load the Adobe AIR runtime. Please try fulling un-installing any intalled components and attempt to re-install.'

              ${Break}

            ${Case} '7'

            ${Case} '9'

              MessageBox MB_OK $removePreviousInstall

              Quit

              ${Break}

            ${Default}

              MessageBox MB_OK 'Unknown error ("$0") installing the Adobe AIR runtime. Please try fully un-installing any installed components and attempt to re-install.'

              ${Break}

            ${EndSwitch}

           

            SetOutPath "$INSTDIR\My Product 2.0\assets\abagale"

            File /r "..\..\..\..\..\__staging\Client_abagale\*.*"

           

          SectionEnd

           

          Section -AdditionalIcons

            SetOutPath $INSTDIR

          ;  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"

            CreateShortCut "$SMPROGRAMS\mycompany\Uninstall My Product 2.0.lnk" "$INSTDIR\Uninstall My Product 2.0.exe"

          SectionEnd

           

          Section -Post

            WriteUninstaller "$INSTDIR\Uninstall My Product 2.0.exe"

            WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$APPDATA\Adobe AIR\Versions\1.0\Adobe AIR Application Installer.exe"

            WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"

            WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"

            WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$APPDATA\Adobe AIR\Versions\1.0\Adobe AIR Application Installer.exe"

            WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"

            WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"

            WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"

          SectionEnd

           

           

          Function un.onUninstSuccess

            HideWindow

            MessageBox MB_ICONINFORMATION|MB_OK "My Product 2.0 Install Kit was successfully removed from your computer."

          FunctionEnd

           

          Function un.onInit

            MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove My Product 2.0?" IDYES +2

            Abort

          FunctionEnd

           

          Section Uninstall

            RMDir /r "$INSTDIR\My Product 2.0\*.*"

            RMDir /r "$APPDATA\mycompanyAIRInstaller\*.*"

           

            ;Deletes the link put there by the AIR app installer.

            Delete "$SMPROGRAMS\mycompany\My Product 2.0.lnk"

           

            DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"

            DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"

            SetAutoClose true

          SectionEnd

          • 2. Re: Installing a LARGE AIR application
            Gregor.Kiddie Level 2

            Do you have to have all the assets locally? Can they not come over the network at all?

            • 3. Re: Installing a LARGE AIR application
              KevinMacDonald Level 1

              Our application is about 700MB in size. It is an educational program for

              autistic children. Autistic (and other special needs) children cannot

              tolerate any lag time  waiting for images or voice-overs or animations.

              Also, schools are typically underfunded and have poor equipment and internet

              connectivity. So, unfortunately no.

               

              Was Adobe AIR designed with the intention that applications should not

              exceed a certain size? If so, I wish that was made very clear before I

              steered our company down this path. RIA stands for RICH Internet

              Application.

              • 4. Re: Installing a LARGE AIR application
                Gregor.Kiddie Level 2

                "RIA stands for RICH Internet Application"

                 

                But you refuse to use the Internet bit of it...

                 

                I didn't actually suggest the Internet however, I suggested the network. Rather than installing 700 megs of application on every machine that it's required on, and having a massive update process whenever an asset is updated, why not have the assets on a shared drive and have the much smaller application target that instead? Load time is minimal, certainly not noticeable to a SEN pupil, and with some good caching techniques, that can be reduced to zero on later calls to the same asset.

                 

                The install is less painful, upgrades are less painful, performance is still acceptable.

                • 5. Re: Installing a LARGE AIR application
                  KevinMacDonald Level 1

                  You raise some interesting points. I appreciate you taking the time. Let me

                  see if I can address them..

                   

                  It is my hope that we will in fact be able to support a single install on a

                  shared drive. I think an AIR application will support that, but I haven't

                  researched it. Whether or not a school does it is really up to their level

                  of sophistication. In many schools the 'IT' person is an overworked

                  kindergarten teacher who has some computer smarts. In the many school

                  districts where we have installed our current version only one district has

                  expressed a desire to use a shared drive. They are accustomed to installing

                  software on each machine. Our application is also for consumers. For

                  consumers we hope to support a downloadable solution where they can install

                  the AIR application quickly, and then the application will proceed to inform

                  the user that a large download needs to happen. An hour or two later they

                  have all the content and can begin using it. I believe this is a familiar

                  model with online games. No matter what, we have a big chunk of content that

                  needs to be on the client machine before they can use it.

                   

                  Regarding how we put the 'I' in RIA, our application makes heavy use of web

                  services for the purpose of capturing and synchronizing student data so that

                  a student can use the software at home or school or Grandma's house, or

                  wherever. We also do aggregate reporting on that data so that we can prove

                  efficacy via scientific studies and show progress to parents and teachers.

                   

                  But all of this is moot. My reason for starting this thread is the pain I

                  experienced coming up with a straightforward installer for a 700MB AIR

                  application. AIR falls over. No solution in sight. Am I wrong in saying

                  this?

                  • 6. Re: Installing a LARGE AIR application
                    Gregor.Kiddie Level 2

                    "But all of this is moot. My reason for starting this thread is the pain I experienced coming up with a straightforward installer for a 700MB AIR application. AIR falls over. No solution in sight. Am I wrong in saying this?"

                     

                    No, but then I'd class 700MB as an excessively large AIR app for all the reasons I gave before!

                     

                    I'd still suggest splitting out the assets from the code, just for your own sanity when maintaining this, and for the sake of your clients bandwidth...

                     

                    How about a native installer which installs the air file (which just contains the code) and the assets alongside it? Still distributable as a single download, but means you can update a meg of application rather than 700 megs each time...

                    • 7. Re: Installing a LARGE AIR application
                      KevinMacDonald Level 1

                      Splitting out the AIR app from the content is exactly what I did. Your

                      suggestion regarding using a native installer is also exactly what I did.

                      See the 2nd item in this thread showing my complete solution using NSIS.

                       

                      If 700MB is excessively large for an AIR app then Adobe should spell out such limitations.