Page 1 of 2 12>
Topic Options
#172137 - 2006-12-28 09:30 PM MY SCRIPT WONT RUN.........PLEASE HELP
selormquarshie Offline
Getting the hang of it

Registered: 2006-12-24
Posts: 85
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

Top
#172139 - 2006-12-28 10:09 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: selormquarshie]
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
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.

Top
#172141 - 2006-12-28 10:31 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: eriqjaffe]
selormquarshie Offline
Getting the hang of it

Registered: 2006-12-24
Posts: 85
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

Top
#172146 - 2006-12-29 12:01 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: selormquarshie]
eriqjaffe Offline
Hey THIS is FUN

Registered: 2004-06-24
Posts: 214
Loc: Arlington Heights, IL USA
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. ;\)

Top
#172147 - 2006-12-29 12:38 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: selormquarshie]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
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.

.

Top
#172149 - 2006-12-29 01:26 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: NTDOC]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
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

Top
#172152 - 2006-12-29 02:50 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Witto]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
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.

.

Top
#172156 - 2006-12-29 08:56 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: NTDOC]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
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.

Top
#172158 - 2006-12-29 09:46 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Witto]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
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
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#172166 - 2006-12-29 12:33 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Witto]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
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.

Top
#172169 - 2006-12-29 02:08 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: NTDOC]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
This can all be avoided if Adobe Reader is installed using a GPO

Edited by Mart (2006-12-29 02:08 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#172183 - 2006-12-29 06:04 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Mart]
selormquarshie Offline
Getting the hang of it

Registered: 2006-12-24
Posts: 85
good call guys. i will look into this further. happy new year!!!
Top
#172206 - 2006-12-29 11:41 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: selormquarshie]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Take a look at the Adobe Customization Wizard 8 to create a MST file
Top
#172214 - 2006-12-30 12:35 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Mart]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
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.

Top
#172243 - 2006-12-30 02:41 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: NTDOC]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
with junk you mean GPO installs or Adobe Reader?
_________________________
!

download KiXnet

Top
#172260 - 2006-12-31 07:42 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Lonkero]
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11624
Loc: CA
GPO

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

Top
#172268 - 2007-01-01 05:01 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: NTDOC]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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.
_________________________
There are two types of vessels, submarines and targets.

Top
#172272 - 2007-01-01 02:10 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Sealeopard]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Do you have a good alternative?
Top
#172273 - 2007-01-01 02:36 PM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Witto]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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.
_________________________
There are two types of vessels, submarines and targets.

Top
#172359 - 2007-01-04 09:08 AM Re: MY SCRIPT WONT RUN.........PLEASE HELP [Re: Sealeopard]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
I always use GPO to roll out customized adobe, office and other progs. Works like a charm for me on Corporate networks.
Top
Page 1 of 2 12>


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

Who's Online
0 registered and 242 anonymous users online.
Newest Members
SERoyalty, mytar, Gabriel, Alex_Evos, Dansen
17869 Registered Users

Generated in 0.075 seconds in which 0.025 seconds were spent on a total of 14 queries. Zlib compression enabled.

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