The old package does not contain a package code .Therefore i want a script that first checks if the old version is installed and if so, uninstalls the old package.
After the uninstallation is complete, the script can start the installation of the new version. can any one give me this script.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
We can check if the product is installed or not by looking at HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall for product code of the application.
Answered 12/09/2009 by: Jahnavi
Senior Yellow Belt

Please log in to comment
0
Someone else who expects people to work for nothing...

Besides that, your specification is too light on detail. How far do you want the script to go when checking for installed state? Just a registry entry? Presence of the main EXE? More? Do you have a language requirement, programming-wise, or will a DOS command file suffice?

Lastly, your post belongs in the 'Scripting' forum. A moderator may well move it.
Answered 12/09/2009 by: VBScab
Red Belt

Please log in to comment
0
I have no clue what this guy actually means by "old package does not have package code" but....

set objWScriptShell=CreateObject("wscript.shell")
Set Installer = CreateObject("WindowsInstaller.Installer")
InstallStatus = Installer.ProductState("{PRODUCT-CODE-HERE}")
msgbox (InstallStatus)
If InstallStatus = 5 then
objWScriptShell.Run "msiexec /x {PRODUCT-CODE-HERE} /qb-",0, True
End If
Answered 12/09/2009 by: dreyer
Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity