PDA

View Full Version : Packaging & Configuration question...


CyanBlue
01-27-2009, 06:51 PM
Let's say I have ABC.air that calls http://www.testserver.com to get the config.php file that basically is an XML file with the dynamic data... So, I hardcode the http://www.testserver.com/config.php inside the ActionScript so that I can get the value of it... That works fine...

Like the server name says, that's a test server which I use as a staging server or sort... Now, time came for deployment where I only need to call real server to get the configuration file...

It won't be much of problem if I know the domain name/ip address of the real server right now, but I do not know of it yet, and I probably won't be able to know it, and I know they are in the closed environment where they cannot access the Internet... So, I am trying to create a config.txt on the local drive where the SWF file is located so that whoever deploys the app can simply edit the config.txt file and the app will work properly...

That story works if I am doing a web project, but that config.txt will be included inside the ABC.air file and the person who deploys the project will not be able to actually edit the file...

The only thing I can think of is to have the person who deploys the project physically call me and tell me the ip address of the server, I hard code that information and create a new ABC.air file and send it to him somehow... Not a good option nor clean option, but that's the only thing I can think of...

Any suggestion???

Thanks... :)

evride
01-28-2009, 08:41 AM
perhaps you could use the adt with the PHP exec function to create a new AIR file by simply running a "deploy.php" or "install.php" script. The script would get the http_host and write it to a txt file then package it with the other files.

CyanBlue
01-28-2009, 02:42 PM
I guess that means that I basically need to create another AIR file that has hard-coded new ip address... That's a good option if I have to do this regularily, but I don't think this is going to happen many times... Any other idea towards abit more dynamic solution???

corbo950
01-29-2009, 02:06 AM
i have a similar problem im working on which for which i am just making a first run setup page which looks for a file in the airapp storage directory and if it doesnt find it then it runs a set up you could do a similar thing and just have the person put in the IP/domain on the first run and then once it is just there i can just load the data out of the file every time after that

CyanBlue
01-29-2009, 06:51 AM
I thought about that, but I don't think that'll work because the data that I need to fetch from the server is somewhat time sensitive and old data doesn't mean much...