SCCM Toad 12 Upgrade Package with AutoIt Script

Here is an old script I wrote last year to upgrade our Toad for oracle from 11 to 12. It is certainly one of the most complex package I pushed.

When you download the original Toad for oracle package, it has several small msi packages, if you use the official batch file to install, actually it won’t work well with SCCM. most of the time SCCM only execute 3 msi files under batch script. So I have to use AuotIt to script it. Plus, for the license issue, you have to copy license.xml file to  AppData folder, and import the registry settings.

Here comes the issue, as the registry settings needs to run as local user, if you use SCCM to run as SYSTEM, the license registration won’t work. Luckily that we give every user local admin rights, so I just use the script to run as current user.

As it is an upgrade package, so I first move the Toad user data in the “11.5_uninstalled” folder, so when the Toad 12 runs for the first time, it will pick up the user settings. and this step has to finish before uninstall Toad 11, otherwise the uninstallation will delete the user setting files.

After copy user data, I use this simple “SilentUnisntall” program to uninstall any Toad in the system.

Then create the license folder to copy license file.

Run msi installers.

and the last step is to import registry settings.

; ————————————
; Toad Upgrade Package
; Rui Qiu
; 09/30/2014
; ————————————
DirMove(‘@AppDataDir&”\Quest Software\Toad for Oracle\11.5\’,’@AppDataDir&”\Quest Softwaree\Toad for Oracle\11.5_uninstalled\’)
RunWait(‘SilentUninstall.exe “Toad”‘,””,@SW_HIDE)
RunWait(‘SilentUninstall.exe “Toad for Oracle”‘,””,@SW_HIDE)
RunWait(‘SilentUninstall.exe “Quest SQL Optimizer”‘,””,@SW_HIDE)
FileCopy(“Dell SQL Optimizer 8.9.0 for Oracle.lnk”,@DesktopDir)
DirCreate(@AppDataDir&”\Quest Software”)
FileCopy(“ProductLicenses.xml”,@AppDataDir&”\Quest Software”)
DirRemove(“C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Quest Software\Toad Data Modeler”,1)
FileDelete(“C:\Users\Public\Desktop\Toad Data Modeler*.lnk”)
RunWait(‘msiexec.exe /i “Dell Toad for Oracle 12.5.msi” /q INSTALLDIR=”C:\Quest Software\Toad for Oracle 12.5\”‘,””,@SW_HIDE)
RunWait(‘msiexec.exe /i “ToadDataModeler_5.2.4.25.msi” /q’,””,@SW_HIDE)
RunWait(‘msiexec.exe /i “QuestSQLOptimizerForOracle_8_9_0_3012_32bit.msi” /q’,””,@SW_HIDE)
Run(“regedit.exe /s QuestKey.reg”)