Jump to content


ScottXIsles

Application removes whilst in use

Recommended Posts

Hi all, First post so here goes.

 

Running SCCM 2007 and trying to deploy a newer revision of our SAP gui to about 200 users.

The problems arise when I deploy to a machine where the application is installed and in use, the batch removes the currently installed version in the background and throws the user out of the Gui. The application then send SCCM a notification to say successful.

 

Is there any way to make the package wait till the files are not in use before removing?

 

Here is the command line I have used to remove and install the new revision of the gui.

 

REM ***Removal***

"C:\Program Files\SAP\SAPsetup\setup\NwSapSetup.exe" /uninstall /product="ECL710+BW350+KW710+GUI710ISHMED+GUI710TWEAK+JNet+SAPGUI710+SAPBI" /TitleComponent:"SAPGUI710" /IgnoreMissingProducts /silent

 

REM ***Installation***

"%~dp0RSL_SAP_GUI_72_7_20110809_1041.exe" /silent

msiexec.exe /i "%~dp0SapGuiAdditionalFiles.msi" RebootYesNo="No" Reboot="ReallySuppress" /qn

 

Thanks for any help on the matter.

S

Share this post


Link to post
Share on other sites

Thanks for the response.

 

What command line would you use to query that the process is running? I dont want to kill the process as this would also throw the user from there session.

Just a query to result whether to proceed with the install or pause until files are not in use would be helpful.

 

Thanks

S

Share this post


Link to post
Share on other sites

Hello,

 

You'd probably want to have a wrapper script that waits (up to a limited period of time, not perpetually) for the GUI process to exit, and then proceed with the installation.

 

Although that is the traditional method, you can also register for WMI events using Windows PowerShell, and immediately begin the installation after the process has exited. The WMI query you would use to subscribe for such events would look like this (against the root\cimv2 WMI namespace):

 

select * from __InstanceDeletionEvent within 10 where TargetInstance ISA 'Win32_Process' and TargetInstance.Name = 'sapgui.exe'

 

Of course, you'll need to replace 'sapgui.exe' with whatever the actual process name is, but you get the idea.

 

To use this practically in PowerShell, you would use the Register-WmiEvent cmdlet, along with the -Query, -Namespace, and -Action parameters. The value passed to the -Action parameter would be a PowerShell ScriptBlock that could fire off your setup program, along with any other tasks. You may want to insert a final check for any remaining instances of 'sapgui.exe' in the event that there were multiple processes with the same name (though I've left this out of the example below).

 

$ActionBlock = { setup.exe /s; }

Register-WmiEvent -Namespace root\cimv2 -Query "select * from __InstanceDeletionEvent within 10 where TargetInstance ISA 'Win32_Process' and TargetInstance.Name = 'sapgui.exe'" -Action $ActionBlock

 

Hope this helps.

 

 

Cheers,

Trevor Sullivan

http://trevorsullivan.net

http://twitter.com/pcgeek86

Share this post


Link to post
Share on other sites

related to Lucids remark, the general best practise is to mail an IT Upgrade annoucement to the group of users affected, and/or post it on your Annoucements section of your company intranet etc..

 

Then schedule the update with interaction from the user to confirm run and have a mandatory end date, to run out of hours if needed also.

much much simpler, no need to over complicate it.

 

**step back out of the box, POV*

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for all your suggestions!

 

I have set a 90 minute timer on the application to install with SCCM and given the users the ability to run independently. I have also sent out comm's to let the user base know what to expect as part of the roll out.

 

Using this route on another package I have included a VB front end to inform the user an application will install over the next hour etc etc and what to expect. This helped pause the job until the user accepts the splash screen (all close function have been hidden) I will probably use this going forward for most big applications.

 

User communication is always the best route forward :) Thanks.

Share this post


Link to post
Share on other sites

Just by the way. There is no need to uninstall SAPGui 7.10 before installing 7.20. The Setup Routine is doing that by itself, if it is configured right. I have just updated 4200 clients to 7.20.

Simply put the installation in a task sequence and put 2 wmi queries as condition on the installation step. First one checking the installed version and the second any running SAP process.

Set the advertisement on rerun and put a schedule on it. Link it to a collection which checks the installed version of SAP.

Share this post


Link to post
Share on other sites

First create a group in your task sequence and put the first wmi query on this group. Give it a reasonable name. This group checks for an already existing installtion of 7.20 and skips everything if so. Next place another group under the first one (nested) and put the second wmi query on it. Also give it a name that points out the action in the logs. Don't forget to add the "if none" statements before the wmi queries.

Under the second group place the installation.

The installtion itself will run always under local system account.

Share this post


Link to post
Share on other sites

It's good, it works correctly, it allowed me to migrate from version 6.40 to version720 but when I run SAP Lognon, it's not start, it displays an error message saying :

Saplogon.exe - Unable To Locate Component

This application has failed to start beacause sapfewcb.dll was not found. Re-installing the application may fix this problem.

Share this post


Link to post
Share on other sites

I'm trying to do the same thing and I want to make sure I have it set up correctly. Will you please look at the screen shots and make sure I have it correct?

 

Is there a way to have a program be part of a task sequence but still allow the user to interact with it? I like to show a progress bar during installation so my users know something is happening.

post-6741-0-94484300-1317228687_thumb.png

post-6741-0-70590000-1317228695_thumb.png

Share this post


Link to post
Share on other sites

Hi kevin,

 

 

looks good this way if you want to install SAPGUI 7.10.

Task sequences however are always non interactive and programs have to be set as non interactive as well to be usable in task sequences. The only way to get some interaction into a task sequence is HTA scripting. To show the users whats going on you can use the advertisement property for the task sequence progress. Thes progress bar itself is just reflecting the the the number of steps in the task sequence, in this case 3. It will not move until the installation is finished.

Share this post


Link to post
Share on other sites

If you set it to always rerun it reruns according to your schedule. To be mentioned, "As soon as possible" is no valid schedule.

Just set it your schedule to "at logon". Chances are good that program is not running then.

To avoid a client spam create a negative collection with all clients that have not installed the program yet and apply the advertisement to this collection. As soon as the program is installed and the client runs a hardware inventory, the client object will be removed from the collection.

That's what i do with all mandatory program upgrades.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...