How-to uninstall KBs and hide them

Antworten
cyberfrk
Beiträge: 15
Registriert: 03 Mai 2013, 23:10

How-to uninstall KBs and hide them

Beitrag 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!
Zuletzt geändert von cyberfrk am 20 Okt 2015, 22:05, insgesamt 1-mal geändert.
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: How-to uninstall KBs and hide them

Beitrag 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.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
cyberfrk
Beiträge: 15
Registriert: 03 Mai 2013, 23:10

Re: How-to uninstall KBs and hide them

Beitrag 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.
Benutzeravatar
SisterOfMercy
Beiträge: 1522
Registriert: 22 Jun 2012, 19:18

Re: How-to uninstall KBs and hide them

Beitrag 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
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Antworten