Seite 1 von 1

How-to uninstall KBs and hide them

Verfasst: 20 Okt 2015, 00:17
von cyberfrk
Hi,

I want to uninstall KB in the clients who are in win7 and hide them with a vbs script. For the moment, I can't uninstall the kb3035583.
When I launch the product from Opsi, he's executing with no error but the KB is still installed on the client. No problem when I execute the *.bat from local hard disk (c:\temp\suppr_majs_win10.bat)

suppr_majs_win10.bat:

Code: Alles auswählen

@echo off
REM openfiles.exe 1>nul 2>&1
REM if not %errorlevel% equ 0 (
REM     Echo Imperatif d executer en tant que administrateur
REM     pause
REM     EXIT 1
REM ) else 
(   

SETLOCAL

REM --- uninstall updates
echo desinstallation des majs ...
echo Suppression KB3083710
start "title" /b /wait wusa.exe /kb:3083710 /uninstall /quiet /norestart
echo  - suivant
echo Effectue.
timeout 5
)
Here is my setup3264.ins:

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.11.5.13"
	comment "On desinstalle les majs pour windows 10 et on les masque"
	ShowBitmap "%ScriptPath%\pas_de_win10.png"
	Message "On desinstalle les majs pour windows 10 et on les masque"
	DosBatch_suppr_majs_win10 /RunElevated /Sysnative

[DosBatch_suppr_majs_win10]
"c:\temp\suppr_majs_win10.bat"

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
	comment "Looks good: setup program gives exitcode zero"
else
	comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
	if ($ExitCode$ = "1605")
		comment "ERROR_UNKNOWN_PRODUCT	1605	This action is only valid for products that are currently installed."
		comment "Uninstall of a not installed product failed - no problem"
	else
		if ($ExitCode$ = "1641")
			comment "looks good: setup program gives exitcode 1641"
			comment "ERROR_SUCCESS_REBOOT_INITIATED	1641	The installer has initiated a restart. This message is indicative of a success."
		else
			if ($ExitCode$ = "3010")
				comment "looks good: setup program gives exitcode 3010"
				comment "ERROR_SUCCESS_REBOOT_REQUIRED	3010	A restart is required to complete the install. This message is indicative of a success."
			else
				logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
				isFatalError
			endif
		endif
	endif
endif
Can you help me?
Thks a lot!

Re: How-to uninstall KBs and hide them

Verfasst: 20 Okt 2015, 01:04
von SisterOfMercy
Uhh, how do you do your updates? Are you on an opsi subscription? If not, you might want to use a wsus server, I find it to be one of those microsoft products that actually work.

Re: How-to uninstall KBs and hide them

Verfasst: 20 Okt 2015, 10:00
von cyberfrk
In effect, Wsus works perfectly. I already use it in other situation but I don't have Windows's servers (and I can't) where I want to deploy Opsi.

Re: How-to uninstall KBs and hide them

Verfasst: 20 Okt 2015, 17:33
von SisterOfMercy
Have you tried it like this:

Code: Alles auswählen

[Actions]
requiredWinstVersion >= "4.11.5.13"
   comment "On desinstalle les majs pour windows 10 et on les masque"
   ShowBitmap "%ScriptPath%\pas_de_win10.png"
   Message "On desinstalle les majs pour windows 10 et on les masque"
   WinBatch_suppr_majs_win10 /RunElevated /Sysnative

[WinBatch_suppr_majs_win10]
"%SystemRoot%\system32\wusa.exe" /kb:3083710 /uninstall /quiet /norestart

[Sub_check_exitcode]
comment "Test for installation success via exit code"
set $ExitCode$ = getLastExitCode
; informations to exit codes see
; http://msdn.microsoft.com/en-us/library/aa372835(VS.85).aspx
; http://msdn.microsoft.com/en-us/library/aa368542.aspx
if ($ExitCode$ = "0")
   comment "Looks good: setup program gives exitcode zero"
else
   comment "Setup program gives a exitcode unequal zero: " + $ExitCode$
   if ($ExitCode$ = "1605")
      comment "ERROR_UNKNOWN_PRODUCT   1605   This action is only valid for products that are currently installed."
      comment "Uninstall of a not installed product failed - no problem"
   else
      if ($ExitCode$ = "1641")
         comment "looks good: setup program gives exitcode 1641"
         comment "ERROR_SUCCESS_REBOOT_INITIATED   1641   The installer has initiated a restart. This message is indicative of a success."
      else
         if ($ExitCode$ = "3010")
            comment "looks good: setup program gives exitcode 3010"
            comment "ERROR_SUCCESS_REBOOT_REQUIRED   3010   A restart is required to complete the install. This message is indicative of a success."
         else
            logError "Fatal: Setup program gives an unknown exitcode unequal zero: " + $ExitCode$
            isFatalError
         endif
      endif
   endif
endif
Or maybe use the full path to the msu, like this:

Code: Alles auswählen

[WinBatch_suppr_majs_win10]
"%SystemRoot%\system32\wusa.exe" /uninstall "%ScriptPath%\files\Windows6.1-KB3083710-x64.msu" /quiet /norestart
edit: whoops, don't use /RunElevated and %ScriptPath% in the same section! ;)
So if you try this change the WinBatch call to WinBatch_suppr_majs_win10 /Sysnative

And maybe look here how to hide updates:
http://superuser.com/questions/722667/h ... ithout-gui