Employee Experience

Using the ThinApp SDK to Apply an AppSync Update

Posted by Dean Flaming

Recently I was asked if the ThinApp SDK can be utilized to force an AppSync update on a ThinApp Package. More importantly, some customers have wanted to know if it was possible to change the AppSync URL on the fly.

So….I thought I'd share this script. 🙂

Very simply, this VBScript uses the ThinApp SDK to attach to the original package and conduct an AppSync Update to it with a specified "newer" package.

This ONLY requires a couple of things…

  1. THINAPPSDK.DLL is registered on the system where the script is executed.
  2. The old ThinApp Package (TAOldPackage) is accessible to the system/user running the script.
  3. The new ThinApp Package URL (TANewPackageURL) is accessible to the system/user running the script.
  4. This code should be executed natively. In order for it to execute the AppSync update, the old package (TAOldPackage) must be unlocked (i.e. Not running). Technically one could put it into a script within a ThinApp package but it would have to execute the AppSync function upon another package, not itself.
'=================================================
' Set Environment Variables
'=================================================
Set TAManagement = CreateObject("ThinApp.Management")
Dim AppSyncPkg
TAOldPackage = "C:\Temp\AppSync\Mozilla Firefox.exe"
TANewPackageURL = "file:///C:/temp/appsync/304.exe"
AppSyncUpdate TAOldPackage, TANewPackageURL
Function AppSyncUpdate (TAOldPackage, TANewPackageURL)
On Error Resume Next
'=================================================
' Declare the ThinApp Package/File and open
'=================================================
Set AppSyncPkg = TAManagement.OpenPackage (TAOldPackage)
'=================================================
' Attach to the package and do an AppSync Update
'=================================================
Sync = AppSyncPkg.AppSync (True, LCase(TANewPackageURL))
End Function

Ohh….and none of the ThinApp packages need AppSync configured prior to this. It just works. 😉