Page 1 of 1 1
Topic Options
#186024 - 2008-03-06 11:03 PM MSIEXEC /X
estrada Offline
Fresh Scripter

Registered: 2005-03-27
Posts: 19
I am trying to accomplish the following: use

MsiExec.exe /X {8C7A59A8-9ABE-459A-9A93-08C281A4A264} /qn using KIX

I cant find anyway to do this. Any ideas any advice.

Top
#186025 - 2008-03-06 11:27 PM Re: MSIEXEC /X [Re: estrada]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Did not test it but this hould work imho.

 Code:
Shell "MsiExec.exe /x /qn {8C7A59A8-9ABE-459A-9A93-08C281A4A264}"


Msiexec command-line options
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#186032 - 2008-03-07 03:59 AM Re: MSIEXEC /X [Re: Mart]
estrada Offline
Fresh Scripter

Registered: 2005-03-27
Posts: 19
Ok I created something a bit different. I want to see if I can:

1. Avoid servers and DC's (done)
2. Put some sort of auditing to central location of failed & successful removals \ additions (umm need help)
3. Remove old version (done)
4. Install latest version ( ummm almost there)
5. ONLY RUN ONCE ( yeahh need help)

Any additional help guidance is appreciated

 Code:
:INSTALL
; Create some string values for use later
$regPath="HKEY_LOCAL_MACHINE\SOFTWARE\"
$appsPath="\\xxx\xxx\Installs\xxx\"


;-------------------------
; exclude all Servers and Domain Controllers from login updates and 
; installs just in case some idiot logs in locally at the console
$OSVal = @PRODUCTTYPE
IF ( (INSTR ($OSVal,"Server") <> 0) OR 
     (INSTR ($OSVal,"Domain Controller") <> 0) )
  GOTO "END"
ENDIF
;----------------------------

$BaseKey = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{199B7F78-69B7-47C5-8D4B-A3ED1391FB6B}'
If KeyExist($BaseKey)

$return = MESSAGEBOX("The system has determined that a newer version of xxxx "
                      + "is available for your computer.  Before it can be installed "
                      + "the present version must be removed.  When the uninstall is "
                      + "completed, a reboot will be required.  To begin the removal "
                      + "please click on OK.", "xxx uninstall", 64)
  $UninstallString = Join(Split(ReadValue($BaseKey,'UninstallString'),'/I{'),'/X{') + ' /qn'
Run $UninstallString
RUN $appsPath + "xxx\setup.exe" + " REMOVE=ALL REBOOT=F/qb+/i"
  GOTO "END"

EndIf

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

:END



 

Top
#186059 - 2008-03-08 02:54 AM Re: MSIEXEC /X [Re: estrada]
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
For # 5 you could check in the registry for some kind of program version, e.g. in the UnInstall section, or even check the main executables version number.
_________________________
There are two types of vessels, submarines and targets.

Top
#186062 - 2008-03-08 11:51 AM Re: MSIEXEC /X [Re: Sealeopard]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
{8C7A59A8-9ABE-459A-9A93-08C281A4A264}
Is that ISA Server 2004?
Why do you want to uninstall ISA Server 2004 via script?

Top
#186067 - 2008-03-09 03:18 AM Re: MSIEXEC /X [Re: Witto]
estrada Offline
Fresh Scripter

Registered: 2005-03-27
Posts: 19
It's ISA 2k not 2K4 -- I am trying to upgrade to 2004
Top
#186069 - 2008-03-09 02:04 PM Re: MSIEXEC /X [Re: estrada]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
This is not ISA SERVER, but Microsoft Firewall Client. Confusing name, since it isn't a firewall at all, but an interface to ISA.

You say "Avoid servers & DCs" - do you plan to remove it if present? Or are you sure it isn't installed on any servers? (Installing MSFWC on servers is usually not a good idea.)

Installing from a UNC is not a good practice. The install path is often registered in the installation settings, and the application will look in that location for updates or additional components. Causes grief if you move your installation point. Mapping to a drive letter is better. Won't be an issue for MSFWC, but other applications are problematic. This is just FYI

For auditing, create a log file locally with /L * on your MSI install command line. Use a consistent file name on the local computer, so you and any other techs can quickly recognize the file - something like C:\TEMP\MSFWC\(UN)INSTALL.LOG. When the installation completes, you can
COPY 'C:\TEMP\MSFWC\UNINSTALL.LOG' '\\server\share\logs\@WKSTA_UNINSTALL.LOG'
and then repeat for the INSTALL.LOG. This gives you uniquely named logs on the server.

When I do these kind of upgrades, I generally create TWO scheduled tasks. The first task I define has an "At Startup" trigger, which runs right after the system reboots. It starts the INSTALL process. The second task has no trigger - I use it to start the installation process, and kick it off under script control rather than at a specific time. This runs the uninstall command and reboots the system. The install runs as soon as the system reboots. You can preload these two tasks on all workstations during the day, and trigger the uninstall script from your login script. Using the tasks allows you to employ elevated permissions for the (un)install command. tcLib and jt.exe can do this with minimal coding - copies are here and on my web site. BTW - the scheduled tasks on the computers are created from a central system - a server or my workstation, so credentials are never exposed. If you trigger the event from your login script, you'll need JT.EXE in your netlogon share.

Rather than figuring out how to run once, work on determining which process needs to happen. Something like:
 Code:
If @WKSTA "is a server"
  Exit 0 ; do nothing
EndIf

; create a function that checks for the presence
; of MSFWC and returns the version number. 
$MSFWC = DetermineMSFWCVersion()
If $MSFWC = '2004'
  Exit 0 ; current version is installed
EndIf

If $MSFWC = '2000'
  shell 'uninstall commands'
  reboot
EndIf

If Not $MSFWC
  Shell 'install comannds'
  If Exist('C:\TEMP\MSFWC\UNINSTALL.LOG'
   copy 'C:\TEMP\MSFWC\UNINSTALL.LOG' '\\server\share\logs\@WKSTA_UNINSTALL.LOG'
  copy 'C:\TEMP\MSFWC\INSTALL.LOG' '\\server\share\logs\@WKSTA_INSTALL.LOG'
EndIf

This general logic permits using the same script to uninstall and install, as appropriate. I don't use the MSFWC here at home (and we've removed it from 99% of the clients at work), so I can't give any samples to detect the installed version. You should be able to determine via a combination of registry read (version or file location) and GetFileVersion() commands.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


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

Who's Online
1 registered (StuTheCoder) and 798 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.056 seconds in which 0.022 seconds were spent on a total of 13 queries. Zlib compression enabled.

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