1 of 1 people found this helpful
you can do it with a script (batch, AutoIT, VBS), only!
With the tools tasklist / taskkill on XP or with the tool pskill (http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx) you can do it on NT 4, W2K, XP, Vista...
- Check for the running task,
- stop the running task
- start your installation
I've forgot to explain something: I've only one SWD package for this application and I've no possibility to run a script or something else before pushing this package.
I'm looking for an option in LDMS distribution method or package.
What type of package is this? You said SWD but is that a LANDesk package builder package or are you just shortening Software Distribution to SWD? If the package builder than you have a run at start capability that would allow you to run the suggested process.
Mark Star - MarXtar LANDesk Enhancements
Home of Power State Notifier & Wake-On-WAN for LANDesk
The way to do it is a wrapper.
I.e. - a batch-file (or AUTOIT script) for instance -- that way you can check for the process, kill it, and then proceed with the installation.
There's no way "inside LANDesk" to "install package only once you've killed process X" - if this is the sort of advanced thing you need to do, a wrapper is the only way to do it (especially as this strikes me as an extremely "one off" situation).
So in short:
Stage 1 - Detect whether the process is running.
Stage 2 - Kill the process if necessary
Stage 3 - Install your package
Stage 4 (?) - (re-)start your process
LANDesk EMEA Technical Lead
The application is EXE that I can't not modifer because it is given by another company. I try to know if this application is in memory before deploye a update. Is there a variable in memory or an option in landesk to find this ?
sorry fir y poor english (simple french user)
there exist some different ways to do it...
You can create a Batch file distribution package, which checks for processes and send a successfull exit code if the process was killed.
This Batch package is a dependent package of your SWD distribution package, so if you start your SWD package the Batch package will be started and if successful your SWD package will be started.
2. method: (the better one)
Start your SWD package in a Batch file distribution package. In this document About Batch File Distribution Packages you can see (on page 31) how to start a SWD package in a batch.
So you can't modify the existing package, why not create another script along the lines of what Axel indicated - I would Autoit - very easy. Make that package (checks for application X and then kills, or if you use Autoit, you could gracefully close it) a prerequisite package? The kill package would run first before the main installation package. Cool part if the prereq fails it will not install the main.
You don't need to modify the EXE.
What you do is build ANOTHER package (the wrapper) around this EXE ... it's this package (that you build) which does the whole detection & killing of process(-es) for you. Only when this part is "OK" does it launch your executable.
You don't modify the existing package - at all. You just wait before running it, while YOUR other package (the wrapper) prepares the system.
Is this any clearer?
LANDesk EMEA Technical Lead
It seems, we've all the same idea at the same time...
I don't want to kill the process because it's a oracle client and may be with some data open. I'm trying to do this:
1- if the process oracle client run, then don't install the update.
2- if not, then install the udpate by push method.
It's seem very simple but I don't know how to script this.
Is somebody helping me in scripting (bat or ms) ?
See my reply.
What ZMan said.
(And yeah, looks like all of us jumped at the same time. We should get points for style ).
LANdesk EMEA Technical Lead
I don't know the process name of your running oracle client but you can use this as a model, not tested, no error handling, only a fast quick&dirty hack...
tasklist |find /i "oracle_client.exe">nul If errorlevel 1 goto NORUNNING REM no installation of your software set exitcode=1 goto END :NORUNNING REM Intallation of your software... YourOracleSWDpackage.exe /Ai /Ao /An /Ah- If erroflevel 1 set exitcode=0 goto END :END exit %exitcode%
For other OS's like W2K, try to use pslist from sysinternals page (s. posting above)