Sign in to follow this  
Followers 0
dufran3

Script is acting funny

4 posts in this topic

Here is what my script does, at least mainly. Checks for installed versions of an application, executes the uninstall string for each one, cleans up folder and icons, then installed the latest version of the application. What is happening is, I am getting the uninstall string from the registry. Then running a loop that is executing the uninstall strings. However, it doesn't seem to be uninstalling everything, however it is trying to execute the code. This code, searches the registry for a display name that contains Star and Navigator then adds it to an array.

$count = 0

dim $FileArray[50]

SearchReg('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall','DisplayName')

Func SearchReg($searchpath, $valuename)
    For $i= 1 to 10000
        $currentkey = RegEnumKey($searchpath, $i)
        If @error <> 0 then ExitLoop

        $displayname = RegRead($searchpath & "\" & $currentkey, $valuename)
        
        ;If $displayname ==  $searchstring Then
        If StringInStr($displayname,'Star') Then
            If StringInStr($displayname,'Navigator') Then
                If not (StringInStr($displayname,'11.15')) Then
                    $FileArray[$count]=$displayname
                    $count = $count + 1
                EndIf
            EndIf
        EndIf
        
    Next
EndFunc
oÝ÷ Ø×±´Vºw-í«^Åç.µë-ë§{-jYl¶¸§¶¬yÚ'­¶®)쵩e²Úâ(֢Ʈ¶­s`¤f÷"b33c¶ÒFòb33c¶6÷VçBÒ fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷Cµ&Vr6V&6çVÖ&W"gV÷C²fײb33c¶fײ5$Äb 6V&6FW7G&÷&Vrb33´´ÄÒb3#µ4ôeEt$Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#µVæç7FÆÂb3#²b33²Âb33´F7ÆæÖRb33²Âb33c´fÆT'&²b33c¶Ò fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´f÷VæB&VrVçG'¢´ÄÒb3#µ4ôeEt$Rb3#´Ö7&÷6ögBb3#µvæF÷w2b3#´7W'&VçEfW'6öâb3#µVæç7FÆÂb3#²gV÷C²fײb33c´fÆT'&²b33c¶Òfײ5$Äb¤æW@ ¤gVæ26V&6FW7G&÷&Vrb33c·6V&6FÂb33c·fÇVVæÖRÂb33c·6V&67G&ærÂb33c·7V6ÇfÂÒ f÷"b33c¶ÒFò ´fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´7W'&VçBFW&Föâb33c¶ÒgV÷C²fײb33c¶fײ5$Äb b33c¶7W'&VçF¶WÒ&VtVçVÔ¶Wb33c·6V&6FÂb33c¶ bW'&÷"fÇC²fwC²FVâWDÆö÷  b33c¶F7ÆæÖRÒ&Vu&VBb33c·6V&6FfײgV÷C²b3#²gV÷C²fײb33c¶7W'&VçF¶WÂb33c·fÇVVæÖR ´fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´7W'&VçBF7ÆæÖS¢gV÷C²fײb33c¶F7ÆæÖR  b7G&ætå7G"b33c¶F7ÆæÖRÂb33µ7F"b33²FVà fÆUw&FTÆæRb33c´fÆT÷VâÂb33´f÷VæBb33²fײb33c¶F7ÆæÖR b33cµVæç7FÆÅ7G&ærÒ&Vw&VBb33c·6V&6Ffײb33c¶7W'&VçF¶WÂb33µVæç7FÆÅ7G&ærb33² b7G&ætå7G"b33cµVæç7FÆÅ7G&ærÂb33´5Væç7Bb33²FVà fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´WV7WFæs¢gV÷C²fײb33cµVæç7FÆÅ7G&ærfײgV÷C²âââgV÷C² 'Vä56WBb33·W6W&æÖRb33²Âb33¶FöÖâb33²Âb33·77v÷&Bb33²Ã 'VåvBb33cµVæç7FÆÅ7G&ærfײb33²Öb33² vÆR&ö6W74W7G2b33´5Væç7BæWRb33² 6ÆVW# tVæ@ &VtFVÆWFRb33c·6V&6FfײgV÷C²b3#²gV÷C²fײb33c¶7W'&VçF¶W fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´FöæRâgV÷C²fײ5$Äb VæD` VæD`  bb33c¶F7ÆæÖRÓÒb33c·6V&67G&ærFVà b33cµVæç7FÆÅ7G&ærÒ&Vu&VBb33c·6V&6Ffײb33c¶7W'&VçF¶WÂgV÷CµVæç7FÆÅ7G&ærgV÷C² b33cµVæç7FÆÂÒ7G&æu7ÆBb33cµVæç7FÆÅ7G&ærÂgV÷C²gV÷C² b7G&ætå7G"b33cµVæç7FÆÅ7G&ærÂb33´×6WV2æWRb33²FVà fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´WV7WFæs¢gV÷C²fײb33cµVæç7FÆÅ7G&ærfײgV÷C²âââgV÷C² 'Vä56WBb33·W6W&æÖRb33²Âb33¶FöÖâb33²Âb33·77v÷&Bb33²Ã 'VåvBb33cµVæç7FÆÅ7G&ærfײb33²÷76fRöæ÷&W7F'Bb33² µvåvD7FfRb33c´fÆT'&²b33c¶ÒÂb33²b33²Ã2 µvåvD6Æ÷6Rb33c´fÆT'&²b33c¶ÒÂb33²b33²Ã2 µ'VåvBb33cµVæç7FÆÅ7G&ærfײb33²÷âöæ÷&W7F'Bb33² vÆRfÆTW7G2b33´3¢b3#µ&öw&ÒfÆW2b3#´Ö6¶W76öâb3#²b33²fײb33c´fÆT'&²b33c¶Òfײb33²b3#´$ô33"b3#µ77FVÒb3#²b33² 6ÆVW# tVæ@ µ&VtFVÆWFRb33c·6V&6FfײgV÷C²b3#²gV÷C²fײb33c¶7W'&VçF¶W ´fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´FVÆWFær&Vv7G'VçG'¢gV÷C²fײb33c·6V&6Ffײb33²b3#²b33²fײb33c¶7W'&VçF¶W fÆUw&FTÆæRb33c´fÆT÷VâÂgV÷C´FöæRâgV÷C²fײ5$Äb VæD`  VæD`  æW@¤VæDgVæ0

Below is the log file...it looks as though it is running the uninstall strings correctly, but it left version 10.16 and was never uninstalled...any ideas????? please help me

Starting script 07-12-2006 12:02:00

----------------

Search Returned:

----------------

$FileArray[0] = STAR Navigator 32 Bit 9.15

$FileArray[1] = STAR Navigator 32 Bit 9.7

$FileArray[2] = STAR Navigator 10.16 Test

$FileArray[3] = STAR Navigator 11

$FileArray[4] = STAR Navigator 10.28 Test

Searching registry 5 times...

Reg search number 0

FoundSTAR Navigator 32 Bit 9.15

Executing: C:\WINDOWS\IsUninst.exe -fC:\McKessonHBOC\Uninst.isu...

Done.

FoundSTAR Navigator 10.16 Test

FoundSTAR Navigator 11

FoundSTAR Navigator 10.28 Test

Found reg entry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\STAR Navigator 32 Bit 9.15

Reg search number 1

FoundSTAR Navigator 10.16 Test

FoundSTAR Navigator 11

FoundSTAR Navigator 10.28 Test

Found reg entry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\STAR Navigator 32 Bit 9.7

Reg search number 2

FoundSTAR Navigator 10.16 Test

Executing: MsiExec.exe /X{11A98EEB-2D8B-4C51-962D-A44693DA746E}...

Done.

FoundSTAR Navigator 11

FoundSTAR Navigator 10.28 Test

Found reg entry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\STAR Navigator 10.16 Test

Reg search number 3

FoundSTAR Navigator 10.16 Test

FoundSTAR Navigator 11

FoundSTAR Navigator 10.28 Test

Found reg entry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\STAR Navigator 11

Reg search number 4

FoundSTAR Navigator 10.16 Test

FoundSTAR Navigator 11

FoundSTAR Navigator 10.28 Test

Executing: MsiExec.exe /X{CD0222B3-F620-4F16-9346-3E30742B8FCC}...

Done.

Found reg entry: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\STAR Navigator 10.28 Test

Gathering list of shortcuts to clean up...

Deleting file: 3

Deleting file: C:\Documents and Settings\All Users\Desktop\STAR Navigator 11.14.lnk

Deleting file: C:\Documents and Settings\All Users\Start Menu\Programs\STAR Navigator 10.16 Test\STAR Navigator 10.16 Test.lnk

Deleting file: C:\Documents and Settings\All Users\Start Menu\Programs\STAR Navigator 11\STAR Navigator 11.lnk

Deleting directory: 3

Deleting directory: C:\Program Files\Mckesson\STAR Navigator 10.16 Test

Deleting directory: C:\Program Files\Mckesson\STAR Navigator 10.28 Test

Deleting directory: C:\Program Files\Mckesson\STAR Navigator 11

Deleting directory: C:\Documents and Settings\All Users\Desktop\STAR Navigator 11.14.lnk

Deleting directory: C:\Documents and Settings\All Users\Start Menu\Programs\STAR Navigator 10.16 Test

Deleting directory: C:\Documents and Settings\All Users\Start Menu\Programs\STAR Navigator 11

Deleting directory: C:\Documents and Settings\All Users\Start Menu\Programs\STAR Navigator 10.16 Test\STAR Navigator 10.16 Test.lnk

Deleting directory: C:\Documents and Settings\All Users\Start Menu\Programs\STAR Navigator 11\STAR Navigator 11.lnk

Deleting file: 4

Deleting file: C:\Windows\hboc32nav1016.ini

Deleting file: C:\Windows\hboc32nav1114.ini

Deleting file: C:\Windows\HBOC32NAV915.INI

Deleting file: C:\Windows\HBOC32NAV97.INI

Deleting directory: C:\McKessonHBOC

Copying Star installer from fs1...

Done.

Running Star installer...

Done.

Writing registry branding...

Script Finished 07-12-2006 12:04:31

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

UninstallString is might be missing for v10.16? Or could be using other than IsUninst or msiexec. Edited by Joon

Share this post


Link to post
Share on other sites

I checked, after the script finishes, I can go to HKLM\Software\microsoft\windows\currentversion\uninstall, and it is still there. The uninstall string is just like the others. No extra spaces or any weirdness like that...

Share this post


Link to post
Share on other sites

After extensive research, I am getting an error when executing the .msi install. The script seems to be ok, but the .msi uninstall fails...:-(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0