JRE package that uninstalls previous versions
I have a task from my management. I need to make a package for 1.4.2_19 installation that removes all previous versions (or another versions at all) of JRE. I can do it only via .msi and Orca with transforms file (.mst). Not allowed to use any scripts or manual actions. This is my manager's requirement. After deploying of this package only one version of JRE should be in registry and in uninstall programms menu. Also it should be only one version in Programm files. Package should be assigned via group policy. Actually I've never made packages before and to not ask this question I've tried to search the answer in Internet and in this forum too. At the moment I do not know is this possible to complete the task. I found that some people tried to do it but has the same result as me. What have I done? Please take a look.
I've got original .msi. Then opened it with Orca and created a new transform. Then I've set several options.
Under Property:
AUTOUPDATECHECK 0
IEXPLORER 1
JAVAUPDATE 0
MOZILLA 1
WEBSTARTICON 0
SYSTRAY 0
To disable JQS service:
Added a row to InstallExecuteSequence table with values
ForceUninstallJQS NOT Installed 3184
Added a row to CustomAction table with values:
ForceUninstallJQS 3089 regutils.dll MSIUninstallJQS
To remove Java Start desktop icon and start menu group I have removed two keys under InstallExecuteSequence:
CreateJavaWSDesktopIcon
CreateJavaWSStartMenuIcon
Then I've made customizations that as I thought may uninstall previous versions
Under Property:
SecureCustomProperties INSTALLINTL;JRE400;JRE401;JRE402;JRE403;JRE404;JRE405;JRE406;JRE407;JRE408;JRE409;JRE410;JRE411;JRE412;JRE413;JRE414;JRE415;JRE416;JRE417;JRE418
Under Upgrade I've changed UpgradeCode, Language, Attribute, ActionProperty
{7148F0A8-6813-11D6-A77B-00B0D0142000} 1033 256 JRE400
{7148F0A8-6813-11D6-A77B-00B0D0142010} 1033 256 JRE401
{7148F0A8-6813-11D6-A77B-00B0D0142020} 1033 256 JRE402
{7148F0A8-6813-11D6-A77B-00B0D0142030} 1033 256 JRE403
{7148F0A8-6813-11D6-A77B-00B0D0142040} 1033 256 JRE404
{7148F0A8-6813-11D6-A77B-00B0D0142050} 1033 256 JRE405
{7148F0A8-6813-11D6-A77B-00B0D0142060} 1033 256 JRE406
{7148F0A8-6813-11D6-A77B-00B0D0142070} 1033 256 JRE407
{7148F0A8-6813-11D6-A77B-00B0D0142080} 1033 256 JRE408
{7148F0A8-6813-11D6-A77B-00B0D0142090} 1033 256 JRE409
{7148F0A8-6813-11D6-A77B-00B0D0142100} 1033 256 JRE410
{7148F0A8-6813-11D6-A77B-00B0D0142110} 1033 256 JRE411
{7148F0A8-6813-11D6-A77B-00B0D0142120} 1033 256 JRE412
{7148F0A8-6813-11D6-A77B-00B0D0142130} 1033 256 JRE413
{7148F0A8-6813-11D6-A77B-00B0D0142140} 1033 256 JRE414
{7148F0A8-6813-11D6-A77B-00B0D0142150} 1033 256 JRE415
{7148F0A8-6813-11D6-A77B-00B0D0142160} 1033 256 JRE416
{7148F0A8-6813-11D6-A77B-00B0D0142170} 1033 256 JRE417
{7148F0A8-6813-11D6-A77B-00B0D0142180} 1033 256 JRE418
Also I tried to change Attribute to 1, 4 etc; changed VersionMin, VersionMax and much more different variations. Every time I had the same result. The new version of JRE was installed (java -version did correct answer), the version of JRE was correct in registry but all previous versions still stayed in uninstall menu, registry and programm files. I underline the fact that I cannot delete it via script or manually. Dear colleagues please advise how to complete this task. If it's not possible do you know may I have (and where) an official information that it cannot be done? Thank you beforehand!
I've got original .msi. Then opened it with Orca and created a new transform. Then I've set several options.
Under Property:
AUTOUPDATECHECK 0
IEXPLORER 1
JAVAUPDATE 0
MOZILLA 1
WEBSTARTICON 0
SYSTRAY 0
To disable JQS service:
Added a row to InstallExecuteSequence table with values
ForceUninstallJQS NOT Installed 3184
Added a row to CustomAction table with values:
ForceUninstallJQS 3089 regutils.dll MSIUninstallJQS
To remove Java Start desktop icon and start menu group I have removed two keys under InstallExecuteSequence:
CreateJavaWSDesktopIcon
CreateJavaWSStartMenuIcon
Then I've made customizations that as I thought may uninstall previous versions
Under Property:
SecureCustomProperties INSTALLINTL;JRE400;JRE401;JRE402;JRE403;JRE404;JRE405;JRE406;JRE407;JRE408;JRE409;JRE410;JRE411;JRE412;JRE413;JRE414;JRE415;JRE416;JRE417;JRE418
Under Upgrade I've changed UpgradeCode, Language, Attribute, ActionProperty
{7148F0A8-6813-11D6-A77B-00B0D0142000} 1033 256 JRE400
{7148F0A8-6813-11D6-A77B-00B0D0142010} 1033 256 JRE401
{7148F0A8-6813-11D6-A77B-00B0D0142020} 1033 256 JRE402
{7148F0A8-6813-11D6-A77B-00B0D0142030} 1033 256 JRE403
{7148F0A8-6813-11D6-A77B-00B0D0142040} 1033 256 JRE404
{7148F0A8-6813-11D6-A77B-00B0D0142050} 1033 256 JRE405
{7148F0A8-6813-11D6-A77B-00B0D0142060} 1033 256 JRE406
{7148F0A8-6813-11D6-A77B-00B0D0142070} 1033 256 JRE407
{7148F0A8-6813-11D6-A77B-00B0D0142080} 1033 256 JRE408
{7148F0A8-6813-11D6-A77B-00B0D0142090} 1033 256 JRE409
{7148F0A8-6813-11D6-A77B-00B0D0142100} 1033 256 JRE410
{7148F0A8-6813-11D6-A77B-00B0D0142110} 1033 256 JRE411
{7148F0A8-6813-11D6-A77B-00B0D0142120} 1033 256 JRE412
{7148F0A8-6813-11D6-A77B-00B0D0142130} 1033 256 JRE413
{7148F0A8-6813-11D6-A77B-00B0D0142140} 1033 256 JRE414
{7148F0A8-6813-11D6-A77B-00B0D0142150} 1033 256 JRE415
{7148F0A8-6813-11D6-A77B-00B0D0142160} 1033 256 JRE416
{7148F0A8-6813-11D6-A77B-00B0D0142170} 1033 256 JRE417
{7148F0A8-6813-11D6-A77B-00B0D0142180} 1033 256 JRE418
Also I tried to change Attribute to 1, 4 etc; changed VersionMin, VersionMax and much more different variations. Every time I had the same result. The new version of JRE was installed (java -version did correct answer), the version of JRE was correct in registry but all previous versions still stayed in uninstall menu, registry and programm files. I underline the fact that I cannot delete it via script or manually. Dear colleagues please advise how to complete this task. If it's not possible do you know may I have (and where) an official information that it cannot be done? Thank you beforehand!
0 Comments
[ + ] Show comments
Answers (10)
Please log in to answer
Posted by:
MSIPackager
14 years ago
Posted by:
xdream
14 years ago
Posted by:
anonymous_9363
14 years ago
It may not be the most "politically correct" solution but arguably the most efficient way would be to use the RemoveFile and RemoveRegistry tables remove the entire folder structure from the "root" (normally %ProgramFiles%\JavaSoft), registry data (HKLM\Software\JavaSoft) and the installation registry data. The latter branches from HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall, but you'll need to get the ProductCodes for the various versions which may be installed in your estate.
Rob, I suspect that if the manager has made such an edict (and the "Packager's Baseball Bat" thought came to my mind, too), he'll have the nous to check for script in CAs.
Rob, I suspect that if the manager has made such an edict (and the "Packager's Baseball Bat" thought came to my mind, too), he'll have the nous to check for script in CAs.
Posted by:
MSIPackager
14 years ago
As Ian mentioned you can pull the information from the HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall branch (of machines with it installed on) to get the uninstall strings for all the relevant versions.
Then I'd prove these silent uninstall strings work manually in a suitable test environment.
Once you are happy with the you need to wrap up all the uninstall strings in a scrips (wise / vb whatever you like) with the appropriate error checking and logging - then test this script manually.
Once you've got that far you can call the script as a custom action in your MSI - we'll go into that more if you go for this solution. You could then remove all of the SecureCustomProperties you added, along with the Upgrade table lines.
Ian has offered another solution which you could go for but it would be preferable IMO to use the vendor uninstall command lines before you finally install your required version.
Hope this helps.
Cheers,
Rob.
Then I'd prove these silent uninstall strings work manually in a suitable test environment.
Once you are happy with the you need to wrap up all the uninstall strings in a scrips (wise / vb whatever you like) with the appropriate error checking and logging - then test this script manually.
Once you've got that far you can call the script as a custom action in your MSI - we'll go into that more if you go for this solution. You could then remove all of the SecureCustomProperties you added, along with the Upgrade table lines.
Ian has offered another solution which you could go for but it would be preferable IMO to use the vendor uninstall command lines before you finally install your required version.
Hope this helps.
Cheers,
Rob.
Posted by:
xdream
14 years ago
Dear sirs, thanks for your answers! I think what's more appropriate for me - registry cleaning or adding script to .msi. I suppose that script usage will not be allowed by management. I have one more little question. What for does Upgrade table exist in .msi? My manager believes that this option may uninstall software (especially JRE). But I have tested both types of installations and I've got the same results. So I think that adding any strings in Upgrade table is useless. Please answer me. Thanks!
Posted by:
anonymous_9363
14 years ago
Please answer meIf you're going to lead with the chin...try this
Posted by:
xdream
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
MSIPackager
14 years ago
haha lead with the chin I like it.
The upgrade table can indeed be used to uninstall exising MSI's - but as Ian says you should also move the RemoveExistingProducts action further up the sequence in order to do it neatly.
Didn't go into this method too much since you are new to packaging and I think the scripted CA solution would be most straight forward for you.
If you go for the Upgrade table, just concentrate on getting 1 JRE to uninstall properly first - once you've cracked that you can start adding the others in...
Cheers,
Rob.
The upgrade table can indeed be used to uninstall exising MSI's - but as Ian says you should also move the RemoveExistingProducts action further up the sequence in order to do it neatly.
Didn't go into this method too much since you are new to packaging and I think the scripted CA solution would be most straight forward for you.
If you go for the Upgrade table, just concentrate on getting 1 JRE to uninstall properly first - once you've cracked that you can start adding the others in...
Cheers,
Rob.
Posted by:
xdream
14 years ago
VBScab
MSIPackager
thanks for posts. As I said before I'm not a professional in packaging and glad to hear any kind of advice. At the moment I've tried to move RemoveExistingProducts up and down and have no success. Now I understand that Upgrade table method is quite difficult to understand in a short time
MSIPackager
thanks for posts. As I said before I'm not a professional in packaging and glad to hear any kind of advice. At the moment I've tried to move RemoveExistingProducts up and down and have no success. Now I understand that Upgrade table method is quite difficult to understand in a short time
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.