script to uninstall

i need a script to uninstall the "metaframe presentation server web client for win32".  the version is 9.00. i have a tool called inca from gourami that installs all installed productes form the clients. we have clients installed by multiple citrix clients like ica client, pasword manager, consoles, admin tools. i want to be able to uninstall only the ica web client and as a continuation of the script i want a new version of the client to be installed for example from a shared folder.

the script should first uninstall only the web client and then install a new client (.msi) from a shared folder.

need either a batch file or vb script that can do this please. the name of the client in he attached file
ica.bmp
mgmohiuddinAsked:
Who is Participating?
 
RobSampsonConnect With a Mentor Commented:
OK, so to uninstall version 9, you can run this batch file as a StartUp script, so that you know that no programs are open at the time.

@echo off
reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Metaframe Presentation Server Web Client for Win32" /v UninstallString
if errorlevel = 1 goto END
C:\PROGRA~1\Citrix\icaweb32\wfica32.exe /unregserver
rd /s /q C:\Windows\System32\Resource
rd /s /q "C:\Program Files\Citrix\icaweb32"
del /q C:\WINDOWS\system32\ctxsetup.exe
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Metaframe Presentation Server Web Client for Win32" /f
:END


What I have done there is examine the uninst.inf file that it would otherwise use, and basically just manually do everything that it would do anyway.

Then, once the version 9 client has been uninstalled, you could just use the Presentation Server Web Interface to deploy your new client.  We are using version 11, and users are able to download and install it to their own user profile without requiring admin rights.
The install prompt for the new client is provided automatically when the Web Interface determines the client is not the required version.

Alternatively, if you wanted to have the StartUp script install it, you could add
msiexec /i \\Server\Software\Citrix\WebClient\ica32web.msi /qn ENABLE_DYNAMIC_CLIENT_NAME=Yes ENABLE_SSON=Yes ALLOW_REBOOT=No

to the end of the batch file, provided that you change \\server\software to a location that is in your NetLogon share of your domain controller, such as
msiexec /i \\domain.com\SysVol\domain.com\scripts\Software\Citrix\WebClient\ica32web.msi /qn ENABLE_DYNAMIC_CLIENT_NAME=Yes ENABLE_SSON=Yes ALLOW_REBOOT=No


Regards,

Rob.
0
 
RobSampsonCommented:
Hi there, this script should read the registry value to obtain the uninstallstring, and then uninstall it if it exists.

Then you can point the \\Server\Software\Citrix\WebClient\ica32web.msi to the MSI of your new client, and it should install that too.

Regards,

Rob.
Set objShell = CreateObject("WScript.Shell")
On Error Resume Next 
strUninstallString = objShell.RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\MetaFrame Presentation Server Web Client for Win32\UninstallString")
If Err.Number = 0 Then
	boolOldClientFound = True
Else
	boolOldClientFound = False
End If
Err.Clear
On Error Resume Next
If boolOldClientFound = True Then intReturn = objShell.Run(strUninstallString, 1, True)
strCommand = "msiexec /i \\Server\Software\Citrix\WebClient\ica32web.msi /qn ENABLE_DYNAMIC_CLIENT_NAME=Yes ENABLE_SSON=Yes ALLOW_REBOOT=No"
objShell.Run strCommand, 1, True

Open in new window

0
 
mgmohiuddinAuthor Commented:
thanks Rob

BUt the script is asking for a confirmation before removing the client, like " this will uninstall web client click yes or no". secondly it is desplaying a message the cleint has been removed. we want it to be as transparent as possible. the user should not even know that we have upgraded his client. if we give a choice to a user we cannot be sure he will do as intended.
0
 
RobSampsonCommented:
Hmmm, I can't find the old MSI for version 9, but can you run
MSIExec /X C:\ica32.msi /qn

where c:\ica32.msi points to the version 9 msi?

Rob.
0
 
mgmohiuddinAuthor Commented:
NO dosent work

now i know it is a different question all to gether. if you want i could close this one a post a new question. we tested these options and are not meeting our needs as we want our deployment/upgrade to be phased and login script and GPO is not meeting our requirements

the management wants us to use SCCM to deploy and the sequence should be as follows

1. display a message to the user that his client is being upgraded and close all ica sessions
2. for people who do not close kill the ica session
3. make sure de does not reopen it by blocking 3 url's from where he can open a new session
4. upgrade the client using silent install
5. unblock the 3 blocked url's

all te clients open citrix applications using web interface and ica files on the portal. thats why we want to block the url's for the time of the upgrade

please need this script urgent as we need  ot test it today  and provide the feedback of the results.
0
All Courses

From novice to tech pro — start learning today.