Page 1 of 1

Unintstall old Office before installing new

Posted: 10. Mar 2013, 10:41
by Toolman
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

Re: Unintstall old Office before installing new

Posted: 10. Mar 2013, 11:46
by Toolman
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

Re: Unintstall old Office before installing new

Posted: 11. Mar 2013, 13:19
by Hendrik_Ambrosius
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.

Re: Unintstall old Office before installing new

Posted: 11. Mar 2013, 13:29
by Toolman
Thanks for the answer. But what is the clean approach?
I thought that /U was a right approuch.

Regards,

Sander

Re: Unintstall old Office before installing new

Posted: 11. Mar 2013, 22:05
by Hendrik_Ambrosius
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).