(imported comment written by brolly3391)
Hello Sitaram,
Regarding #1. Often you can find the command for the uninstall of an existing application in the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{AC76BA86-0000-7EC8-7489-000000000605}
displayname = Adobe Acrobat and Reader 6.0.5 Update
uninstallString = MsiExec.exe /I{AC76BA86-0000-7EC8-7489-000000000605}
When the uninstallString is an MSI string, frequently you will have to change the /I to a /X and add a /qn to make the uninstall silent. If you know all the uninstall strings that might be needed you can line them up in your action script:
wait “{pathname of system folder}\msiexec.exe” /X {{GUID#1} /qn
wait “{pathname of system folder}\msiexec.exe” /X {{GUID#2} /qn
wait “{pathname of system folder}\msiexec.exe” /X {{GUID#3} /qn
Otherwise you will need to perform a relevance lookup on the uninstall key, search for each display name that matches and pull the GUID from the key name. (notice the double { to escape the bracket character in action script)
Well authored MSIs take care of this for you by adding items into the UPGRADE table.
If you must have the application not running to perform your uninstall/upgrade, which is another thing that well authored MSIs take care of for you, then you can investigate passing taskkill commands to stop the task. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/taskkill.mspx?mfr=true
example in action script:
DOS taskkill /fi “imagename eq acrobat.exe” /f /t
Be aware that the user will not get prompted to save their work. This is an “impolite” task kill.
Regarding #2 - the downloaded MSI file will exist temporarily in the BES Client cache. If you want that source to be available for future MSI maintenance/self healing/reinstall then copy it to a known location on the destination machine.
in action script:
dos MD c:\MSICache
delete c:\MSICache\MyMSI.msi
copy __download\MyMSI.msi c:\MSICache\MyMSI.msi
wait “{pathname of system folder}\msiexec.exe” /I c:\MSICache\MyMSI.msi /qb! /l*v c:\MSICache\MyMSI.log
If you have some specific code you are working on, post it here and we will try to help you out.
Cheers,
Brolly