Page 1 of 1 1
Topic Options
#45430 - 2003-09-08 12:31 AM Windows Add Remove Programs
Johan van Huyssteen_dup1 Offline
Fresh Scripter

Registered: 2003-08-28
Posts: 22
Loc: RSA
[Moderator (Sealeopard): Moved topic from 'Scripts' to 'Starters' forum due to lack of script in body]

I need a Solution that will give me a list of add remove programs from windows 9x,me,nt,2000 and Xp. It must be inserted to os.ini and numbered eg.

1. microsoft office 97
2. fluke lan meter
3. winzip 8.1

[ 17. September 2003, 20:32: Message edited by: sealeopard ]

Top
#45431 - 2003-09-08 12:34 AM Re: Windows Add Remove Programs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
now, would this be to one system or global catalog?
also, how you consider the difference of keys like
office 97
office 97 SR-2 sp1

like, the board has multiple solutions for this.
just wonder what you are actually after.
if you want something simple to play with, something like KSMS is too much for you.
_________________________
!

download KiXnet

Top
#45432 - 2003-09-08 12:47 AM Re: Windows Add Remove Programs
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Johan:

You could enumerate the keys under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

Installed software shows up here complete with a uninstall string and other maybe useful stuff like the manufacturer, version, etc....

Not sure if this is also true with 9x and ME though.

[ 07. September 2003, 12:49: Message edited by: R2D2 ]
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#45433 - 2003-09-07 01:07 PM Re: Windows Add Remove Programs
Johan van Huyssteen_dup1 Offline
Fresh Scripter

Registered: 2003-08-28
Posts: 22
Loc: RSA
Do you have a script to enumerate the reg uninstall string a know it will work in all versions of windows.
Top
#45434 - 2003-09-07 01:56 PM Re: Windows Add Remove Programs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
here you will find multiple of those.

could I ask what you want this for?
inventory?
then you should search for inventory-scripts on this board.
dozens of them.
_________________________
!

download KiXnet

Top
#45435 - 2003-09-07 01:58 PM Re: Windows Add Remove Programs
Johan van Huyssteen_dup1 Offline
Fresh Scripter

Registered: 2003-08-28
Posts: 22
Loc: RSA
Thanks I will search for it !!
Top
#45436 - 2003-09-07 10:37 PM Re: Windows Add Remove Programs
kholm Offline
Korg Regular
*****

Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
Johan

You can use the following to enumerate the uninstall info, this will create: ProgInfo.ini

An ini-file containing the uninstall string for all software installed (Known by Windows)
Can be used on Win95 - XP [Wink]

If your inifile contains enties like:
{00170806-79E1-11D8-E60F-006097A988F7}

These are applications that are installed using the windows installer. You should use the windows installer to uninstall these application.

If the application dosn't contain a QuietUninstallString, you can try adding the parameters:
-a
/a
-s
/s
-u
/u

To the UninstallString, try them out, one by one to see if any of them works.

code:
$WsInfoFile = %TEMP% + '\ProgInfo.ini'
$RootKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
$Index = 0
$Key = EnumKey($RootKey,$Index)
While @Error = 0
$RC = EnumValue($RootKey + $Key,1)
If @Error = 0
$Value = ReadValue($RootKey + $Key,"QuietUninstallString")
If $Value = ""
$Value = ReadValue($RootKey + $Key,"UninstallString")
If $Value = ""
$Value = $Key
EndIf
EndIf
$RC = WriteProfileString($WsInfoFile,"UnInstInfo",$Key,$Value)
EndIf
$Index = $Index + 1
$Key = EnumKey($RootKey,$Index)
Loop

-Erik

Top
#45437 - 2003-09-11 03:34 PM Re: Windows Add Remove Programs
Johan van Huyssteen_dup1 Offline
Fresh Scripter

Registered: 2003-08-28
Posts: 22
Loc: RSA
Thanks

I will testand update you....

Top
#45438 - 2003-09-11 03:44 PM Re: Windows Add Remove Programs
Johan van Huyssteen_dup1 Offline
Fresh Scripter

Registered: 2003-08-28
Posts: 22
Loc: RSA
Kholm.

I need a script that will tell me what is in add remove programs and pype it to an ini file, can you assist please...........

Top
#45439 - 2003-09-11 04:08 PM Re: Windows Add Remove Programs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
johan?
doesn't the script above do just what you ask? [Confused]
_________________________
!

download KiXnet

Top
#45440 - 2003-09-11 04:34 PM Re: Windows Add Remove Programs
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
You may need to add some switches.. While Enumerating the uninstall key in the registry is fine, you may want to uninstall a program quietly..

Here is an example -
code:
IF KEYEXIST('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{2DFE1608-BDCA-11D1-B7AE-00C04FB92F3D}')
RUN 'MsiExec.exe /qn /x{2DFE1608-BDCA-11D1-B7AE-00C04FB92F3D}'
$mailhost = 'smtp.company.com'
$recipient = 'admin@@company.com'
$sender = @userid+'@@company.com'
$mailLine = @ldrive+'Programs\blat.exe - -to $recipient -server $mailhost -subject "MS Project removed!!" '
$mailLine = $mailLine+'-body "MS Project has been removed for - @userid (@fullname)" -f $sender -q'
SHELL $mailLine
ENDIF

The following resource may be helpful for the MSIEXEC (.MSI) installer -
Command-Line Switches for the Microsoft Windows Installer Tool

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#45441 - 2003-09-11 07:06 PM Re: Windows Add Remove Programs
Johan van Huyssteen_dup1 Offline
Fresh Scripter

Registered: 2003-08-28
Posts: 22
Loc: RSA
It doesn't work!!!!
Top
#45442 - 2003-09-11 07:12 PM Re: Windows Add Remove Programs
Johan van Huyssteen_dup1 Offline
Fresh Scripter

Registered: 2003-08-28
Posts: 22
Loc: RSA
Sorry its working it was in the temp in my profile path "C:\DOCUME~1\JohanVh\LOCALS~1\Temp"
I will tweak it to a other path. Thanks again...

Top
#45443 - 2003-09-11 08:02 PM Re: Windows Add Remove Programs
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
btw erik...
think the better word for the installer stuff in the uninstall key is component than app.
as, office is installed using installer and it shows up properly there.

but installer has this weird "class" of apps called component which will show up in there.
dunno what those exactly are, but not pure apps...
kinda add-ons or tools/toolsets... or something.
_________________________
!

download KiXnet

Top
#45444 - 2003-09-16 03:05 PM Re: Windows Add Remove Programs
Richie19Rich77 Offline
Seasoned Scripter
*****

Registered: 2002-08-16
Posts: 624
Loc: London, England
This function will list all installed programs, needs Functions ASort and GetSoftwareList.

Example Code
code:
Call "\\fps\admin\kix\functions\Asort().kix"
Call "\\fps\admin\kix\functions\GetSoftwareList().kix"

? "Please Type in the PC name you wish to check: "Gets$Computer

$InstalledSoftwareArray=GetSoftwareList($Computer,1)
For Each $Object in $InstalledSoftwareArray
? $Object
Next

GetSoftwareList() Function
code:
Function GetSoftwareList(OPTIONAL $Computer,OPTIONAL $Sort)
Dim $ArrayIndex, $EnumIndex, $Component, $DN, $RegKey, $SwArray[200]
If $Computer
$RegKey='\\'+$Computer+'\HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall'
Else
$RegKey='\HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall'
EndIf
$EnumIndex=0
$ArrayIndex=0
:gisloop
$Component=EnumKey($RegKey, $EnumIndex)
If NOT @Error
If NOT (Len($Component)=7 AND Left($Component,1)='Q')
; above line excludes hotfixes from listing
If NOT (0+ReadValue($RegKey+'\'+$Component,'SystemComponent'))
$DN=ReadValue($RegKey+'\'+$Component,'DisplayName')
If $DN
$SwArray[$ArrayIndex]=$DN
$ArrayIndex=$ArrayIndex+1
EndIf
EndIf
EndIf
$EnumIndex=$EnumIndex+1
GoTo gisloop
EndIf
ReDim preserve $SwArray[$ArrayIndex]
If $Sort
$GetSoftwareList=Asort($SwArray)
Else
$GetSoftwareList=$SwArray
EndIf
EndFunction

This code was developed by ScriptLogic.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1003 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.066 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org