Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • Last Modified:

Writing a script

I need to write a script that removes an old version of software and installs a new version of software. I STINK at writing scripts and it has finally caught up to me.. Advice would be greatly appreciated.
0
Sharkgrill
Asked:
Sharkgrill
  • 4
  • 2
  • 2
1 Solution
 
mcsweenSr. Network AdministratorCommented:
This is a simple vbscript.  You will have to change the variables for uninstallPath and installPath.  Change these to the commands to remove the application (uninstall program or msiexec command to remove the app) and to install the new (make sure it's got the correct switches to make the install silent.)  My sample uninstalls TN3270 and installs a program on \\someserver\someshare

'~~~~~~START~~~~~~~~
Option Explicit
Dim wShell, uninstallPath, installPath

Set wShell = CreateObject("WScript.Shell")

uninstallPath = "C:\WINDOWS\IsUninst.exe -f"C:\Program Files\SDI\TN3270 Plus\Uninst.isu"
installPath = "\\SomeServer\Someshare\Setup.exe /s"

wShell.Run uninstallPath,,True
wShell.Run installPath,,True

WScript.Echo "Upgrade complete"
'~~~~~~~~~END~~~~~~~~~~~~~
0
 
SamuraiCrowCommented:
Just out of curiosity what is the software you are pulling/pushing?  It might be easier to mange with group policy.
0
 
SharkgrillAuthor Commented:
I am trying to uninstall the old sprint broadband wireless software and install the newer version. There is not an upgrade
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
SamuraiCrowCommented:
Does the installer package come with an MSI installer file? (Usually in the root of the CD or install folder)
0
 
SharkgrillAuthor Commented:
Yes it does.. I have a MSI creator so if it didn't I could create it
0
 
SamuraiCrowCommented:
You might consider removing the old software via script as mcsween mentioned and installing the new package via group policy.  This way the next time a package comes out you can delete the old policy (there is a setting that will remove the software if the policy is removed) and push out the new package.
0
 
mcsweenSr. Network AdministratorCommented:
I agree with SamuraiCrow, if you have a msi then I would deploy the new one via GPO.

Alternatly:

Create a GPO to deploy the OLD version (the one that's currently installed)
Wait a week or so untill all clients have installed the old package (should install right over current install)
Add the New package to the GPO and on the Upgrades tab click Add, and select the OLD package
Check the box that says "Uninstall the existing package, then install the upgrade package"

You may want to test this method on a test machine before allowing it to propogate to all of AD.
0
 
SamuraiCrowCommented:
Can you provide a link to where the software can be downloaded?  I'ld like to take a look at the install options.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now