Air Installer Build from any directory
I’ve been building an air installation builder in CF… and I ran into some issues with it at first, so I figured I would document some of them here in case someone else ran into the same stuff…
First off, I’ve been using what is right now the latest beta version of ADT, which is part of the Flex 3 SDK.
Now, part of the requirement of my project was that I would be able to place all of the build files for the Air application anywhere on the drive, and compile them from there. I was using CFExecute to run the ADT batch file, and at first was passing all of the arguments into ADT.
Running ADT from the command line worked fine:
/Applications/ColdFusion8/bin/flex3sdk/bin/adt -package -storetype PKCS12 -keystore /Applications/ColdFusion8/bin/flex3sdk/bin/SigningCert.pfx -storepass ****** /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/DesktopPresence.air /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/DesktopPresence-app.xml /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/DesktopPresence.swf /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/assets
Running the same command line from CFExecute gave me no stdout, no error… nothing… and the AIR file was never built:
<cfexecute name=”/Applications/ColdFusion8/bin/flex3sdk/bin/adt” outputfile=”/Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/output.txt” arguments=”-package -storetype PKCS12 -keystore /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/SigningCert.pfx -storepass ****** /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/DesktopPresence.air /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/DesktopPresence-app.xml /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/DesktopPresence.swf /Applications/ColdFusion8/bin/flex3sdk/bin/desktopPresence/assets”></cfexecute>
I found some suggestions online that seemed to say that I could redirect stderr to stdout by appending 2>&1 after the executable… apparently cfexecute does not give you stderr at all… and when i tried to append 2>&1 after the reference to adt… cfexecute was no longer able to find the executable.
So … what I did was, I moved the command line into another batch file, and forced adt to run from the directory that had the build content in it, and was also as a result able to redirect stderr to stdout:
@echo off
cd #pathToResources#
#pathToADT# -package -storetype PKCS12 -keystore SigningCert.pfx -storepass ****** DesktopPresence.air DesktopPresence-app.xml DesktopPresence.swf assets 2>&1
from here, I just used cfexecute to run the bat file:
<cfexecute name=”#pathToResources#cmd.bat” timeout=”10″> </cfexecute>






















Wikinomics: How Mass Collaboration Changes Everything
Adobe Flex 3: Training from the Source
Breaking Out of the Web Browser with Adobe AIR