Unintstall old Office before installing new

Post Reply
Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Unintstall old Office before installing new

Post by Toolman » 10. Mar 2013, 10:41

Hello,

We made 2 packages with the Package Wizard (MSI) for Office 2003 Stnd and Pro.
The installation goes well and the uninstall through the Empirum Management Console goes well.
But we want to check if there is an Office version on the computer and then uninstall that version before installing the other.
So when we install the Pro version it needs to check if there is a Standard and then remove it before installing the Pro.

We've taken the uninstall string of the Pro package and put in the Standard and the uninstall of the Standard and put it into the Pro. This works only half, the Empirum Registry key isn't removed so the inventory now says it has both versions.

We've tried many different syntaxes but we cannot get it working

Code: Select all

[Set:Product]
;Checken if MS Office Pro is installed and then remove it
Del "%MSILogFile%"
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90110413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" | DoesRegKeyExist ("HKLM,SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90110413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" Then "RemovePRO" Else "InstallMSI" EndIf

[RemovePRO]
;If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90110413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" | DoesRegKeyExist ("HKLM,SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90110413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" Then "AbortMSIUnInst" EndIf
If %ErrorLevel% == "3010" Then "RebootRequired" EndIf
-Call MsiExec /X {90110413-6000-11D3-8CFE-0150048383C9} REBOOT=REALLYSUPPRESS /passive /Li "%MSILogFile%"

Del "%MSILogFile%"
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" | DoesRegKeyExist ("HKLM,SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90120413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" Then "RepairMSI" Else "InstallMSI" EndIf

[RepairMSI]
AddMeter -1
Call MsiExec /Fvomus "%SRC%\STD11.MSI"  TRANSFORMS="%SRC%\BRW_Custom.MST" REBOOT=REALLYSUPPRESS ARPSYSTEMCOMPONENT=1 /qr /Li "%MSILogFile%"
If %ErrorLevel% == "3010" Then "RebootRequired" EndIf
If DoesTextInFileExist ("%ReInstSuccessMessage1031%", "%MSILogFile%") == "0" & DoesTextInFileExist ("%ReInstSuccessMessage1031_1%", "%MSILogFile%") == "0" & DoesTextInFileExist ("%ReInstSuccessMessage1033%", "%MSILogFile%") == "0" & DoesTextInFileExist ("%ReInstSuccessMessage1033_1%", "%MSILogFile%") == "0" Then "AbortMSIInst" EndIf
Del "%MSILogFile%"

[InstallMSI]
AddMeter -1
;Call MsiExec /I "%SRC%\STD11.MSI"  TRANSFORMS="%SRC%\BRW_Custom.MST" REBOOT=REALLYSUPPRESS ARPSYSTEMCOMPONENT=1 /qr /Li "%MSILogFile%"
Call MsiExec /I "%SRC%\STD11.MSI"  TRANSFORMS="%SRC%\BRW_Custom.MST" REBOOT=REALLYSUPPRESS ARPSYSTEMCOMPONENT=1 /passive /Li "%MSILogFile%"
If %ErrorLevel% == "3010" Then "RebootRequired" EndIf
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "0" & DoesRegKeyExist ("HKLM,SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90120413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "0" Then "AbortMSIInst" EndIf
Del "%MSILogFile%"

[Set:Uninstall]
-Del "%MSILogFile%"
If DoesRegKeyExist ("HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{90120413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" | DoesRegKeyExist ("HKLM,SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90120413-6000-11D3-8CFE-0150048383C9},UnInstallString") == "1" Then "AbortMSIUnInst" EndIf
If %ErrorLevel% == "3010" Then "RebootRequired" EndIf
;-Call MsiExec /X {90120413-6000-11D3-8CFE-0150048383C9} REBOOT=REALLYSUPPRESS /qr /Li "%MSILogFile%"
-Call MsiExec /X {90120413-6000-11D3-8CFE-0150048383C9} REBOOT=REALLYSUPPRESS /passive /Li "%MSILogFile%"
-AddMeter -1
Does anybody know what we are doeing wrong? We are stuck.

Sander

Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Re: Unintstall old Office before installing new

Post by Toolman » 10. Mar 2013, 11:46

Tried calling the setup.exe with the /U but that didn't do the trick :(

Code: Select all

Call "C:\Program Files\Common Files\Setup32\Setup.exe" "C:\Program Files\Microsoft Office Standard Editie 2003\Install_BRW_Custom\Setup.inf" /S1 /U

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 7962
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: Unintstall old Office before installing new

Post by Hendrik_Ambrosius » 11. Mar 2013, 13:19

This is not really a clean approach but anyway - if you want to get rid of the old Empirum relicts delete the registry keys that come with the Empirum package installation below HKLM\Software.
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

Toolman
Posts: 77
Joined: 14. Feb 2006, 20:35
Contact:

Re: Unintstall old Office before installing new

Post by Toolman » 11. Mar 2013, 13:29

Thanks for the answer. But what is the clean approach?
I thought that /U was a right approuch.

Regards,

Sander

User avatar
Hendrik_Ambrosius
Moderator
Moderator
Posts: 7962
Joined: 13. Dec 2004, 23:10
Location: Adendorf/Lüneburg

Re: Unintstall old Office before installing new

Post by Hendrik_Ambrosius » 11. Mar 2013, 22:05

The clean approach is an uninstallation of the package by setting the distribution option to "uninstall" in the Empirum Console.
You could create assignment groups with both packages assigned (uninstall + install) and add the PCs (e.g. from a filter checking for office installations).
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com

Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.

Post Reply

Return to “Packaging”

Who is online

Users browsing this forum: No registered users and 2 guests