Viewing by month: February 2010

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