locked
How to handle Systemtray shortcuts exit in App-V ? RRS feed

  • Question

  • I sequenced an application which contains several shortcuts. When i launch one if the shortcut and close, it creates an entry in "SystemTray". So, the shortcut was not "Shutdown" untill it exited from "SystemTray". This stops the Application to unpublish at client end.

    So, how can i handle "SystemTray" Shortcuts in App-v ?

    Please help me.Its Urgent.

    Thanks in Advance,

    JS Reddy

    Tuesday, January 31, 2012 1:51 PM

Answers

  • Sorry, not at launch but at shutdown:

    POST SHUTDOWN
    This attribute runs the script after the program is shut down. For example, use this attribute to clean up configuration settings or to delete configuration files.

    http://support.microsoft.com/kb/939085

    Tuesday, January 31, 2012 2:28 PM
  • Ok, sometimes I use LaunchIt to launch the main exe from the shortcut. This application catches subprocesses from the main application and terminates them if the main app shuts down.

    So add this file to your package and edit you osd... make launchit.exe the filename and parameter you package exe.

    • Proposed as answer by znack Tuesday, February 7, 2012 7:29 AM
    • Marked as answer by Aaron.ParkerModerator Friday, November 16, 2012 11:38 PM
    Wednesday, February 1, 2012 2:00 PM

All replies

  • hi

    write a script to kill the system tray proces (for that application ) and include with sript during the sequance


    shinu Thomas

    go to dependency tab write click select element and add your script there

    • Edited by shinub Tuesday, January 31, 2012 2:18 PM
    Tuesday, January 31, 2012 2:06 PM
  • If the application doesn't close on exit but instead is minimized on exit, this is by design of the application.

    Perhaps you can change this setting in the application itself? (option/setting or a registry key)

    Try to find this setting, and change this in your sequence.

    Or learn the users to right-click the systemtray icon to close the application?

    Tuesday, January 31, 2012 2:10 PM
  • Hi Ben,

    It is the EXE behaviour to create an entry in System Tray. No registries or options found to control the application.

    And Client is not interested to exit the application manually from system tray.

    So any alternate way to exit the application from OSD?

    Thanks in advance,

    JS Reddy

    Tuesday, January 31, 2012 2:16 PM
  • Yes, you can create a post-launch script in your OSD file. Use tskill.exe to close the application.

    Tuesday, January 31, 2012 2:19 PM
  • Or taskkill.exe, type "taskkill /?" at the command prompt for more info.
    Tuesday, January 31, 2012 2:23 PM
  • Hi Ben,

    The Post launch Script might not be a right IDEA. If we write the Post launch script, it closes the main process after the shortcut launched, so the shortcut will be closed. So the behavour is like shortcut launches and closes without the shortcut available for the user.

    Please think it once again.

    Thanks in advance,

    JS Reddy

    Tuesday, January 31, 2012 2:25 PM
  • Hi Ben,

    The shortcut should be closed only when the user exit the shortcut.

    Thanks

    JS Reddy

    Tuesday, January 31, 2012 2:27 PM
  • Sorry, not at launch but at shutdown:

    POST SHUTDOWN
    This attribute runs the script after the program is shut down. For example, use this attribute to clean up configuration settings or to delete configuration files.

    http://support.microsoft.com/kb/939085

    Tuesday, January 31, 2012 2:28 PM
  • use bellow code     it may work 

              <DEPENDENCY>

                                    <CLIENTVERSION VERSION="4.6.0.0"/>

                                    <SCRIPT TIMING="PRE" EVENT="CLOSE" WAIT="TRUE" PROTECT="TRUE">

                                                    <SCRIPTBODY>taskkill /im "application name" /f</SCRIPTBODY>

                                    </SCRIPT>

                    </DEPENDENCY>


    shinu Thomas
    Tuesday, January 31, 2012 2:29 PM
  • Hi Shinu

    "EVENT="CLOSE" will not be existed in app-v. EVENT="SHUTDOWN" will be existed in App-V.

    Thanks,

    JS Reddy

    Tuesday, January 31, 2012 2:57 PM
  • Hi Ben,

    The POST SHUTDOWN is also not working. Because, the POST SHUTDOWN will come in to picture only when the shortcut is shutting down.

    But, In our case, our main aim is to make the shortcut SHUTDOWN succesful.

    Thanks in Advance,

    JS Reddy

     

    Tuesday, January 31, 2012 2:59 PM
  • Let's start from the top again.

    Is the system tray icon associated with a process separate from the process being run by the OSD file?

          -If so, does the system tray icon provide any functionality that the program or users need?

              -If so, then I think you're out of luck :(

              -If not, then run a script in the OSD file to kill the process at startup (as has already been suggested)

         -If not, then I think you're out of luck :(

     

    I hope that makes sense.  By "I think you're out of luck" I mean that there still MAY be hope, but I'm out of ideas.  For the first "fail" case, you may be able to come up with some elaborate fix that separates the system tray's process from the rest of the package, runs using its own OSD file, and is started and stopped by the OSD file of the original program.

    Just let us know which of the above scenarios you are in, for starters.


    • Edited by S_Sanchez Wednesday, February 1, 2012 1:29 AM
    Wednesday, February 1, 2012 1:28 AM
  • thanks reddy i means it was shutdown


    shinu Thomas
    Wednesday, February 1, 2012 6:50 AM
  • You're correct a POST SHUTDOWN script doesn't work in this case, it will be executed when the systemtray icon is closed itself.

    Does de systemtray icon has another name then the application process name? If these names are different you can close the systemtray icon with a LAUNCH script. So that the systemtray process is closed immediately at application startup.

    Wednesday, February 1, 2012 9:18 AM
  • Hi Ben,

    You are correct. The application main process invoking an another process and its going away.

    So, this can be impimented by a Pre-launch script to kill the process which was already running for System Tray. But the probelm is when iam trying to unpublish the application, the application fails to Unpublish as the process was already running in background. So, Pre-Launch script is also not a complete solution.

    Thanks,

    JS Reddy

    Wednesday, February 1, 2012 9:26 AM
  • Hi Shinu,

    The SHUTDOWN script could not be succesful as the application was not closing when exits. so, the SHUTDOWN script will not even run till the user manually exits the System Tray.

    Thanks,

    JS Reddy

    Wednesday, February 1, 2012 9:27 AM
  • Hello,

    If the program is installed natively - when does the system tray icon close? If there is a shortcut starting it - why not remove the shortcut?
    Nicke Källén | The Knack| Twitter: @Znackattack
    Wednesday, February 1, 2012 11:20 AM
  • HI Znaxk,

    The System tray closes when the application is manually exited from the System tray. The shortcut could not close the system tray. (In MSI Package, we do handle through a taskkill custom action).

    Thanks

    JS Reddy

    Wednesday, February 1, 2012 11:46 AM
  • Try to set <VIRTUALENV TERMINATECHILDREN="FALSE"> to <VIRTUALENV TERMINATECHILDREN="TRUE">

    Wednesday, February 1, 2012 12:16 PM
  • HI Tibervs,

    Try to set <VIRTUALENV TERMINATECHILDREN="FALSE"> to <VIRTUALENV TERMINATECHILDREN="TRUE">

    Not worked.........

    Wednesday, February 1, 2012 1:02 PM
  • Ok, sometimes I use LaunchIt to launch the main exe from the shortcut. This application catches subprocesses from the main application and terminates them if the main app shuts down.

    So add this file to your package and edit you osd... make launchit.exe the filename and parameter you package exe.

    • Proposed as answer by znack Tuesday, February 7, 2012 7:29 AM
    • Marked as answer by Aaron.ParkerModerator Friday, November 16, 2012 11:38 PM
    Wednesday, February 1, 2012 2:00 PM