MSFN Forum: Uninstall Help - MSFN Forum

Jump to content


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Uninstall Help Rate Topic: -----

#1 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 02 January 2013 - 06:34 AM

I'm new to this program and some of the scripting that it may require. I'm using this to update several computers, and I'm looking for how to create a script to uninstall the current antivirus software before installing a new one.

I know I can retrieve the current program using the getAntiVirusProduct() condition, and I've found a command that can uninstall it from the command line:

wmic product where name="AntiVirusProduct" call uninstall.

My problem is that I'm not sure how to put this into a script or batch or some other form that WPI can use. I'm 100% sure this is simple, but I haven't been able to find an example and don't know how. Thanks in advance for any help.


#2 User is offline   uphold2001 

  • Newbie
  • Group: Members
  • Posts: 13
  • Joined: 02-January 13
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 02 January 2013 - 12:29 PM

You should be able to put the complete silent uninstall switch for your AV as an executable to run for your uninstall task. What AV is it?

#3 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 02 January 2013 - 01:03 PM

It depends on where I'm at. It's not just one computer. It depends on what that particular person installed.

My larger question is how to do the scripting. For example, how can I use the getAntiVirusProduct() and put the result in a variable to use with another command. My background is in procedural programming and sql databases, but scripting in this form is new. Even if I could write a javascript file, I wouldn't know how to run it from WPI.

#4 User is offline   uphold2001 

  • Newbie
  • Group: Members
  • Posts: 13
  • Joined: 02-January 13
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 02 January 2013 - 04:23 PM

Ah, well, then that might be difficult, that is, if you want to automate it completely. However, if you were looking to just initiate the uninstall process and you can step through the rest of the way manually, you might be able to write a script that would iterate through the uninstall keys in the registry, when it found one that had 'Antivirus' or whatever in it, execute the uninstallation string (which is typically found in the registry as well). I would look for something VBScript-based, since you might not be always working with something that has the current iteration of PowerShell installed.

Some psuedocode:

Iterate through all subkeys of HKLM\software\wow6432node\microsoft\windows\currentversion\uninstall\ (and the 32-bit equivalent)

For each key, look for AV text string in the Displayname value. If string matches criteria, then execute what's contained in the 'UninstallString' value.

Examples:

HKLM\software\wow6432node\microsoft\windows\currentversion\uninstall\blah (64-bit Windows)
or
HKLM\software\microsoft\windows\currentversion\uninstall\blah (32-bit Windows)

Then, in WPI, you would simply call the script as part of your task steps.

The only other thing I could recommend is maybe looking at a utility that will remove these apps for you (assisted, or no): http://www.ghacks.ne...ler-appremover/

This post has been edited by uphold2001: 02 January 2013 - 04:24 PM


#5 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 02 January 2013 - 04:36 PM

That's helpful, but sparks a couple more questions. First, how do I call the vbscript from WPI. I've never actually written a stand-alone vbscript. I assume I would just save it as a specific filetype, drop it in the Install folder, and point the WPI command to that file. Is that close?

Secondly, since getAntiVirusProduct() will return the name of the product and I have a command that will use that name to call the uninstaller from the command line, is there a way to use what is returned by getAntiVirusProduct() in a second command?

Is that clear? Can I run a command with getAntiVirusProduct(), store that result, and then use it in the next command that runs my uninstaller?

#6 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 02 January 2013 - 04:38 PM

Actually, you can forget that it's uninstalling anything. I really just need to know how to use the response from the getAntiVirusProduct() call in a command (either embedded in a single command or somehow passed to a second command.

#7 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,325
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 02 January 2013 - 06:37 PM

http://www.msfn.org/...tivirusproduct/

Here is the main thread we tried to start for this kind of thing as you can see NO-ONE gave enough of a **** to really try to help.

#8 User is offline   uphold2001 

  • Newbie
  • Group: Members
  • Posts: 13
  • Joined: 02-January 13
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 03 January 2013 - 08:33 AM

That would be cool to use a resultant variable from the built-in functions to call in another command. Is this possible?

#9 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,325
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 03 January 2013 - 11:08 AM

If I was currently developing wpi maybe

#10 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,391
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 04 January 2013 - 03:03 AM

getAntivirusProduct

Will return the name of Antivirus installed on the computer using Configuration and Dependencies, if we change the line 1092 inside: configwizard.js

HandleConditionsSelectionMenu(!InsertCondValues ? "getAntiVirusProduct()" : 'getAntiVirusProduct()=="'+getAntiVirusProduct()+'"');


Regards

This post has been edited by myselfidem: 04 January 2013 - 03:05 AM


#11 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 04 January 2013 - 03:11 AM

Thanks, myselfidem. I'm out of the office most of the day today, but I'll check it out when I get back and see if this enables me to do what I want.

#12 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,325
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 04 January 2013 - 04:34 AM

Out of the office?

Remember WPI is not free for business use.

#13 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 04 January 2013 - 04:34 AM

What about non-profs and schools. I live overseas and volunteer for a non-profit educational institution. I say "work" but it's not like I'm getting paid.

#14 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,325
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 04 January 2013 - 04:39 AM

Which is it? Do they have official non-profit status?

Quote

3a. Non-profit and charity organizations are free to use it.

3b. Educational institutions can get discount licenses
from Kelsenellenelvian@gmail.com


WPIW License.

1. Redistribution =
You may reproduce and distribute copies of the Work or Derivative Works
thereof in any medium, with or without modifications, and in Source or
Object form, provided that You meet the following conditions:

1a. You must give any other recipients of
the Work or Derivative Works a copy of this License.

1b. You must cause any modified files to carry prominent
notices stating that you changed the files.

1c. Modifications can be posted
and shared at: MSFN\WPIW Forum Section. (www.msfn.org)

1d. Please, if you feel especially proud of your
modifications or improvements send a
copy with the changes noted to Kelsenellenelvian@gmail.com.


3. WPIW is not free for Business or Corporate use.

3a. Non-profit and charity organizations are free to use it.

3b. Educational institutions can get discount licenses
from Kelsenellenelvian@gmail.com


4. Any Business or Corporation that wishes to use
WPIW may purchase a license at the price of $100 USD.

4a. Please contact Kelsenellenelvian at kelsenellenelvian@gmail.com


5. WPIW is supplied "as-is". The author assumes no liability for damages,
direct or consequential, which may result from the use of WPIW.

#15 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 04 January 2013 - 05:01 AM

They have 501©3 status

#16 User is offline   Kelsenellenelvian 

  • WPI Guru
  • Group: Developers
  • Posts: 8,325
  • Joined: 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 04 January 2013 - 05:09 AM

Thank you very much that solves my question.

If you pm me info I will actually send them a WPI License.

I need:

Business Name
CEO\Director\Chief (Whomever the name would be on the license)
Address and country
Phone number.

It is my pleasure to provide for those who provide for others.

#17 User is offline   luckycharmsjj 

  • Group: Members
  • Posts: 8
  • Joined: 28-December 12
  • OS:none specified
  • Country: Country Flag

Posted 04 January 2013 - 05:11 AM

I'll get that done as soon as they return from the New Year holiday

#18 User is offline   myselfidem 

  • Member
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2,391
  • Joined: 06-January 10
  • OS:Windows 7 x86
  • Country: Country Flag

Posted 04 January 2013 - 11:27 PM

With the modified line inside configwizard.js we can uninstall an Antivirus Product like this example:

Microsoft Security Essentials
(using a batch file and Condition: getAntivirusProduct)

Remove.bat
@echo off
REM Uninstall MSE and display the wizard window using 'x' switch
REM Using switch 'x' and 's' for silent uninstall
cmd /c "%systemdrive%\Program Files\Microsoft Security Client\Setup.exe" /x /s
exit



config.js
prog[pn]=['Uninstaller'];
uid[pn]=['UNINSTALLER'];
ordr[pn]=[3];
dflt[pn]=['yes'];
forc[pn]=['no'];
bit64[pn]=['no'];
cat[pn]=['Applications'];
pfro[pn]=['no'];
cmds[pn]=['"%wpipath%\\Install\\AntiVirus\\Remove.bat"'];
cond[pn]=['getAntiVirusProduct()=="Microsoft Security Essentials"'];
desc[pn]=['Uninstaller'];
pn++;



WPI_Log.txt
samedi 5 janvier 2013 06:08:41
   Programme: Uninstaller
   ID unique: UNINSTALLER
   Ordre: 000003
   Catégorie: Applications
   samedi 5 janvier 2013 06:08:44 - cmd1 Succès (Code de retour 0): "cmd.exe" /C "C:\WPI_v8.6.3\Install\AntiVirus\Remove.bat"
   samedi 5 janvier 2013 06:08:44 - Installation terminée.



To know the uninstall string about Antivirus Product we can do like said uphold2001.
Look inside the registry about the Antivirus installed on the computer.

Tested and works!

HTH

This post has been edited by myselfidem: 04 January 2013 - 11:42 PM


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2013 msfn.org
Privacy Policy