selormquarshie
(Getting the hang of it)
2006-12-28 09:30 PM
MY SCRIPT WONT RUN.........PLEASE HELP

Ok so finally i'm able to get something going here...what this script does is to install adobereader 8 and uninstalls all previous versions on all computers. it doesn't seem to run.please help........

Gosub ChkInstaller
Gosub MSIparam

If Not Exist ("C:\Program Files\Adobe 8.0")
MessageBox("Installing Adobe Reader 8.0","ESI International",,2)
Shell '%systemroot%\system32\msiexec.exe /qb!- /i"\\william\admin\users\adobereader\8\AdobeReader 8.0.msi"'
WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\8.0\AdobeViewer\", "EULA", "1", "REG_DWord")

;--------------------------------------------------------------------------------------------------------------

:UNINSTAR6
; Purpose: To uninstall AdobeReader 6.x
Dim $uninst,$leftpart,$rightpart
; Read Registry key to determine in AR 6 is installed
$uninst=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Acrobat 6.0","UninstallString")
If $uninst<>""
If Exist ("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe") Exit EndIf
;Acrobat 6 detected, uninstall. Parse string, add '-y' For quiet mode
$leftpart=Left($uninst,InStr($uninst,"-f")-2)
$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
$uninst=$leftpart+" -y -a -x "+$rightpart
Shell $uninst

;==============================================================================

:UNINSTAR7
; Purpose: To uninstall AdobeReader 7.x
Dim $uninst,$leftpart,$rightpart
; Read Registry key to determine in AR 7 is installed
$uninst=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Acrobat 7.0","UninstallString")
If $uninst<>""
If Exist ("C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe") Exit EndIf
; Acrobat 7 detected, uninstall. Parse string, add '-y' for quiet mode
$leftpart=Left($uninst,InStr($uninst,"-f")-2)
$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
$uninst=$leftpart+" -y -a -x "+$rightpart
Shell $uninst


eriqjaffe
(Hey THIS is FUN)
2006-12-28 10:09 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

This bit here:

Code:
$uninst=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Acrobat 7.0","UninstallString")
If $uninst<>""
If Exist ("C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe") Exit EndIf

...is missing an "endif"

If I'm reading that right, also, you're exiting the gosub if Acrobat.exe exists before it ever gets uninstalled.

Code:
$uninst=ReadValue("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Acrobat 7.0","UninstallString")
If $uninst <> ""
     If Exist("C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe")
          <here is where you'd perform the uninstall>
     EndIf
EndIf

...seems more like the ticket.


selormquarshie
(Getting the hang of it)
2006-12-28 10:31 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

how about this new code...........
;Gosub ChkInstaller
;Gosub MSIparam

If Not Exist ("C:\Program Files\Adobe 8.0")
MessageBox("Installing Adobe Reader 8.0","ESI International",,2)
Shell '%systemroot%\system32\msiexec.exe /qb!- /i"\\william\admin\users\adobereader\8\AdobeReader 8.0.msi"'
WriteValue ("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\8.0\AdobeViewer\", "EULA", "1", "REG_DWord")

;--------------------------------------------------------------------------------------------------------------

:UNINSTAR6
; Purpose: To uninstall AdobeReader 6.x
Dim $uninst,$leftpart,$rightpart
; Read Registry key to determine in AR 6 is installed
$uninst=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Acrobat 6.0","UninstallString")
If $uninst<>""
If Exist ("C:\Program Files\Adobe\Acrobat 6.0\Acrobat\Acrobat.exe")
;Acrobat 6 detected, uninstall. Parse string, add '-y' For quiet mode
$leftpart=Left($uninst,InStr($uninst,"-f")-2)
$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
$uninst=$leftpart+" -y -a -x "+$rightpart
Shell $uninst

;==============================================================================

:UNINSTAR7
; Purpose: To uninstall AdobeReader 7.x
Dim $uninst,$leftpart,$rightpart
; Read Registry key to determine in AR 7 is installed
$uninst=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Acrobat 7.0","UninstallString")
If $uninst<>""
If Exist ("C:\Program Files\Adobe\Acrobat 7.0\Acrobat\Acrobat.exe") Exit
; Acrobat 7 detected, uninstall. Parse string, add '-y' for quiet mode
$leftpart=Left($uninst,InStr($uninst,"-f")-2)
$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
$uninst=$leftpart+" -y -a -x "+$rightpart
Shell $uninst

EndIf


eriqjaffe
(Hey THIS is FUN)
2006-12-29 12:01 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

You're still missing endif's, there has to be one for each "if". It also appears as if you're still exiting the subroutines before you shell out to the uninstaller...

Another thing I just noticed...your code references "ChkInstaller" and "MSIParam", but I don't see where those are.

Structurally, I think something like this would make more sense:

1) Check for Reader 6, uninstall it if it's there.
2) Check for Reader 7, uninstall it if it's there.
3) Install Reader 8.

Really, there's no need for GOSUBs at all, since that would work just fine if you did it as a linear sequence...besides, GOTO and GOSUB generally aren't considered best practice 'round these parts. ;\)


NTDOCAdministrator
(KiX Master)
2006-12-29 12:38 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Hello selormquarshie and welcome to the board.

When you registered you were presented with some information on how to use the board and how to post. Please take a few moments and read this FAQ on how to post.

You should post your code within the CODE TAGS to preserve the formatting and make it easier for others to read your code and assist you better.

The Post/Reply Formatting Box and How to use it
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=171901


Thanks guy.

.


Witto
(MM club member)
2006-12-29 01:26 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

eriqjaffe, correct me if I am wrong.
AFAIK, The installation of Adobe Reader 7 uninstalled or upgraded Adobe Reader 6. I presume installing Adobe Reader 8 will uninstall or upgrade versions 6 and 7. If that is true, I do not see the need to uninstall versions 6 or 7.
If versions 5 or older are installed on some computers, then they need to be uninstalled first.
I would also try to avoid the Gosub statements


NTDOCAdministrator
(KiX Master)
2006-12-29 02:50 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Without customization I don't think version 8 cares. During a manual install you can have any version installed and 8 ignores it and installs in it's own directory.

.


Witto
(MM club member)
2006-12-29 08:56 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Have you given it a try?
IIRC, the customised install I made at work for version 7.x removed version 6.x.
A first try with version 8.0.0, not customised, removed this 7.x customised install from my computer.


Mart
(KiX Supporter)
2006-12-29 09:46 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Not tested but this rewtite of the code might work.
No ugly GoSub's and stuff.

Code:
Break on

$key = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"

$ar6 = ReadValue($key + "Adobe Acrobat 6.0","UninstallString")
$ar7 = ReadValue($key + "Adobe Acrobat 7.0","UninstallString")
$ar8 = Exist("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe")
;
If $ar6 <> ""
	;Acrobat 6 detected, uninstall. Parse string, add '-y' For quiet mode
	$leftpart=Left($uninst,InStr($uninst,"-f")-2)
	$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
	$uninst=$leftpart+" -y -a -x "+$rightpart
	Shell $uninst
EndIf
If $ar7 <> ""
	; Acrobat 7 detected, uninstall. Parse string, add '-y' for quiet mode
	$leftpart=Left($uninst,InStr($uninst,"-f")-2)
	$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
	$uninst=$leftpart+" -y -a -x "+$rightpart
	Shell $uninst
EndIf
If $ar8 <> "1"
	MessageBox("Installing Adobe Reader 8.0","ESI International",,2)
	Shell '%systemroot%\system32\msiexec.exe /qb!- /i"\\william\admin\users\adobereader\8\AdobeReader 8.0.msi"'
	WriteValue ("HKLM\SOFTWARE\Adobe\Acrobat Reader\8.0\AdobeViewer\", "EULA", "1", "REG_DWord")
EndIf


NTDOCAdministrator
(KiX Master)
2006-12-29 12:33 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Yes, I installed 8 with a non customized 7 and it left it alone.

But I did have the Pro version installed which may have an impact.


Mart
(KiX Supporter)
2006-12-29 02:08 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

This can all be avoided if Adobe Reader is installed using a GPO

selormquarshie
(Getting the hang of it)
2006-12-29 06:04 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

good call guys. i will look into this further. happy new year!!!

Witto
(MM club member)
2006-12-29 11:41 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Take a look at the Adobe Customization Wizard 8 to create a MST file

NTDOCAdministrator
(KiX Master)
2006-12-30 12:35 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Originally Posted By: Mart
This can all be avoided if Adobe Reader is installed using a GPO


ROFL - No thanks - I don't care for that junk either.


LonkeroAdministrator
(KiX Master Guru)
2006-12-30 02:41 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

with junk you mean GPO installs or Adobe Reader?

NTDOCAdministrator
(KiX Master)
2006-12-31 07:42 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

GPO

Just never was a big fan of those types of installs.


Sealeopard
(KiX Master)
2007-01-01 05:01 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

The idea of GPO-controlled software installs and upgrades was nice. However, I think it's a feature more suited for small businesses rather than larger corporations.

Witto
(MM club member)
2007-01-01 02:10 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Do you have a good alternative?

Sealeopard
(KiX Master)
2007-01-01 02:36 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Larger corporations rather use the likes of Microsoft SMS, Altiris, or other deployment tools. However, they normally have the advantage of manpower and budget to go for those solutions.

My company uses SMS to roll out things like Adobe and other software upgrades.


Arend_
(MM club member)
2007-01-04 09:08 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

I always use GPO to roll out customized adobe, office and other progs. Works like a charm for me on Corporate networks.

Witto
(MM club member)
2007-01-04 10:35 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Interesting. How big are these networks? Are all computers on one LAN?

Phoenix1987
(Fresh Scripter)
2007-01-04 10:47 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Originally Posted By: Mart
Not tested but this rewtite of the code might work.
No ugly GoSub's and stuff.

Code:
Break on

$key = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"

$ar6 = ReadValue($key + "Adobe Acrobat 6.0","UninstallString")
$ar7 = ReadValue($key + "Adobe Acrobat 7.0","UninstallString")
$ar8 = Exist("C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe")
;
If $ar6 <> ""
	;Acrobat 6 detected, uninstall. Parse string, add '-y' For quiet mode
	$leftpart=Left($uninst,InStr($uninst,"-f")-2)
	$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
	$uninst=$leftpart+" -y -a -x "+$rightpart
	Shell $uninst
EndIf
If $ar7 <> ""
	; Acrobat 7 detected, uninstall. Parse string, add '-y' for quiet mode
	$leftpart=Left($uninst,InStr($uninst,"-f")-2)
	$rightpart=Right($uninst,Len($uninst)-InStr($uninst,"-f")+1)
	$uninst=$leftpart+" -y -a -x "+$rightpart
	Shell $uninst
EndIf
If $ar8 <> "1"
	MessageBox("Installing Adobe Reader 8.0","ESI International",,2)
	Shell '%systemroot%\system32\msiexec.exe /qb!- /i"\\william\admin\users\adobereader\8\AdobeReader 8.0.msi"'
	WriteValue ("HKLM\SOFTWARE\Adobe\Acrobat Reader\8.0\AdobeViewer\", "EULA", "1", "REG_DWord")
EndIf


Hi

Im looking for some code like above.
For me the code works only for installing 8.0 he doesnt install a version of 7.

does anybody see the problem ?


Björn
(Korg Regular)
2007-01-04 11:12 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

Well, Mart made it for ya as a re-write of your code with gotos and subs, so it does only checks for version 6 and 7, and then installs 8. I thought that the thing was that you wanted the version 8 to be the only version installed?
So, there is no problem more then you want something else \:\)


Phoenix1987
(Fresh Scripter)
2007-01-04 11:18 AM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

o ok

i thought it supposed to uninstall the other version


Björn
(Korg Regular)
2007-01-04 12:49 PM
Re: MY SCRIPT WONT RUN.........PLEASE HELP

it does.