TechAmok Forum Index TechAmok
Independent Technology News
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dell De-Crapifier script

 
Post new topic   Reply to topic    TechAmok Forum Index -> Software
View previous topic :: View next topic  
Author Message
admin
Site Admin
Site Admin


Joined: 28 Feb 2006
Posts: 887

PostPosted: Tue Apr 11, 2006 6:57 pm    Post subject: Dell De-Crapifier script Reply with quote

Code:

;  Dell De-Crapifier

;  Author : Jason York
;  Web    : http://www.yorkspace.com
;
;  Description:
;  This script was written to remove all of the pre-installed crap from a Dell PC
;  (as the name suggests.)  This has originally been written for a Dell Inspirion
;  1300 laptop, however, it should work on many other Dell installations.
;
;  The intent of this script is to return the machine to a usable state without
;  any annoying trial software on the machine.  Manually uninstalling all of this
;  software can easily take an hour or more of time. It is intended to be
;  executed when the machine is fresh out of the box, but could theoritically be run
;  anytime after that.
;
;  The goal is to expand this script through the help of the annoyed PC community.
;  Additions and changes are welcome and will be update for everyone's benefit. 
;  Ideally, this should be a script that can be run on any Dell machine to remove
;  the crap.  Each function should perform a check to see if the application exists
;  and then remove it without any human intervention.  If different machines require
;  different methods to remove the software, the script should also determine this.
;  In addition, it would be nice to eventually have a dialog that appears at the
;  beginning of the script that allows the user to select what should not be uninstalled.
;
;  License:  This script can be freely copied and distributed, as long as it is not
;            sold for ANY fee (including "distrobution" costs.)  Any modification to
;          this script must be submitted to the original author if the modified script
;            is distributed in any manner.  Any modification must include this header
;            information with this licence, disclaimer and original author information in tact.
;
; Disclaimer: The author is not responsible for any damage or harm caused by this
;             script.  USE AT YOUR OWN RISK.  There is no warranty, express or implied.
;


#include <file.au3>
#include <GUIConstants.au3>

Global $LogFile = "C:\dell-decrapifier.log"
Global $Label

; The /qb is the most important.  It specifies a "quiet" uninstall
Global $MsiParams = "/log c:\dell-decrapifier-msi.log /norestart /qb"


; The purpose of these simple functions is to create a convenient and
; consistent way of logging messages.
Func WriteLog($message)
   _FileWriteLog($LogFile, $message)
   GUICtrlSetData($Label,$message)
EndFunc

Func LogSearching($app)
   WriteLog($app & ": Searching")
EndFunc

Func LogNotFound($app)
   WriteLog($app & ": Not Found")
EndFunc

Func LogUninstalling($app)
   WriteLog($app & ": Uninstalling")
EndFunc

Func LogUninstallSuccess($app)
   WriteLog($app & ": Uninstall Successful")
EndFunc
   
Func LogUninstallFailed($app)
   WriteLog($app & ": Uninstall Failed")
EndFunc

;===============================================================================
;
; Description:      Executes an uninstall command and waits for completion
; Syntax:           UninstallByCommand($app, $checkfile, $command, $timeout)
; Parameter(s):     $app      - Name of the application to uninstall
;                        Used for logging purposes
;               $checkfile - Checks to see if this file exists.  This
;                         determines whether to continue with uninstall
;                   $command   - Actual command line to execute
;                   $timeout   - Max time to wait for completion
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func UninstallByCommand($app, $checkfile, $command, $timeout = 720)
   LogSearching($app)
   if (FileExists($checkfile)) Then
      LogUninstalling($app)

      ; Launch the MSI installer
      RunWait($command) 
         
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf
   
EndFunc
   
;===============================================================================
;
; Description:      Executes an uninstall based on GUID and waits for completion
; Syntax:           UninstallByGUID($app, $checkfile, $command, $timeout)
; Parameter(s):     $app      - Name of the application to uninstall
;                        Used for logging purposes
;               $guid     - Used to instruct the msi installer what to
;                        uninstall
;                   $timeout   - Max time to wait for completion
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func UninstallMsiByGuid($app, $guid, $timeout = 720)
   LogSearching($app)
   $uis = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $guid, "UninstallString")
   if (StringLen($uis) > 0) Then
      LogUninstalling($app)

      ; Launch the MSI installer
      RunWait("msiexec " & $MsiParams & " /x" & $guid) 
            
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf
   
EndFunc

;===============================================================================
;
; Description:      Executes an uninstall based on an msi file and waits for completion
; Syntax:           UninstallByGUID($app, $checkfile, $command, $timeout)
; Parameter(s):     $app      - Name of the application to uninstall
;                        Used for logging purposes
;               $file     - Used to instruct the msi installer what to
;                        uninstall (must be an msi file)
;                   $timeout   - Max time to wait for completion
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func UninstallMsiByFile($app, $file, $timeout = 720)
   LogSearching($app)
   if (FileExists($file)) Then
      LogUninstalling($app)

      ; Launch the MSI installer
      RunWait("msiexec " & $MsiParams & " /x" & $file) 
         
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf
EndFunc

;===============================================================================
;
; Description:      Uninstalls the Google Desktop and IE Search bar
; Syntax:           UninstallGoogleDesktop()
; Parameter(s):     None
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func UninstallGoogleDesktop()
   $app = "Google Desktop"
   
   LogSearching($app)
   if (FileExists("C:\Program Files\Google\Google Desktop Search\GoogleDesktop.exe")) Then
      LogUninstalling($app)
      ProcessClose("iexplore.exe")

      UninstallByCommand("Google Toolbar for Internet Explorer", "c:\program files\google\googletoolbar2.dll", _
            "regsvr32 /u /s ""c:\program files\google\googletoolbar2.dll""")


      Run("C:\Program Files\Google\Google Desktop Search\GoogleDesktopSetup.exe -uninstall")
      
      WinWait("Google Desktop")
      Sleep(5000)
      ControlClick("Google Desktop", "", "&Yes")

      WinWait("Google Desktop")
      Sleep(3000)
      ControlClick("Google Desktop", "", "&Yes")
      
      WinWait("Google Desktop")
      Sleep(3000)
      ControlClick("Google Desktop", "", "OK")
      
      ProcessWait("iexplore.exe", 5000)
      ProcessClose("iexplore.exe")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf
EndFunc

;===============================================================================
;
; Description:      Uninstalls America Online
; Syntax:           UninstallAOL()
; Parameter(s):     None
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func UninstallAOL()
   $app = "America Online"
   
   LogSearching($app)
   if (FileExists("C:\Program Files\America Online 9.0\aol.exe")) Then
      LogUninstalling($app)
      Run("C:\Program Files\Common Files\aolshare\Aolunins_us.exe")
      Sleep(4000)

      Opt("WinTitleMatchMode", 4)
      Opt("WinSearchChildren", 1)
      WinWait("Uninstall America Online")
      
      ; This section seems quite overkill, but this is what I got to work...
      ControlFocus("Uninstall America Online", "Select which files you would l", "ListBox1")
      ControlClick("Uninstall America Online", "Select which files you would l", "ListBox1")
      ; The spacebar or " " will select the item
      ControlSend("Uninstall America Online","Select which files you would l","ListBox1", " ")
      ControlClick("Uninstall America Online","Select which files you would l","Button3")
      WinWait("Uninstall America Online")
      ControlClick("Uninstall America Online", "", "&Next")

      WinWait("Uninstall America Online","America Online has been comple")
      ControlClick("Uninstall America Online","America Online has been comple","Button1")
      WinWait("Uninstall America Online","Your computer must be restarte")
      ControlClick("Uninstall America Online","Your computer must be restarte","Button2")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf
EndFunc


;===============================================================================
;
; Description:      Uninstalls Musicmatch Jukebox and Music Services
; Syntax:           UninstallMusicmatch()
; Parameter(s):     None
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func UninstallMusicmatch()
   $app = "Musicmatch Jukebox"
   
   LogSearching($app)
   Opt("WinTitleMatchMode", 4)
   if (FileExists("C:\Program Files\Musicmatch\Musicmatch Jukebox\mmjb.exe")) Then
      LogUninstalling($app)
      Run("RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\09\01\Intel32\Ctor.dll,LaunchSetup ""C:\Program Files\InstallShield Installation Information\{85D3CC30-8859-481A-9654-FD9B74310BEF}\setup.exe"" -l0x9  -uninst")
            
      WinWait("Musicmatch Jukebox","This will remove Musicmatch Ju")
      ControlClick("Musicmatch Jukebox","This will remove Musicmatch Ju","Button1")
      ;Musicmatch Jukebox - InstallShield Wizard
      WinWait("Musicmatch Jukebox","Musicmatch Jukebox has been successfully")
      ControlClick("Musicmatch Jukebox","Musicmatch Jukebox has been successfully","Button1")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   Endif

   $app = "Musicmatch Music Services"
   LogSearching($app)
   if (FileExists("C:\Program Files\MUSICMATCH\Musicmatch Music Services\coredll.dll")) Then
      LogUninstalling($app)
      Run("RunDll32 C:\PROGRA~1\COMMON~1\INSTAL~1\PROFES~1\RunTime\09\01\Intel32\Ctor.dll,LaunchSetup ""C:\Program Files\InstallShield Installation Information\{E93E5EF6-D361-481E-849D-F16EF5C78EBC}\setup.exe"" -l0x9 remove")

      WinWait("Musicmatch for Windows Media Player - InstallShield Wizard","Are you sure you want to completely")
      ControlClick("Musicmatch for Windows Media Player - InstallShield Wizard","Are you sure you want to completely","Button1")

      WinWait("Musicmatch for Windows Media Player - InstallShield Wizard","InstallShield Wizard has finished performing")
      ControlClick("Musicmatch for Windows Media Player - InstallShield Wizard","InstallShield Wizard has finished performing","Button4")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf
EndFunc

;===============================================================================
;
; Description:      Uninstalls McAffee and associated programs
; Syntax:           UninstallMcAffee()
; Parameter(s):     None
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func UninstallMcAffee()
      
   WriteLog("McAffee: Stopping Processes")
   
   ProcessClose("mghtml.exe")  ; Mcaffe Product Setup
   ProcessClose("mcvsshld.exe")
   ProcessClose("McVSEscn.exe")
   ;ProcessClose("McTskShd.exe")  Data Execution Protection
   ;ProcessClose("McShield.exe")  Data Execution Protection
   ProcessClose("mcregwiz.exe")
   ProcessClose("mcmnhdlr.exe")
   ;ProcessClose("Mcdetect.exe")  Data Execution Protection
   ProcessClose("mcagent.exe")

   Opt("WinTitleMatchMode", 4)

   $app = "McAffee Personal Firewall"
   LogSearching($app)
   if (FileExists("C:\Program Files\McAfee.com\Personal Firewall\MpfConsole.exe")) Then
      LogUninstalling($app)
      Run("c:\PROGRA~1\mcafee.com\shared\mcappins.exe /v=3 /uninstall=1 /appid=mpf /interact=0 /script_proactive=0 /start=c:\PROGRA~1\mcafee.com\agent\uninst\mpfrem.ui::uninstall.htm")
      WinWait("VBScript: McAfee Personal Firewall Plus", "It is strongly recommended")
      ControlClick("VBScript: McAfee Personal Firewall Plus", "It is strongly recommended", "&Yes")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf
   
   $app = "McAffee SpamKiller"
   LogSearching($app)
   if (FileExists("C:\Program Files\McAfee\SpamKiller\MSKClnt.exe")) Then
      LogUninstalling($app)
      RunWait("c:\PROGRA~1\mcafee.com\shared\mcappins.exe /v=3 /appid=MSK /uninstall=1 /interact=0 /script_proactive=0 /start=c:\PROGRA~1\mcafee.com\agent\uninst\mskremui.dll::uninstall.htm")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf

   $app = "McAffee VirusScan Online"
   LogSearching($app)
   if (FileExists("c:\PROGRA~1\mcafee.com\agent\uninst\vsoremui.dll")) Then
      LogUninstalling($app)
      RunWait("c:\PROGRA~1\mcafee.com\shared\mcappins.exe /v=3 /uninstall=1 /appid=vso /interact=0 /script_proactive=0 /start=c:\PROGRA~1\mcafee.com\agent\uninst\vsoremui.dll::uninstall.htm")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf

   $app = "McAffee Security Center"
   LogSearching($app)
   if (FileExists("c:\PROGRA~1\mcafee.com\agent\uninst\screm.ui")) Then
      LogUninstalling($app)
      Run("c:\PROGRA~1\mcafee.com\shared\mcappins.exe /v=3 /uninstall=1 /appid=msc /interact=0 /script_proactive=0 /start=c:\PROGRA~1\mcafee.com\agent\uninst\screm.ui::uninstall.htm")
      WinWait("VBScript: McAfee SecurityCenter", "It is strongly recommended")
      ControlClick("VBScript: McAfee SecurityCenter", "It is strongly recommended", "&Yes")
      LogUninstallSuccess($app)
   Else
      LogNotFound($app)
   EndIf


EndFunc


;===============================================================================
;
; Description:      Removes unneccessary run entries from the registry
; Syntax:           RemoveRunRegEntries()
; Parameter(s):     None
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func RemoveRunRegEntries()
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "BuildBU")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "DVDLauncher")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "ISUSPM Startup")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "ISUSScheduler")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "msci")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MSKDetectorExe")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "QBReminderFlash")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "QuickTime Task")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "RealTray")
   RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SunJavaUpdateSched")
   RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run", "DellSupport")   
EndFunc

;===============================================================================
;
; Description:      Displays the GUI status box
; Syntax:           DisplayGUI()
; Parameter(s):     None
; Requirement(s):   None
; Return Value(s):  None
; Author(s):        Jason York
;               http://www.yorkspace.com
; Note(s):          None
;
;===============================================================================
Func DisplayGUI()
   $GUIWidth = 250
   $GUIHeight = 75

   ;Create window
   GUICreate("Dell De-Crapifier", $GUIWidth, $GUIHeight, 0, 0, 0, BitOr($WS_EX_STATICEDGE, $WS_EX_TOPMOST))
   $Label = GUICtrlCreateLabel ("Done",  40, 5, 500, 300)   

   GUISetState (@SW_SHOW);
EndFunc


DisplayGUI()

UninstallMsiByGuid("QuickBooks Trial",    "{F543B12A-13F5-487E-9314-F7D25E1BBE3E}")
UninstallMsiByGuid("NetZero Installers", "{352310C3-E46B-42D3-8F32-54721FDD72D9}")
UninstallMsiByGuid("Earthlink Setup Files", "{728278A1-0BB7-45E4-AC5E-91D7C0FD1EDE}")
UninstallMsiByGuid("Corel Photo Album 6", "{8A9B8148-DDD7-448F-BD6C-358386D32354}")
UninstallMcAffee()
UninstallGoogleDesktop()
UninstallAOL()
UninstallMusicmatch()
RemoveRunRegEntries()

Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    TechAmok Forum Index -> Software All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2016 phpBB Group