Category: Development

I am building a new site on my server that will be another Mango Blog. Mango is not setup for running multiple instances like it would be nice if it did, but very easily you can at least use the same file base. While this won't save you much on anything other than disk space for the CF Files and for the file cache if your CF server has that turned on; it certainly is nice to have one install location instead of 2 or 3.

To do this you will need to edit only 2 files:

  1. Application.cfm
    • Change the "this.name" setter on line 7ish to something that would be URL driven. In my case I used:
      this.appKey = replaceNoCase(cgi.server_name, "www.", "");
      this.name = "mango_#right(hash(this.appKey),50)#_v1_4";
    • The around line 41 you will find a reference to config.cfm. I've replaced this with: config_#this.appKey#.cfm
  2. admin/setup/Setup.cfm
    • Using the same method as Application.cfm I created an appKey var in the function saveConfig. Around line 268/269 will be two references to config.cfm; again replace these with: config_#this.appKey#.cfm

Now Mango Blog will be using config files based on the server name of the current site. The only secondary change I made was in the config files themselves.

  • Make sure the tablePrefix values are different
  • I adjusted my asset directories to be unique per site: assets/content/{new site name}/

In my environment I rarely see an Adobe Connect recording span 2 different days. However a few weeks ago we ran into an issue where some of the durations for recordings were being displayed as large negative numbers. I assumed at first I of course must have been the one to make this entry level mistake, but it turns out it was Adobe.

While the actual Adobe Connect interface shows the time span of this recording as ruffly 53 minutes, the API reports it as -1386. The math must be coming from someplace different and they are not taking into account that the start day might not be the same as the end date.

Woops

If you have had the fun of deploying the Adobe AIR runtime and applications to hundreds of computers in an organization you will have no doubt stumbled upon at least one or two the annoyances that pop-up. The runner up for most annoying issue in my experience is the uninstaller.

In my development of "sometimes-connected" applications I have always had to write/store data on the local machine. The lacking feature of the built in uninstaller is the complete inability to remove this data. In my environment I needed to be able to have a solid roll-back plan of a piece of software; this unsuprisingly includes any downloaded content.

To solve my delema I wrote a VBScript file to perform the uninstallation. Similar to my installation process I wrote an install wrapper with Install Jammer. I did it this way to allow for easier "distribution" via SMS. I will highlight a few steps here and provide the full script at the end of the post. This script is obviously meant for Windows only and should work on windows XP, Vista and Windows 7. I have yet to have to distribute an app to anything other than a windows box.

First I grab the installer ID from the install path.Set wmiObj = CreateObject("Scripting.FileSystemObject")
Set oTS = wmiObj.OpenTextFile("{ ** AIR APP INSTALL PATH ** }\META-INF\AIR\publisherid")
publisherid = oTS.ReadAll

Then I get the uninstall executable path/arguments.Set wmiObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
 
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ ** AIR APP ID NAME ** }." & publisherid
strValueName = "UninstallString"

wmiObj.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

I then run the uninstaller: Set wmiObj = WScript.CreateObject ("WScript.Shell")
wmiObj.run strValue & " /quiet /qn"

Lastly I remove all leftover files:Set wmiObj = CreateObject("Scripting.FileSystemObject")
Set subFolders = wmiObj.GetFolder("C:\Documents and Settings").SubFolders

For Each folder in subFolders
    If wmiObj.FolderExists("C:\Documents and Settings\" & folder.name & "\Application Data{ ** AIR APP ID NAME ** }." + publisherid) Then
        'StdOut.WriteLine "Delete: " & "C:\Documents and Settings\" & folder.name & "\Application Data\{ ** AIR APP ID NAME ** }." + publisherid
        wmiObj.DeleteFolder("C:\Documents and Settings\" & folder.name & "\Application Data\{ ** AIR APP ID NAME ** }." + publisherid)
    End If
Next

 

Download My Full Example Script

For months I've thought about the power of virtual machines. I use them all the time now for production and staging servers and in the past I've used them for QA purposes in a lab. However I have never run a VM instance on my own box.

Recently I purchased a VMWare Workstation 6.5 license on the cheap and on a re-wipe of my laptop decided to put it into use. I now have multiple XP VMs, a Win Server and an OpenSUSE distro. I am now able to have multiple server setup options at my fingertips with ease.

Setup
After several setup attempts I think I have found a great mix.

  1. All of my development tools and code are located on my real machine.
  2. All of my services are located on a VM
  3. All of my services via UNC paths call on files from the HOST machine.
    • This allows me to have multiple servers from multiple VMs reference [easily] the same code set.


Things To Pay Attention To

  1. Setting up the networking can be difficult the first time, but it really is easy. I choose to run everything in NAT mode; just make sure your firewall settings are all correct. I've also made all of my Windows machines part of the same workgroup to make some file browsing easier.
  2. Permissions: In my case I created a VMUser in my VMs that was an admin/root and on my main box created that same user. I made sure VMUser had read/write too all of the relevant files. I then made sure all of my services were running as that user.
  3. Flex / Flash Development and Debugging: Because you will be launching your debugging on an IP such as 192.168.248.x instead of 127.0.0.1 your Flex Builder will be unable to attache to the debug tool from the browser. When you launch your flash/flex app right click on the flash app area. When you click you will see a menu item "Debugger"; click it. You will get the following pop-up. When you do change the selected option from localhost to other machine and enter 127.0.0.1. Viola, your debugger will now attache!


So far my experience is extremly positive. I recomend a minimum of 4 gigs; this is what I currently have and I would want no less. My next laptop will definetly have either 6 or 8 gigs to allow me to run multiples at the same time, or maybe even make a VM my full time editing area. VMs can do multi-monitor BTW! I would love to have my base OS be basically naked and be able to more easily do snapshots and go backwards in time. For me, setting up all the servers takes the most time. Now I can just backup my VMs and on a future wipe of my box, literally be up and running in say an hour instead of 5 or 6.

I Updated yesterday from an early release of Windows 7 to the retail release doing a complete wipe of my computer. After installing Flex Builder 3 I tried to do some work, yet every time I launched the program Windows 7 alerted me that I was running a program with an unknown publisher. After hitting my self in the head I released that unlike my regular Eclipse environment, Flex Builder was not using my VM but the one that is packaged. This packaged version is NOT signed.

For some reason this worked fine before; but now, not so much. Setting the [-vm c:\pathto\javaw.exe] in the eclipse.ini did not work, but changing the shortcut did work. Any insite into this is welcome!

So in short, on windows 7, force your VM to a legit installed JRE to get this pop-up message to go away if your getting it! The packaged one is not in favor with Windows 7 security!