#24146 - 2002-07-01 04:47 PM
Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
Is there a way to script the Removal of an installed application through a logon Script.
Without going into too much detail (unless asked), we were thinking of writing a script if possible to remove the Altiris client from all our 2000 machines. They claimed you need to go through the add/remove programs to do this. Can this be scripted? We run NT servers and 2000 machines and are using kix 4.02. If any of you can point me in the write direction, I would appreciated it.
THanks in advance. Also, thanks to all who have helped me so far. You people are wonderful.!
|
|
Top
|
|
|
|
#24147 - 2002-07-01 04:52 PM
Re: Add/Remove Programs Question (The Remove Part)
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Simple way is to find the uninstall key in the registry..
code:
$keyname = "keyname for Altiris" $uninstall = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$keyname","UninstallString") SHELL $uninstall
This may not do the uninstall silently, but you should be able to check Altiris for info on the uninstall process and add the appropriate info to the uninstall string.
(Someone may already have a polished version of this for Altiris, but this is the basic idea.)
Brian
|
|
Top
|
|
|
|
#24148 - 2002-07-01 07:53 PM
Re: Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
That worked, however, I can not get it to uninstall quietly.
Altiris refered us to their users guide and the switches they listed were
-s -a /REMOVE /s
So, my script reads now as this, but I tried other variations of putting the switches and I can't get the script to run without a prompt to confirm removal. FYI, the above listed switches does not even run the uninstall.
This is my test script.
$keyname = "{92F2A534-C3E4-4B18-BEBD-329F5E848C8B}" $uninstall = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$keyname","uninstallstring") SHELL $uninstall + " -s -a /REMOVE /s"
|
|
Top
|
|
|
|
#24149 - 2002-07-01 08:32 PM
Re: Add/Remove Programs Question (The Remove Part)
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Ok.. so what does the registry actually say at that location? (the variable $uninstall) .. If it already has switches, etc, then you may need to just specify your own uninstall command or remove the switches before adding others. If it uses MSI installer, the /Q:A switch works nicely (sorry I'm not too familiar with altiris client).
Brian [ 01 July 2002, 20:32: Message edited by: BrianTX ]
|
|
Top
|
|
|
|
#24150 - 2002-07-01 09:20 PM
Re: Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
There are no switches listed with the uninstall.
Just points to a setup.exe program
|
|
Top
|
|
|
|
#24151 - 2002-07-01 09:51 PM
Re: Add/Remove Programs Question (The Remove Part)
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Have you looked closely in the registry ?
Sometimes a program also have a value for QuietUninstallString
(Sometimes it only has a value for QuietUninstallString and none for UninstallString)
Look for valuename: QuietUninstallString
code:
$keyname = "{92F2A534-C3E4-4B18-BEBD-329F5E848C8B}" $Quiet = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$keyname","QuietUninstallString") If "$Quiet" ; You are lucky Run "$Quiet" EndIf
-Erik
|
|
Top
|
|
|
|
#24152 - 2002-07-01 10:03 PM
Re: Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
Double checked the registry, no QuietUninstallString listed. I put it in the script anyway, but alas, nothing happened.
Thanks for the suggestion though. I will have to remember that one.
|
|
Top
|
|
|
|
#24154 - 2002-07-02 07:48 PM
Re: Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
Yes, I have admin rights.
|
|
Top
|
|
|
|
#24156 - 2002-07-03 02:45 PM
Re: Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
Thanks for the 1 Cent. However, It did not work.
Thanks anyway all. I resigned to the fact that we will have to trust the users to hit 'OK'. I know it doesn't seem like a lot to expect of our users, but unfortunately, it is
Thanks for all the help anyway guys/gals.!
|
|
Top
|
|
|
|
#24159 - 2002-07-03 05:29 PM
Re: Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
According to another post, this should work also after running the setup -r command. Then I move the newly setup.iss file to the same directory that setup.exe is run. But it didn't work also.
$keyname = "{92F2A534-C3E4-4B18-BEBD-329F5E848C8B}" copy "\\eb0q2\programs\setup.iss" "C:\Program Files\InstallShield Installation Information\{92F2A534-C3E4-4B18-BEBD-329F5E848C8B}\" $uninstall = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$keyname","UninstallString") SHELL $uninstall + " -s"
I am not sure how SENDKEY works in this situation. The send key wont work until after the unstall finishes.
|
|
Top
|
|
|
|
#24162 - 2002-07-03 09:01 PM
Re: Add/Remove Programs Question (The Remove Part)
|
condichiamnotanetworkguy
Fresh Scripter
Registered: 2002-06-10
Posts: 18
Loc: Pittsburgh
|
Good Question.
Well, as I stated, I am not a network guy.
Many moons ago, we had a consultant in to look at products to push out software and updates. We got the Altiris eval. After a while, he recommended that we purchase this, so my boss did. Anyway, to make a long story short, they (our network people), never got it to work right. So they wanted it clean off the machines. I do not know all of the details. But that is the story in a nutshell.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 837 anonymous users online.
|
|
|