I am looking to update Sun JRE on some machines from 1.4.02 to 1.5.01. I am using the Vendor supplied MSI's in both instances. I want the orginal MSI to uninstall prior to the new version installing.

I had hoped to create a new program in SMS for v1.5 and create a dependancy on it running an uninstall for 1.4. The problem is when a new user (ie. has never had v1.4 ) has this program advertised to it. As there is nothing to uninstall, Msiexec returns an error to SMS and it then does not deploy the v1.5.

Is there a way of suppressing the error code given to SMS when the uninstall fails (when the application isnt there to uninstall)? I would like to be able to create 1 package rather than a upgrade from 1.4 to 1.5, and then a normal 1.5 install.

I have read that I could use an update table in the MSI but I am unsure whether this is a good idea with vendor supplied MSIs....I know that sometimes editing them can kill them. I am also unsure whether or not this would product an error if the previous MSI was not installed.

Any suggestions would be much appreciated!


0 Comments   [ - ] Hide 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.
Answer this question or Comment on this question for clarity


You could use a script rather then do the cmd line sms thing.
Then put logic in ur script or just use error supression, if your feeling lazy.
Then make the script into a package, then make it the preinstall task.

I have a few packages that are set up like this.
Answered 11/23/2005 by: rahvintzu
Orange Senior Belt

Please log in to comment
Thanks Rahvintzu

Any chance you could post one of your scripts as an example?


Answered 11/23/2005 by: aidanbree
Senior Yellow Belt

Please log in to comment
Sorry didnt really read your first post well enough.

You could go down the script path...
Or you could create a custom collection that included client machines that have version 1.4
This collection you then target with uninstall pre action like you said you did.

Then you create a collection with a negative response, those that do not have version 1.4
You then advertise this a straight install with no uninstall pre action.

Let us know if you still want a script example... what did you want bat or vbs?
Answered 11/24/2005 by: rahvintzu
Orange Senior Belt

Please log in to comment
I really want to avoid duplicating packages if possible. I think the only way to do what you suggest would be to do duplicate packages....Am I right? I can only link one MSI to one program within the package?

If this is the case, I would prefer to do things in VBS

Thanks for your help

Answered 11/27/2005 by: aidanbree
Senior Yellow Belt

Please log in to comment
Its not really duplicating packages.... i guess.
You have package 1 -> uninstall version 1.4 (via script or direct msi call, cmd line)
You then have package 2 -> msi jre 1.5

Then you create 2 collections via query:
1) Machine has jre 1.4
2) Machine does not contain jre 1.4

Collection (1) gets then following advertisment assigned to it:
Package (2), then under pre installation activity it get the Package 1 (uninstall).

Collection 2
Advertisment = Package 2 (no pre install activity).

Those machines targeted in collection 1 will not report exit errors as they dont have version 1.4 present.
The very simple way is to blat everything....
Use script to uninstall, tell the script to suppress the errors.
Run this as a presinstallation activity to your package number 2.
Target a massive collection.
By the way do you have a business driver to uninstall verion 1.4, or are you just trying to keep things neat?
As you can run multiple version of JRE, software makes calls to the right version.
Anyway here is quick uninstall script... if you want to go that way... cut and paste below into notepad and name
with a .vbs extension. If you have problem msg me back.. i dont have 1.4 installed so i just cut and paste the installation string
from the package library at appdeploy.

'VBS Example for uninstall of jre version 1.4
On Error Resume Next
'This command supresses any errors, and continues with the next command.

Dim Shell
Set Shell = CreateObject("WScript.Shell")

Shell.Run "MsiExec.exe /x{7148F0A8-6813-11D6-A77B-00B0D0142010} /q",0,True
'This is the same as running from command line, the q makes its silent
' And the true at the end tells the script host to wait till it finishes.
'This is important as you dont want your main package to install while its still uninstalling ;-)
Answered 11/27/2005 by: rahvintzu
Orange Senior Belt

Please log in to comment
rahvintzu is correct - you don't need multiple packages - but then s/he goes on to refer to package 1 and package 2, etc.

So let's be clear - create one package, and in that single package, create 2 "programs" as desired - one chains back to removal, the other does not. Then create 2 collections as rahvintzu describes, and point them to one of the two programs in your single package.

The VBS script approach for removal works fine, but there are a couple of things you should know.

1. ensure that your SMS program calls the script with the "cscript" command, don't just call the vbs directly, because that will by default launch the script with wscript, not cscript. You won't like the result if wscript tries to throw up a messagebox in the course of executing the script in system context with no user logged in.

2. your call to msiexec or any other shell exe within the script may fail if the script is executing in system context with no user logged in, as the path environment may not be fully defined at run-time. I always use fully-qualified path names for this kind of work as in this example:

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FolderExists("C:\WINNT\System32") Then
sLocation = "C:\WINNT\System32\"
sLocation = "C:\WINDOWS\System32\"
End If

Shell.Run sLocation & "msiexec.exe /qn /x{ProdCode}",0,True

Answered 12/01/2005 by: williamp
Orange Belt

Please log in to comment
Hi Aidan

First of all I need to mention that we don't use SMS to deploy our packages but another deployment tool.
However, I really prefer to make the uninstall process within the new .msi (whether it is a repackaged or vendor .msi).
All you need to do in the Upgrade table is to fill in the "{UpgradeCode}" Property of the old app in the UpgradeCode column, "4" into the Attributes column (this ignores errors during uninstallation) and in the ActionProperty column fill in the "{ProductCode}" of the old app.
This will do the trick.

And don't worry about killing the vendor .msi.
As long as you only use Orca to edit those .msi's (instead of Wise or InstallShield or anything else which could really lead to problems) everything is fine.

Hope that helps

Answered 12/02/2005 by: rpfenninger
Second Degree Green Belt

Please log in to comment
Thanks everyone for all the info.....I am going to take a bit of time to work out what is best for me.


Answered 12/05/2005 by: aidanbree
Senior Yellow Belt

Please log in to comment